feat: org remove on admin api and org query with state (#4917)

* feat: org remove on admin api and org query with state

* docs: change description for admin api remove org

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Stefan Benz
2022-12-22 10:46:06 +00:00
committed by GitHub
parent a99da4f8e4
commit 7d9fc2c6e7
7 changed files with 130 additions and 0 deletions

View File

@@ -613,6 +613,41 @@ service AdminService {
};
}
// Sets the state of the organisation and all its resource (Users, Projects, Grants to and from the org) to removed
// Users of this organisation will not be able login
rpc RemoveOrg(RemoveOrgRequest) returns (RemoveOrgResponse) {
option (google.api.http) = {
delete: "/orgs/{org_id}"
};
option (zitadel.v1.auth_option) = {
permission: "iam.write";
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "orgs";
tags: "global";
responses: {
key: "200";
value: {
description: "org removed successfully";
};
};
responses: {
key: "400";
value: {
description: "invalid org";
schema: {
json_schema: {
ref: "#/definitions/rpcStatus";
};
};
};
};
};
}
// Returns a identity provider configuration of the IAM instance
rpc GetIDPByID(GetIDPByIDRequest) returns (GetIDPByIDResponse) {
option (google.api.http) = {
@@ -3018,6 +3053,28 @@ message SetUpOrgResponse {
string user_id = 3;
}
message RemoveOrgRequest {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
required: ["org_id"]
};
};
string org_id = 1 [
(validate.rules).string = {min_len: 1, max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"69629023906488334\"";
min_length: 1;
max_length: 200;
}
];
}
message RemoveOrgResponse {
zitadel.v1.ObjectDetails details = 1;
}
message GetIDPByIDRequest {
string id = 1 [
(validate.rules).string = {min_len: 1, max_len: 200},

View File

@@ -80,6 +80,7 @@ message OrgQuery {
OrgNameQuery name_query = 1;
OrgDomainQuery domain_query = 2;
OrgStateQuery state_query = 3;
}
}
@@ -113,6 +114,15 @@ message OrgDomainQuery {
];
}
message OrgStateQuery {
OrgState state = 1 [
(validate.rules).enum.defined_only = true,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "current state of the organisation";
}
];
}
enum OrgFieldName {
ORG_FIELD_NAME_UNSPECIFIED = 0;
ORG_FIELD_NAME_NAME = 1;