One gRPC service per domain in state.v1 (tasks, executions, accounts, identities, packages, captures, bindings, access, orgs, alerts and so on), each with its own server type in staterpc. RPC and message names and numbers are unchanged.
123 lines
4.9 KiB
Protocol Buffer
123 lines
4.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package state.v1;
|
|
|
|
// Installed Archie packages. Administrative until org-scoped principals land.
|
|
service PackageService {
|
|
rpc InstallPackage(InstallPackageRequest) returns (InstallPackageResponse);
|
|
// ListCatalogue returns the packages the instance's verified catalogue
|
|
// offers; InstallFromCatalogue installs one by name at the digest it lists.
|
|
rpc ListCatalogue(ListCatalogueRequest) returns (ListCatalogueResponse);
|
|
rpc InstallFromCatalogue(InstallFromCatalogueRequest) returns (InstallFromCatalogueResponse);
|
|
rpc GetInstalledPackage(GetInstalledPackageRequest) returns (GetInstalledPackageResponse);
|
|
rpc ListInstalledPackages(ListInstalledPackagesRequest) returns (ListInstalledPackagesResponse);
|
|
// AcceptPackageAuthority records the operator's accepted authority against
|
|
// the pinned digest (the approve action; install is the create action).
|
|
// Administrative until org-scoped principals land.
|
|
rpc AcceptPackageAuthority(AcceptPackageAuthorityRequest) returns (AcceptPackageAuthorityResponse);
|
|
rpc RemoveInstalledPackage(RemoveInstalledPackageRequest) returns (RemoveInstalledPackageResponse);
|
|
// UpdatePackage moves a package to the digest the verified catalogue lists:
|
|
// a non-widening update applies, a widening one waits as pending.
|
|
// ApprovePackageUpdate applies the pending update and accepts its authority;
|
|
// RollbackPackage restores the previous digest and its accepted authority.
|
|
rpc UpdatePackage(UpdatePackageRequest) returns (UpdatePackageResponse);
|
|
rpc ApprovePackageUpdate(ApprovePackageUpdateRequest) returns (ApprovePackageUpdateResponse);
|
|
rpc RollbackPackage(RollbackPackageRequest) returns (RollbackPackageResponse);
|
|
// SetPackageUpdatePolicy sets "manual" or "auto"; the State Store updates
|
|
// auto packages on a timer.
|
|
rpc SetPackageUpdatePolicy(SetPackageUpdatePolicyRequest) returns (SetPackageUpdatePolicyResponse);
|
|
}
|
|
|
|
message InstalledPackage {
|
|
string org_id = 1;
|
|
string name = 2;
|
|
string reference = 3;
|
|
string digest = 4;
|
|
bytes descriptor_json = 5;
|
|
bytes layer = 6;
|
|
string update_policy = 7;
|
|
// The operator's accepted authority, recorded against the pinned digest.
|
|
// Absent until the operator accepts (docs/prds/store.md, "Authority").
|
|
PackageAuthority accepted_authority = 8;
|
|
// An update waiting for approval of widened authority; the live pin above
|
|
// is unchanged until then.
|
|
PackagePin pending = 9;
|
|
// The pin the last update or rollback replaced, with the authority accepted
|
|
// against it.
|
|
PackagePin previous = 10;
|
|
PackageAuthority previous_accepted_authority = 11;
|
|
// What the pending update declares.
|
|
PackageAuthority pending_authority = 12;
|
|
}
|
|
message PackagePin {
|
|
string reference = 1;
|
|
string digest = 2;
|
|
}
|
|
// PackageAuthority mirrors storepkg.Authority: the grants a package needs to
|
|
// operate. An acceptance record is an upper bound, checked field by field.
|
|
message PackageAuthority {
|
|
repeated string credential_services = 1;
|
|
repeated string egress_hosts = 2;
|
|
repeated string forge_permissions = 3;
|
|
repeated string triggers = 4;
|
|
repeated string tools = 5;
|
|
repeated string env = 6;
|
|
}
|
|
// Package and denial requests act in the org the State Store derives from the
|
|
// caller's principal, else the default org.
|
|
message InstallPackageRequest {
|
|
reserved 1;
|
|
reserved "org_id";
|
|
string name = 2;
|
|
string reference = 3;
|
|
string digest = 4;
|
|
}
|
|
message InstallPackageResponse { InstalledPackage package = 1; }
|
|
message CatalogueEntry {
|
|
string name = 1;
|
|
string surface = 2;
|
|
string version = 3;
|
|
string description = 4;
|
|
string reference = 5;
|
|
string digest = 6;
|
|
}
|
|
message ListCatalogueRequest {}
|
|
message ListCatalogueResponse { repeated CatalogueEntry packages = 1; }
|
|
message InstallFromCatalogueRequest { string name = 1; }
|
|
message InstallFromCatalogueResponse { InstalledPackage package = 1; }
|
|
message GetInstalledPackageRequest {
|
|
reserved 1;
|
|
reserved "org_id";
|
|
string name = 2;
|
|
}
|
|
message GetInstalledPackageResponse { InstalledPackage package = 1; }
|
|
message ListInstalledPackagesRequest {
|
|
reserved 1;
|
|
reserved "org_id";
|
|
}
|
|
message ListInstalledPackagesResponse { repeated InstalledPackage packages = 1; }
|
|
message AcceptPackageAuthorityRequest {
|
|
reserved 1;
|
|
reserved "org_id";
|
|
string name = 2;
|
|
PackageAuthority accepted = 3;
|
|
}
|
|
message AcceptPackageAuthorityResponse { InstalledPackage package = 1; }
|
|
message RemoveInstalledPackageRequest {
|
|
reserved 1;
|
|
reserved "org_id";
|
|
string name = 2;
|
|
}
|
|
message RemoveInstalledPackageResponse {}
|
|
message UpdatePackageRequest { string name = 1; }
|
|
message UpdatePackageResponse { InstalledPackage package = 1; }
|
|
message ApprovePackageUpdateRequest { string name = 1; }
|
|
message ApprovePackageUpdateResponse { InstalledPackage package = 1; }
|
|
message RollbackPackageRequest { string name = 1; }
|
|
message RollbackPackageResponse { InstalledPackage package = 1; }
|
|
message SetPackageUpdatePolicyRequest {
|
|
string name = 1;
|
|
string policy = 2;
|
|
}
|
|
message SetPackageUpdatePolicyResponse { InstalledPackage package = 1; }
|