syntax = "proto3"; import "zitadel/object.proto"; import "validate/validate.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; package zitadel.project.v1; option go_package ="github.com/zitadel/zitadel/pkg/grpc/project"; message Project { string id = 1 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; zitadel.v1.ObjectDetails details = 2; string name = 3 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"MyProject\"" } ]; ProjectState state = 4 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "current state of the project"; } ]; // describes if the roles of the user should be added to the token bool project_role_assertion = 5; // ZITADEL checks if the user has at least one on this project bool project_role_check = 6; // ZITADEL checks if the org of the user has permission for this project bool has_project_check = 7; // Defines from where the private labeling should be triggered PrivateLabelingSetting private_labeling_setting = 8; } message GrantedProject { string grant_id = 1 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; string granted_org_id = 2 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; string granted_org_name = 3 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"Some Organization\"" } ]; repeated string granted_role_keys = 4 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "[\"role.super.man\"]" } ]; ProjectGrantState state = 5 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "current state of the project grant"; } ]; string project_id = 6 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; string project_name = 7 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"ZITADEL\"" } ]; string project_owner_id = 8 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; string project_owner_name = 9 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"ZITADEL\"" } ]; zitadel.v1.ObjectDetails details = 10; } enum ProjectState { PROJECT_STATE_UNSPECIFIED = 0; PROJECT_STATE_ACTIVE = 1; PROJECT_STATE_INACTIVE = 2; } enum PrivateLabelingSetting { PRIVATE_LABELING_SETTING_UNSPECIFIED = 0; PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = 1; PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = 2; } enum ProjectGrantState { PROJECT_GRANT_STATE_UNSPECIFIED = 0; PROJECT_GRANT_STATE_ACTIVE = 1; PROJECT_GRANT_STATE_INACTIVE = 2; } message ProjectQuery { oneof query { option (validate.required) = true; ProjectNameQuery name_query = 1; ProjectResourceOwnerQuery project_resource_owner_query = 2; } } message ProjectNameQuery { string name = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"ZITADEL\"" } ]; zitadel.v1.TextQueryMethod method = 2 [ (validate.rules).enum.defined_only = true, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "defines which text equality method is used" } ]; } message ProjectResourceOwnerQuery { string resource_owner = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; } message Role { string key = 1 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"role.super.man\"" } ]; zitadel.v1.ObjectDetails details = 2; string display_name = 3 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"Super man\"" } ]; string group = 4 [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"people\"" } ]; } message RoleQuery { oneof query { option (validate.required) = true; RoleKeyQuery key_query = 1; RoleDisplayNameQuery display_name_query = 2; } } message RoleKeyQuery { string key = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"role.super.man\"" } ]; zitadel.v1.TextQueryMethod method = 2 [ (validate.rules).enum.defined_only = true, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "defines which text equality method is used" } ]; } message RoleDisplayNameQuery { string display_name = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"SUPER\"" } ]; zitadel.v1.TextQueryMethod method = 2 [ (validate.rules).enum.defined_only = true, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "defines which text equality method is used" } ]; } message ProjectGrantQuery { oneof query { option (validate.required) = true; GrantProjectNameQuery project_name_query = 1; GrantRoleKeyQuery role_key_query = 2; } } message AllProjectGrantQuery { oneof query { option (validate.required) = true; GrantProjectNameQuery project_name_query = 1; GrantRoleKeyQuery role_key_query = 2; ProjectIDQuery project_id_query = 3; GrantedOrgIDQuery granted_org_id_query = 4; } } message GrantProjectNameQuery { string name = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"ZITADEL\"" } ]; zitadel.v1.TextQueryMethod method = 2 [ (validate.rules).enum.defined_only = true, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "defines which text equality method is used" } ]; } message GrantRoleKeyQuery { string role_key = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"role.super.man\"" } ]; zitadel.v1.TextQueryMethod method = 2 [ (validate.rules).enum.defined_only = true, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "defines which text equality method is used" } ]; } message ProjectIDQuery { string project_id = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; } message GrantedOrgIDQuery { string granted_org_id = 1 [ (validate.rules).string = {max_len: 200}, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"69629023906488334\"" } ]; }