blob: 683f51d090d7333f9b30d08bd6d32df3e31c1dc9 [file] [log] [blame]
syntax = "proto3";
package bufman.dubbo.apache.org.registry.v1alpha1;
import "registry/v1alpha1/organization.proto";
import "registry/v1alpha1/plugin.proto";
import "registry/v1alpha1/repository.proto";
import "registry/v1alpha1/user.proto";
import "registry/v1alpha1/verification_status.proto";
// BreakingChangeCategory is the allowed list of categories for breaking rule settings.
enum BreakingChangeCategory {
BREAKING_CHANGE_CATEGORY_UNSPECIFIED = 0;
BREAKING_CHANGE_CATEGORY_FILE = 1;
BREAKING_CHANGE_CATEGORY_WIRE_JSON = 2;
}
message BreakingChangePolicy {
optional bool enabled = 1;
optional bool ignore_unstable_packages = 2;
BreakingChangeCategory category = 3;
}
// UniquenessPolicy is the policy for uniqueness on the server.
message UniquenessPolicy {
// Whether uniqueness policy is enforced.
bool enabled = 1;
}
// Collision is a collision that has occurred.
message Collision {
// The reference that has collisions.
string reference = 1;
// The type of collision.
CollisionType type = 2;
// The sources of the collision that the user is authorized to see.
repeated CollisionSource sources = 3;
// Whether there are other collision sources that the user is not authorized to see.
// The user should contact a server admin for more information about these collisions.
bool has_other_collision_sources = 4;
}
// CollisionSource is the source of a collision
message CollisionSource {
// The name of the owner of the source.
string owner_name = 1;
// The name of the repository of the source.
string repository_name = 2;
// The path of the file that is the source of the collision.
string path = 3;
}
// CollisionType is the type of collisions that can occur.
enum CollisionType {
// Unspecified collision type.
COLLISION_TYPE_UNSPECIFIED = 0;
// A fully qualified proto name
COLLISION_TYPE_FULLY_QUALIFIED_NAME = 1;
// A proto file path
COLLISION_TYPE_PATH = 2;
}
// AdminService is the Admin service.
service AdminService {
// ForceDeleteUser forces to delete a user. Resources and organizations that are
// solely owned by the user will also be deleted.
rpc ForceDeleteUser(ForceDeleteUserRequest) returns (ForceDeleteUserResponse) {
option idempotency_level = IDEMPOTENT;
}
// Update a user's verification status.
rpc UpdateUserVerificationStatus(UpdateUserVerificationStatusRequest) returns (UpdateUserVerificationStatusResponse);
// Update a organization's verification.
rpc UpdateOrganizationVerificationStatus(UpdateOrganizationVerificationStatusRequest) returns (UpdateOrganizationVerificationStatusResponse);
// Create a new machine user on the server.
rpc CreateMachineUser(CreateMachineUserRequest) returns (CreateMachineUserResponse) {
option idempotency_level = IDEMPOTENT;
}
// Get breaking change policy for the server.
rpc GetBreakingChangePolicy(GetBreakingChangePolicyRequest) returns (GetBreakingChangePolicyResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// Update breaking change policy for the server.
rpc UpdateBreakingChangePolicy(UpdateBreakingChangePolicyRequest) returns (UpdateBreakingChangePolicyResponse);
// Get uniqueness policy for the server.
rpc GetUniquenessPolicy(GetUniquenessPolicyRequest) returns (GetUniquenessPolicyResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// Update uniqueness policy enforcement for the server.
rpc UpdateUniquenessPolicy(UpdateUniquenessPolicyRequest) returns (UpdateUniquenessPolicyResponse);
// Get state of uniqueness collisions for the server
rpc ListServerUniquenessCollisions(ListServerUniquenessCollisionsRequest) returns (ListServerUniquenessCollisionsResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
}
message ForceDeleteUserRequest {
string user_id = 1;
}
message ForceDeleteUserResponse {
// The deleted user.
User user = 1;
// The deleted organizations.
repeated Organization organizations = 2;
// The deleted repositories.
repeated Repository repositories = 3;
// The deleted plugins.
repeated Plugin plugins = 4 [deprecated = true];
// The deleted templates.
repeated Template templates = 5 [deprecated = true];
}
message UpdateUserVerificationStatusRequest {
string user_id = 1;
VerificationStatus verification_status = 2;
}
message UpdateUserVerificationStatusResponse {}
message UpdateOrganizationVerificationStatusRequest {
string organization_id = 1;
VerificationStatus verification_status = 2;
}
message UpdateOrganizationVerificationStatusResponse {}
message CreateMachineUserRequest {
string username = 1;
}
message CreateMachineUserResponse {
User user = 1;
}
message GetBreakingChangePolicyRequest {}
message GetBreakingChangePolicyResponse {
BreakingChangePolicy policy = 1;
}
message UpdateBreakingChangePolicyRequest {
BreakingChangePolicy policy = 1;
}
message UpdateBreakingChangePolicyResponse {}
message GetUniquenessPolicyRequest {}
message GetUniquenessPolicyResponse {
UniquenessPolicy policy = 1;
}
message UpdateUniquenessPolicyRequest {
UniquenessPolicy policy = 1;
}
message UpdateUniquenessPolicyResponse {}
message ListServerUniquenessCollisionsRequest {
// Token of the page to retrieve. If not specified, the first page of
// results will be returned. Use the value obtained from `next_page_token`
// in the previous response in order to request the next page of results.
string page_token = 1;
// Number of elements to retrieve in a single page.
// When too large a page is requested, the server may decide to further
// limit the number of returned resources.
uint32 page_size = 2;
// The desired collision type to filter by.
// This must be specified. Only collisions of the specified type will be returned,
// continue to page through results until no more collisions of the specified
// type are returned.
CollisionType collision_type = 3;
}
message ListServerUniquenessCollisionsResponse {
// The collisions.
repeated Collision collisions = 1;
// Pagination token used to retrieve the next page of results.
// Pass the content of this string as the `page_token` attribute of
// the next request. `next_page_token` is not returned for the last
// page.
string next_page_token = 2;
}