mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 05:59:41 +00:00
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api
This commit is contained in:
@@ -94,7 +94,7 @@ func DomainsToPb(domains []*query.Domain) []*org_pb.Domain {
|
|||||||
|
|
||||||
func DomainToPb(d *query.Domain) *org_pb.Domain {
|
func DomainToPb(d *query.Domain) *org_pb.Domain {
|
||||||
return &org_pb.Domain{
|
return &org_pb.Domain{
|
||||||
OrgId: d.OrgID,
|
OrganizationId: d.OrgID,
|
||||||
DomainName: d.Domain,
|
DomainName: d.Domain,
|
||||||
IsVerified: d.IsVerified,
|
IsVerified: d.IsVerified,
|
||||||
IsPrimary: d.IsPrimary,
|
IsPrimary: d.IsPrimary,
|
||||||
@@ -135,17 +135,6 @@ func ToViewDetailsPb(
|
|||||||
return details
|
return details
|
||||||
}
|
}
|
||||||
|
|
||||||
func DomainToChangeDetailsPb(objectDetail *domain.ObjectDetails) *object.Details {
|
|
||||||
details := &object.Details{
|
|
||||||
Sequence: objectDetail.Sequence,
|
|
||||||
ResourceOwner: objectDetail.ResourceOwner,
|
|
||||||
}
|
|
||||||
if !objectDetail.EventDate.IsZero() {
|
|
||||||
details.ChangeDate = timestamppb.New(objectDetail.EventDate)
|
|
||||||
}
|
|
||||||
return details
|
|
||||||
}
|
|
||||||
|
|
||||||
func DomainValidationTypeToDomain(validationType org_pb.DomainValidationType) domain.OrgDomainValidationType {
|
func DomainValidationTypeToDomain(validationType org_pb.DomainValidationType) domain.OrgDomainValidationType {
|
||||||
switch validationType {
|
switch validationType {
|
||||||
case org_pb.DomainValidationType_DOMAIN_VALIDATION_TYPE_HTTP:
|
case org_pb.DomainValidationType_DOMAIN_VALIDATION_TYPE_HTTP:
|
||||||
|
@@ -49,12 +49,8 @@ func OrganizationViewToPb(org *query.Org) *v2beta_org.Organization {
|
|||||||
State: OrgStateToPb(org.State),
|
State: OrgStateToPb(org.State),
|
||||||
Name: org.Name,
|
Name: org.Name,
|
||||||
PrimaryDomain: org.Domain,
|
PrimaryDomain: org.Domain,
|
||||||
Details: v2beta_object.ToViewDetailsPb(
|
CreationDate: timestamppb.New(org.CreationDate),
|
||||||
org.Sequence,
|
ChangedDate: timestamppb.New(org.ChangeDate),
|
||||||
org.CreationDate,
|
|
||||||
org.ChangeDate,
|
|
||||||
org.ResourceOwner,
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +90,7 @@ func createdOrganizationToPb(createdOrg *command.CreatedOrg) (_ *org.CreateOrgan
|
|||||||
func OrgViewsToPb(orgs []*query.Org) []*v2beta_org.Organization {
|
func OrgViewsToPb(orgs []*query.Org) []*v2beta_org.Organization {
|
||||||
o := make([]*v2beta_org.Organization, len(orgs))
|
o := make([]*v2beta_org.Organization, len(orgs))
|
||||||
for i, org := range orgs {
|
for i, org := range orgs {
|
||||||
o[i] = OrgViewToPb(org)
|
o[i] = OrganizationViewToPb(org)
|
||||||
}
|
}
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
@@ -110,21 +106,16 @@ func OrgQueriesToModel(queries []*v2beta_org.OrganizationSearchFilter) (_ []quer
|
|||||||
return q, nil
|
return q, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// *OrganizationSearchFilter_NameQuery
|
|
||||||
// *OrganizationSearchFilter_DomainQuery
|
|
||||||
// *OrganizationSearchFilter_StateQuery
|
|
||||||
// *OrganizationSearchFilter_IdQuery
|
|
||||||
|
|
||||||
func OrgQueryToModel(apiQuery *v2beta_org.OrganizationSearchFilter) (query.SearchQuery, error) {
|
func OrgQueryToModel(apiQuery *v2beta_org.OrganizationSearchFilter) (query.SearchQuery, error) {
|
||||||
switch q := apiQuery.Query.(type) {
|
switch q := apiQuery.Filter.(type) {
|
||||||
case *v2beta_org.OrganizationSearchFilter_DomainQuery:
|
case *v2beta_org.OrganizationSearchFilter_DomainFilter:
|
||||||
return query.NewOrgVerifiedDomainSearchQuery(v2beta_object.TextMethodToQuery(q.DomainQuery.Method), q.DomainQuery.Domain)
|
return query.NewOrgVerifiedDomainSearchQuery(v2beta_object.TextMethodToQuery(q.DomainFilter.Method), q.DomainFilter.Domain)
|
||||||
case *v2beta_org.OrganizationSearchFilter_NameQuery:
|
case *v2beta_org.OrganizationSearchFilter_NameFilter:
|
||||||
return query.NewOrgNameSearchQuery(v2beta_object.TextMethodToQuery(q.NameQuery.Method), q.NameQuery.Name)
|
return query.NewOrgNameSearchQuery(v2beta_object.TextMethodToQuery(q.NameFilter.Method), q.NameFilter.Name)
|
||||||
case *v2beta_org.OrganizationSearchFilter_StateQuery:
|
case *v2beta_org.OrganizationSearchFilter_StateFilter:
|
||||||
return query.NewOrgStateSearchQuery(OrgStateToDomain(q.StateQuery.State))
|
return query.NewOrgStateSearchQuery(OrgStateToDomain(q.StateFilter.State))
|
||||||
case *v2beta_org.OrganizationSearchFilter_IdQuery:
|
case *v2beta_org.OrganizationSearchFilter_IdFilter:
|
||||||
return query.NewOrgIDSearchQuery(q.IdQuery.Id)
|
return query.NewOrgIDSearchQuery(q.IdFilter.Id)
|
||||||
default:
|
default:
|
||||||
return nil, zerrors.ThrowInvalidArgument(nil, "ORG-vR9nC", "List.Query.Invalid")
|
return nil, zerrors.ThrowInvalidArgument(nil, "ORG-vR9nC", "List.Query.Invalid")
|
||||||
}
|
}
|
||||||
@@ -159,27 +150,23 @@ func FieldNameToOrgColumn(fieldName v2beta_org.OrgFieldName) query.Column {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func OrgViewToPb(org *query.Org) *v2beta_org.Organization {
|
// func OrgViewToPb(org *query.Org) *v2beta_org.Organization {
|
||||||
return &v2beta_org.Organization{
|
// return &v2beta_org.Organization{
|
||||||
Id: org.ID,
|
// Id: org.ID,
|
||||||
State: OrgStateToPb(org.State),
|
// State: OrgStateToPb(org.State),
|
||||||
Name: org.Name,
|
// Name: org.Name,
|
||||||
PrimaryDomain: org.Domain,
|
// PrimaryDomain: org.Domain,
|
||||||
Details: v2beta_object.ToViewDetailsPb(
|
// CreationDate: timestamppb.New(org.CreationDate),
|
||||||
org.Sequence,
|
// ChangedDate: timestamppb.New(org.ChangeDate),
|
||||||
org.CreationDate,
|
// }
|
||||||
org.ChangeDate,
|
// }
|
||||||
org.ResourceOwner,
|
|
||||||
),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func ListOrgDomainsRequestToModel(systemDefaults systemdefaults.SystemDefaults, request *org.ListOrganizationDomainsRequest) (*query.OrgDomainSearchQueries, error) {
|
func ListOrgDomainsRequestToModel(systemDefaults systemdefaults.SystemDefaults, request *org.ListOrganizationDomainsRequest) (*query.OrgDomainSearchQueries, error) {
|
||||||
offset, limit, asc, err := filter.PaginationPbToQuery(systemDefaults, request.Pagination)
|
offset, limit, asc, err := filter.PaginationPbToQuery(systemDefaults, request.Pagination)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
queries, err := DomainQueriesToModel(request.Filter)
|
queries, err := DomainQueriesToModel(request.Filters)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -201,7 +188,7 @@ func ListQueryToModel(query *v2beta.ListQuery) (offset, limit uint64, asc bool)
|
|||||||
return query.Offset, uint64(query.Limit), query.Asc
|
return query.Offset, uint64(query.Limit), query.Asc
|
||||||
}
|
}
|
||||||
|
|
||||||
func DomainQueriesToModel(queries []*v2beta_org.DomainSearchQuery) (_ []query.SearchQuery, err error) {
|
func DomainQueriesToModel(queries []*v2beta_org.DomainSearchFilter) (_ []query.SearchQuery, err error) {
|
||||||
q := make([]query.SearchQuery, len(queries))
|
q := make([]query.SearchQuery, len(queries))
|
||||||
for i, query := range queries {
|
for i, query := range queries {
|
||||||
q[i], err = DomainQueryToModel(query)
|
q[i], err = DomainQueryToModel(query)
|
||||||
@@ -212,11 +199,11 @@ func DomainQueriesToModel(queries []*v2beta_org.DomainSearchQuery) (_ []query.Se
|
|||||||
return q, nil
|
return q, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DomainQueryToModel(searchQuery *v2beta_org.DomainSearchQuery) (query.SearchQuery, error) {
|
func DomainQueryToModel(searchQuery *v2beta_org.DomainSearchFilter) (query.SearchQuery, error) {
|
||||||
switch q := searchQuery.Query.(type) {
|
switch q := searchQuery.Filter.(type) {
|
||||||
case *v2beta_org.DomainSearchQuery_DomainNameQuery:
|
case *v2beta_org.DomainSearchFilter_DomainNameFilter:
|
||||||
// return query.NewOrgDomainDomainSearchQuery(object.TextMethodToQuery(q.DomainNameQuery.Method), q.DomainNameQuery.Name)
|
// return query.NewOrgDomainDomainSearchQuery(object.TextMethodToQuery(q.DomainNameQuery.Method), q.DomainNameQuery.Name)
|
||||||
return query.NewOrgDomainDomainSearchQuery(v2beta_object.TextMethodToQuery(q.DomainNameQuery.Method), q.DomainNameQuery.Name)
|
return query.NewOrgDomainDomainSearchQuery(v2beta_object.TextMethodToQuery(q.DomainNameFilter.Method), q.DomainNameFilter.Name)
|
||||||
default:
|
default:
|
||||||
return nil, zerrors.ThrowInvalidArgument(nil, "ORG-Ags89", "List.Query.Invalid")
|
return nil, zerrors.ThrowInvalidArgument(nil, "ORG-Ags89", "List.Query.Invalid")
|
||||||
}
|
}
|
||||||
@@ -225,7 +212,7 @@ func DomainQueryToModel(searchQuery *v2beta_org.DomainSearchQuery) (query.Search
|
|||||||
func RemoveOrgDomainRequestToDomain(ctx context.Context, req *v2beta_org.DeleteOrganizationDomainRequest) *domain.OrgDomain {
|
func RemoveOrgDomainRequestToDomain(ctx context.Context, req *v2beta_org.DeleteOrganizationDomainRequest) *domain.OrgDomain {
|
||||||
return &domain.OrgDomain{
|
return &domain.OrgDomain{
|
||||||
ObjectRoot: models.ObjectRoot{
|
ObjectRoot: models.ObjectRoot{
|
||||||
AggregateID: req.Id,
|
AggregateID: req.OrganizationId,
|
||||||
},
|
},
|
||||||
Domain: req.Domain,
|
Domain: req.Domain,
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@ func (s *Server) ListOrganizationMetadata(ctx context.Context, request *v2beta_o
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &v2beta_org.ListOrganizationMetadataResponse{
|
return &v2beta_org.ListOrganizationMetadataResponse{
|
||||||
Result: metadata.OrgMetadataListToPb(res.Metadata),
|
Metadata: metadata.OrgMetadataListToPb(res.Metadata),
|
||||||
Pagination: &filter.PaginationResponse{
|
Pagination: &filter.PaginationResponse{
|
||||||
TotalResult: res.Count,
|
TotalResult: res.Count,
|
||||||
AppliedLimit: uint64(request.GetPagination().GetLimit()),
|
AppliedLimit: uint64(request.GetPagination().GetLimit()),
|
||||||
@@ -131,11 +131,11 @@ func (s *Server) ActivateOrganization(ctx context.Context, request *org.Activate
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) AddOrganizationDomain(ctx context.Context, request *org.AddOrganizationDomainRequest) (*org.AddOrganizationDomainResponse, error) {
|
func (s *Server) AddOrganizationDomain(ctx context.Context, request *org.AddOrganizationDomainRequest) (*org.AddOrganizationDomainResponse, error) {
|
||||||
userIDs, err := s.getClaimedUserIDsOfOrgDomain(ctx, request.Domain, request.Id)
|
userIDs, err := s.getClaimedUserIDsOfOrgDomain(ctx, request.Domain, request.OrganizationId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
details, err := s.command.AddOrgDomain(ctx, request.Id, request.Domain, userIDs)
|
details, err := s.command.AddOrgDomain(ctx, request.OrganizationId, request.Domain, userIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ func (s *Server) ListOrganizationDomains(ctx context.Context, req *org.ListOrgan
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
orgIDQuery, err := query.NewOrgDomainOrgIDSearchQuery(req.Id)
|
orgIDQuery, err := query.NewOrgDomainOrgIDSearchQuery(req.OrganizationId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ func (s *Server) ListOrganizationDomains(ctx context.Context, req *org.ListOrgan
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &org.ListOrganizationDomainsResponse{
|
return &org.ListOrganizationDomainsResponse{
|
||||||
Result: object.DomainsToPb(domains.Domains),
|
Domains: object.DomainsToPb(domains.Domains),
|
||||||
Pagination: &filter.PaginationResponse{
|
Pagination: &filter.PaginationResponse{
|
||||||
TotalResult: domains.Count,
|
TotalResult: domains.Count,
|
||||||
AppliedLimit: uint64(req.GetPagination().GetLimit()),
|
AppliedLimit: uint64(req.GetPagination().GetLimit()),
|
||||||
@@ -243,7 +243,7 @@ func createOrganizationRequestAdminToCommand(admin *v2beta_org.CreateOrganizatio
|
|||||||
Roles: admin.GetRoles(),
|
Roles: admin.GetRoles(),
|
||||||
}, nil
|
}, nil
|
||||||
default:
|
default:
|
||||||
return nil, zerrors.ThrowUnimplementedf(nil, "ORGv2-SD2r1", "userType oneOf %T in method AddOrganization not implemented", a)
|
return nil, zerrors.ThrowUnimplementedf(nil, "ORGv2-SL2r8", "userType oneOf %T in method AddOrganization not implemented", a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ option go_package = "github.com/zitadel/zitadel/pkg/grpc/org/v2beta;org";
|
|||||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||||
import "validate/validate.proto";
|
import "validate/validate.proto";
|
||||||
import "zitadel/object/v2beta/object.proto";
|
import "zitadel/object/v2beta/object.proto";
|
||||||
|
import "google/protobuf/timestamp.proto";
|
||||||
|
|
||||||
message Organization {
|
message Organization {
|
||||||
// Unique identifier of the organization.
|
// Unique identifier of the organization.
|
||||||
@@ -15,17 +16,32 @@ message Organization {
|
|||||||
example: "\"69629023906488334\""
|
example: "\"69629023906488334\""
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
zitadel.object.v2beta.Details details = 2;
|
|
||||||
|
// The timestamp of the organization was created.
|
||||||
|
google.protobuf.Timestamp creation_date = 2 [
|
||||||
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// The timestamp of the verification of the organization domain.
|
||||||
|
google.protobuf.Timestamp changed_date = 3 [
|
||||||
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
// Current state of the organization, for example active, inactive and deleted.
|
// Current state of the organization, for example active, inactive and deleted.
|
||||||
OrgState state = 3;
|
OrgState state = 4;
|
||||||
|
|
||||||
// Name of the organization.
|
// Name of the organization.
|
||||||
string name = 4 [
|
string name = 5 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"ZITADEL\"";
|
example: "\"ZITADEL\"";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
// Primary domain used in the organization.
|
// Primary domain used in the organization.
|
||||||
string primary_domain = 5 [
|
string primary_domain = 6 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"zitadel.cloud\"";
|
example: "\"zitadel.cloud\"";
|
||||||
}
|
}
|
||||||
@@ -46,13 +62,13 @@ enum OrgFieldName {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message OrganizationSearchFilter{
|
message OrganizationSearchFilter{
|
||||||
oneof query {
|
oneof filter {
|
||||||
option (validate.required) = true;
|
option (validate.required) = true;
|
||||||
|
|
||||||
OrgNameQuery name_query = 1;
|
OrgNameQuery name_filter = 1;
|
||||||
OrgDomainQuery domain_query = 2;
|
OrgDomainQuery domain_filter = 2;
|
||||||
OrgStateQuery state_query = 3;
|
OrgStateQuery state_filter = 3;
|
||||||
OrgIDQuery id_query = 4;
|
OrgIDQuery id_filter = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
message OrgNameQuery {
|
message OrgNameQuery {
|
||||||
@@ -101,10 +117,10 @@ message OrgIDQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// from proto/zitadel/org.proto
|
// from proto/zitadel/org.proto
|
||||||
message DomainSearchQuery {
|
message DomainSearchFilter {
|
||||||
oneof query {
|
oneof filter {
|
||||||
option (validate.required) = true;
|
option (validate.required) = true;
|
||||||
DomainNameQuery domain_name_query = 1;
|
DomainNameQuery domain_name_filter = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +142,7 @@ message DomainNameQuery {
|
|||||||
// from proto/zitadel/org.proto
|
// from proto/zitadel/org.proto
|
||||||
message Domain {
|
message Domain {
|
||||||
// The Organization id.
|
// The Organization id.
|
||||||
string org_id = 1 [
|
string organization_id = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"69629023906488334\""
|
example: "\"69629023906488334\""
|
||||||
}
|
}
|
||||||
|
@@ -114,7 +114,7 @@ service OrganizationService {
|
|||||||
// Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER.
|
// Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.create`
|
// - `org.create`
|
||||||
rpc CreateOrganization(CreateOrganizationRequest) returns (CreateOrganizationResponse) {
|
rpc CreateOrganization(CreateOrganizationRequest) returns (CreateOrganizationResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations"
|
post: "/v2beta/organizations"
|
||||||
@@ -133,10 +133,10 @@ service OrganizationService {
|
|||||||
// Change the name of the organization.
|
// Change the name of the organization.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc UpdateOrganization(UpdateOrganizationRequest) returns (UpdateOrganizationResponse) {
|
rpc UpdateOrganization(UpdateOrganizationRequest) returns (UpdateOrganizationResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
put: "/v2beta/organizations"
|
put: "/v2beta/organizations/{id}"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -152,10 +152,10 @@ service OrganizationService {
|
|||||||
// Returns a list of organizations that match the requesting filters. All filters are applied with an AND condition.
|
// Returns a list of organizations that match the requesting filters. All filters are applied with an AND condition.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `iam.read`
|
// - `iam.read`
|
||||||
rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) {
|
rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/_search";
|
post: "/v2beta/organizations/search";
|
||||||
body: "*";
|
body: "*";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,15 +165,15 @@ service OrganizationService {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// responses: {
|
// responses: {
|
||||||
// key: "400";
|
// key: "400";
|
||||||
// value: {
|
// value: {
|
||||||
// description: "invalid list query";
|
// description: "invalid list query";
|
||||||
// schema: {
|
// schema: {
|
||||||
// json_schema: {
|
// json_schema: {
|
||||||
// ref: "#/definitions/rpcStatus";
|
// ref: "#/definitions/rpcStatus";
|
||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,28 +182,28 @@ service OrganizationService {
|
|||||||
// Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in.
|
// Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.delete`
|
||||||
rpc DeleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse) {
|
rpc DeleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
delete: "/v2beta/organizations"
|
delete: "/v2beta/organizations/{id}"
|
||||||
};
|
};
|
||||||
|
|
||||||
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
||||||
auth_option: {
|
auth_option: {
|
||||||
permission: "org.write";
|
permission: "org.delete";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// responses: {
|
// responses: {
|
||||||
// key: "400";
|
// key: "400";
|
||||||
// value: {
|
// value: {
|
||||||
// description: "invalid org";
|
// description: "invalid org";
|
||||||
// schema: {
|
// schema: {
|
||||||
// json_schema: {
|
// json_schema: {
|
||||||
// ref: "#/definitions/rpcStatus";
|
// ref: "#/definitions/rpcStatus";
|
||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,10 +212,10 @@ service OrganizationService {
|
|||||||
// Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded.
|
// Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc SetOrganizationMetadata(SetOrganizationMetadataRequest) returns (SetOrganizationMetadataResponse) {
|
rpc SetOrganizationMetadata(SetOrganizationMetadataRequest) returns (SetOrganizationMetadataResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/metadata"
|
post: "/v2beta/organizations/{organization_id}/metadata"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -231,10 +231,10 @@ service OrganizationService {
|
|||||||
// List metadata of an organization filtered by query.
|
// List metadata of an organization filtered by query.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.read`
|
// - `org.read`
|
||||||
rpc ListOrganizationMetadata(ListOrganizationMetadataRequest) returns (ListOrganizationMetadataResponse ) {
|
rpc ListOrganizationMetadata(ListOrganizationMetadataRequest) returns (ListOrganizationMetadataResponse ) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/metadata/_search"
|
post: "/v2beta/organizations/{organization_id}/metadata/search"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -250,10 +250,10 @@ service OrganizationService {
|
|||||||
// Delete metadata objects from an organization with a specific key.
|
// Delete metadata objects from an organization with a specific key.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc DeleteOrganizationMetadata(DeleteOrganizationMetadataRequest) returns (DeleteOrganizationMetadataResponse) {
|
rpc DeleteOrganizationMetadata(DeleteOrganizationMetadataRequest) returns (DeleteOrganizationMetadataResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
delete: "/v2beta/organizations/metadata"
|
delete: "/v2beta/organizations/{organization_id}/metadata"
|
||||||
};
|
};
|
||||||
|
|
||||||
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
||||||
@@ -269,10 +269,10 @@ service OrganizationService {
|
|||||||
// Add a new domain to an organization. The domains are used to identify to which organization a user belongs.
|
// Add a new domain to an organization. The domains are used to identify to which organization a user belongs.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc AddOrganizationDomain(AddOrganizationDomainRequest) returns (AddOrganizationDomainResponse) {
|
rpc AddOrganizationDomain(AddOrganizationDomainRequest) returns (AddOrganizationDomainResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/domains"
|
post: "/v2beta/organizations/{organization_id}/domains"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -289,10 +289,10 @@ service OrganizationService {
|
|||||||
// Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs.
|
// Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.read`
|
// - `org.read`
|
||||||
rpc ListOrganizationDomains(ListOrganizationDomainsRequest) returns (ListOrganizationDomainsResponse) {
|
rpc ListOrganizationDomains(ListOrganizationDomainsRequest) returns (ListOrganizationDomainsResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/domains/_search"
|
post: "/v2beta/organizations/{organization_id}/domains/search"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -309,10 +309,10 @@ service OrganizationService {
|
|||||||
// Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead.
|
// Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc DeleteOrganizationDomain(DeleteOrganizationDomainRequest) returns (DeleteOrganizationDomainResponse) {
|
rpc DeleteOrganizationDomain(DeleteOrganizationDomainRequest) returns (DeleteOrganizationDomainResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
delete: "/v2beta/organizations/domains"
|
delete: "/v2beta/organizations/{organization_id}/domains"
|
||||||
};
|
};
|
||||||
|
|
||||||
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
||||||
@@ -328,10 +328,10 @@ service OrganizationService {
|
|||||||
// Generate a new file to be able to verify your domain with DNS or HTTP challenge.
|
// Generate a new file to be able to verify your domain with DNS or HTTP challenge.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc GenerateOrganizationDomainValidation(GenerateOrganizationDomainValidationRequest) returns (GenerateOrganizationDomainValidationResponse) {
|
rpc GenerateOrganizationDomainValidation(GenerateOrganizationDomainValidationRequest) returns (GenerateOrganizationDomainValidationResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/domains/validation/_generate"
|
post: "/v2beta/organizations/{organization_id}/domains/validation/generate"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -348,10 +348,10 @@ service OrganizationService {
|
|||||||
// Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique.
|
// Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc VerifyOrganizationDomain(VerifyOrganizationDomainRequest) returns (VerifyOrganizationDomainResponse) {
|
rpc VerifyOrganizationDomain(VerifyOrganizationDomainRequest) returns (VerifyOrganizationDomainResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/domains/validation/_verify"
|
post: "/v2beta/organizations/{organization_id}/domains/validation/verify"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -368,10 +368,10 @@ service OrganizationService {
|
|||||||
// Sets the state of my organization to deactivated. Users of this organization will not be able to log in.
|
// Sets the state of my organization to deactivated. Users of this organization will not be able to log in.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc DeactivateOrganization(DeactivateOrganizationRequest) returns (DeactivateOrganizationResponse) {
|
rpc DeactivateOrganization(DeactivateOrganizationRequest) returns (DeactivateOrganizationResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/deactivate"
|
post: "/v2beta/organizations/{id}/deactivate"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -388,10 +388,10 @@ service OrganizationService {
|
|||||||
// Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again.
|
// Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again.
|
||||||
//
|
//
|
||||||
// Required permission:
|
// Required permission:
|
||||||
// - `org.write`
|
// - `org.write`
|
||||||
rpc ActivateOrganization(ActivateOrganizationRequest) returns (ActivateOrganizationResponse) {
|
rpc ActivateOrganization(ActivateOrganizationRequest) returns (ActivateOrganizationResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/v2beta/organizations/_activate"
|
post: "/v2beta/organizations/{id}/activate"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -484,7 +484,7 @@ message UpdateOrganizationRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message UpdateOrganizationResponse {
|
message UpdateOrganizationResponse {
|
||||||
// The timestamp of the update to the organization.
|
// The timestamp of the update to the organization.
|
||||||
google.protobuf.Timestamp change_date = 1 [
|
google.protobuf.Timestamp change_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
@@ -498,8 +498,8 @@ message ListOrganizationsRequest {
|
|||||||
// the field the result is sorted
|
// the field the result is sorted
|
||||||
zitadel.org.v2beta.OrgFieldName sorting_column = 2;
|
zitadel.org.v2beta.OrgFieldName sorting_column = 2;
|
||||||
// Define the criteria to query for.
|
// Define the criteria to query for.
|
||||||
// repeated ProjectRoleFilter filters = 4;
|
// repeated ProjectRoleQuery filters = 4;
|
||||||
repeated zitadel.org.v2beta.OrganizationSearchFilter filter = 3;
|
repeated zitadel.org.v2beta.OrganizationSearchFilter filter= 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListOrganizationsResponse {
|
message ListOrganizationsResponse {
|
||||||
@@ -528,7 +528,7 @@ message DeleteOrganizationRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DeleteOrganizationResponse {
|
message DeleteOrganizationResponse {
|
||||||
// The timestamp of the deletion of the organization.
|
// The timestamp of the deletion of the organization.
|
||||||
google.protobuf.Timestamp deletion_date = 1 [
|
google.protobuf.Timestamp deletion_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
@@ -549,7 +549,7 @@ message DeactivateOrganizationRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DeactivateOrganizationResponse {
|
message DeactivateOrganizationResponse {
|
||||||
// The timestamp of the deactivation of the organization.
|
// The timestamp of the deactivation of the organization.
|
||||||
google.protobuf.Timestamp change_date = 1 [
|
google.protobuf.Timestamp change_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
@@ -570,7 +570,7 @@ message ActivateOrganizationRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ActivateOrganizationResponse {
|
message ActivateOrganizationResponse {
|
||||||
// The timestamp of the activation of the organization.
|
// The timestamp of the activation of the organization.
|
||||||
google.protobuf.Timestamp change_date = 1 [
|
google.protobuf.Timestamp change_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
@@ -580,7 +580,7 @@ message ActivateOrganizationResponse {
|
|||||||
|
|
||||||
message AddOrganizationDomainRequest {
|
message AddOrganizationDomainRequest {
|
||||||
// Organization Id for the Organization for which the domain is to be added to.
|
// Organization Id for the Organization for which the domain is to be added to.
|
||||||
string id = 1 [
|
string organization_id = 1 [
|
||||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||||
(google.api.field_behavior) = REQUIRED,
|
(google.api.field_behavior) = REQUIRED,
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
@@ -613,7 +613,7 @@ message AddOrganizationDomainResponse {
|
|||||||
|
|
||||||
message ListOrganizationDomainsRequest {
|
message ListOrganizationDomainsRequest {
|
||||||
// Organization Id for the Organization which domains are to be listed.
|
// Organization Id for the Organization which domains are to be listed.
|
||||||
string id = 1 [
|
string organization_id = 1 [
|
||||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||||
(google.api.field_behavior) = REQUIRED,
|
(google.api.field_behavior) = REQUIRED,
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
@@ -627,18 +627,19 @@ message ListOrganizationDomainsRequest {
|
|||||||
// List limitations and ordering.
|
// List limitations and ordering.
|
||||||
optional zitadel.filter.v2beta.PaginationRequest pagination = 2;
|
optional zitadel.filter.v2beta.PaginationRequest pagination = 2;
|
||||||
// Define the criteria to query for.
|
// Define the criteria to query for.
|
||||||
repeated DomainSearchQuery filter = 3;
|
repeated DomainSearchFilter filters = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListOrganizationDomainsResponse {
|
message ListOrganizationDomainsResponse {
|
||||||
// Pagination of the Organizations domain results.
|
// Pagination of the Organizations domain results.
|
||||||
zitadel.filter.v2beta.PaginationResponse pagination = 1;
|
zitadel.filter.v2beta.PaginationResponse pagination = 1;
|
||||||
repeated Domain result = 2;
|
// The domains requested.
|
||||||
|
repeated Domain domains = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeleteOrganizationDomainRequest {
|
message DeleteOrganizationDomainRequest {
|
||||||
// Organization Id for the Organization which domain is to be deleted.
|
// Organization Id for the Organization which domain is to be deleted.
|
||||||
string id = 1 [
|
string organization_id = 1 [
|
||||||
(validate.rules).string = {min_len: 1, max_len: 200},
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
||||||
(google.api.field_behavior) = REQUIRED,
|
(google.api.field_behavior) = REQUIRED,
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
@@ -660,7 +661,7 @@ message DeleteOrganizationDomainRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DeleteOrganizationDomainResponse {
|
message DeleteOrganizationDomainResponse {
|
||||||
// The timestamp of the deletion of the organization domain.
|
// The timestamp of the deletion of the organization domain.
|
||||||
google.protobuf.Timestamp deletion_date = 1 [
|
google.protobuf.Timestamp deletion_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
@@ -732,7 +733,7 @@ message VerifyOrganizationDomainRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message VerifyOrganizationDomainResponse {
|
message VerifyOrganizationDomainResponse {
|
||||||
// The timestamp of the verification of the organization domain.
|
// The timestamp of the verification of the organization domain.
|
||||||
google.protobuf.Timestamp change_date = 1 [
|
google.protobuf.Timestamp change_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
@@ -758,7 +759,7 @@ message SetOrganizationMetadataRequest{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message SetOrganizationMetadataResponse{
|
message SetOrganizationMetadataResponse{
|
||||||
// The timestamp of the update of the organization metadata.
|
// The timestamp of the update of the organization metadata.
|
||||||
google.protobuf.Timestamp set_date = 1 [
|
google.protobuf.Timestamp set_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
@@ -787,19 +788,19 @@ message ListOrganizationMetadataRequest {
|
|||||||
message ListOrganizationMetadataResponse {
|
message ListOrganizationMetadataResponse {
|
||||||
// Pagination of the Organizations metadata results.
|
// Pagination of the Organizations metadata results.
|
||||||
zitadel.filter.v2beta.PaginationResponse pagination = 1;
|
zitadel.filter.v2beta.PaginationResponse pagination = 1;
|
||||||
// THe Organization metadata requested.
|
// The Organization metadata requested.
|
||||||
repeated zitadel.metadata.v2beta.Metadata result = 2;
|
repeated zitadel.metadata.v2beta.Metadata metadata = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeleteOrganizationMetadataRequest {
|
message DeleteOrganizationMetadataRequest {
|
||||||
// Organization ID of Orgalization which metadata is to be deleted is stored on.
|
// Organization ID of Orgalization which metadata is to be deleted is stored on.
|
||||||
string organization_id = 1;
|
string organization_id = 1;
|
||||||
// The key for the Organization metadata to be deleted.
|
// The keys for the Organization metadata to be deleted.
|
||||||
repeated string keys = 2 [(validate.rules).repeated.items.string = {min_len: 1, max_len: 200}];
|
repeated string keys = 2 [(validate.rules).repeated.items.string = {min_len: 1, max_len: 200}];
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeleteOrganizationMetadataResponse{
|
message DeleteOrganizationMetadataResponse{
|
||||||
// The timestamp of the deletiion of the organization metadata.
|
// The timestamp of the deletiion of the organization metadata.
|
||||||
google.protobuf.Timestamp deletion_date = 1 [
|
google.protobuf.Timestamp deletion_date = 1 [
|
||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||||
example: "\"2025-01-23T10:34:18.051Z\"";
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
||||||
|
Reference in New Issue
Block a user