Files
ZitPlane/auth/ui/v2/proto/zitadel/project/v2/query.proto
T

266 lines
11 KiB
Protocol Buffer

syntax = "proto3";
package zitadel.project.v2;
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "validate/validate.proto";
import "zitadel/filter/v2/filter.proto";
option go_package = "github.com/zitadel/zitadel/pkg/grpc/project/v2;project";
message ProjectGrant {
// The unique identifier of the organization which granted the project to the granted_organization_id.
string organization_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629012906488334\""}];
// The timestamp of the granted project creation.
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 last change to the granted project (e.g. creation, activation, deactivation).
google.protobuf.Timestamp change_date = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"2025-01-23T10:34:18.051Z\""}];
// The ID of the organization the project is granted to.
string granted_organization_id = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629023906488334\""}];
// The name of the organization the project is granted to.
string granted_organization_name = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"Some Organization\""}];
// The roles granted to the organization for self-management of the project.
repeated string granted_role_keys = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "[\"role.super.man\"]"}];
// The ID of the granted project.
string project_id = 7 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629023906488334\""}];
// The name of the granted project.
string project_name = 8 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"ZITADEL\""}];
// Describes the current state of the granted project.
ProjectGrantState state = 9;
}
enum ProjectGrantState {
PROJECT_GRANT_STATE_UNSPECIFIED = 0;
PROJECT_GRANT_STATE_ACTIVE = 1;
PROJECT_GRANT_STATE_INACTIVE = 2;
}
message Project {
// ProjectID is the unique identifier of the project.
string project_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629012906488334\""}];
// OrganizationID is the unique identifier of the organization the project belongs to.
string organization_id = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629012906488334\""}];
// CreationDate is the timestamp of the project creation.
google.protobuf.Timestamp creation_date = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"2024-12-18T07:50:47.492Z\""}];
// ChangeDate is the timestamp of the last change to the project (e.g. creation, activation, deactivation).
google.protobuf.Timestamp change_date = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"2025-01-23T10:34:18.051Z\""}];
// Name is the name of the project. This might be presented to users, e.g. in sign-in flows.
string name = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"ip_allow_list\""}];
// State describes the current state of the project.
ProjectState state = 6;
// ProjectRoleAssertion is a boolean flag that describes if the roles of the user should be added to the token.
bool project_role_assertion = 7;
// AuthorizationRequired is a boolean flag that can be enabled to check if a user has
// an authorization to use this project assigned when login into an application of this project.
bool authorization_required = 8;
// ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user,
// that is trying to log in, has access to this project (either owns the project or is granted).
bool project_access_required = 9;
// PrivateLabelingSetting defines from where the private labeling should be triggered.
PrivateLabelingSetting private_labeling_setting = 10;
// GrantedOrganizationID is the ID of the organization the project is granted to.
// In case the project is not granted, this field is unset.
optional string granted_organization_id = 12 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629023906488334\""}];
// GrantedOrganizationName is the name of the organization the project is granted to.
// In case the project is not granted, this field is unset.
optional string granted_organization_name = 13 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"Some Organization\""}];
// GrantedProjectState describes the current state of the granted project.
// In case the project is not granted, this field is set to GrantedProjectState.GRANTED_PROJECT_STATE_UNSPECIFIED.
GrantedProjectState granted_state = 14;
}
enum ProjectState {
PROJECT_STATE_UNSPECIFIED = 0;
PROJECT_STATE_ACTIVE = 1;
PROJECT_STATE_INACTIVE = 2;
}
enum GrantedProjectState {
GRANTED_PROJECT_STATE_UNSPECIFIED = 0;
GRANTED_PROJECT_STATE_ACTIVE = 1;
GRANTED_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 ProjectFieldName {
PROJECT_FIELD_NAME_UNSPECIFIED = 0;
PROJECT_FIELD_NAME_ID = 1;
PROJECT_FIELD_NAME_CREATION_DATE = 2;
PROJECT_FIELD_NAME_CHANGE_DATE = 3;
PROJECT_FIELD_NAME_NAME = 4;
}
enum ProjectGrantFieldName {
PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = 0;
PROJECT_GRANT_FIELD_NAME_PROJECT_ID = 1;
PROJECT_GRANT_FIELD_NAME_CREATION_DATE = 2;
PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = 3;
}
enum ProjectRoleFieldName {
PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = 0;
PROJECT_ROLE_FIELD_NAME_KEY = 1;
PROJECT_ROLE_FIELD_NAME_CREATION_DATE = 2;
PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = 3;
}
message ProjectSearchFilter {
oneof filter {
option (validate.required) = true;
// Filter for projects with a specific name.
ProjectNameFilter project_name_filter = 1;
// Filter for projects with a specific ID.
zitadel.filter.v2.InIDsFilter in_project_ids_filter = 2;
// Filter for projects that are owned by or granted to a specific organization.
// You can specify whether to search for owned, granted or both types of projects.
ProjectOrganizationIDFilter organization_id_filter = 3;
}
}
message ProjectNameFilter {
// Defines the name of the project to query for.
string project_name = 1 [
(validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
max_length: 200
example: "\"ip_allow_list\""
}
];
// Defines which text comparison method used for the name query.
zitadel.filter.v2.TextFilterMethod method = 2 [(validate.rules).enum.defined_only = true];
}
message ProjectOrganizationIDFilter {
// OrganizationID Is the ID of the organization to query for.
string organization_id = 1 [
(validate.rules).string = {max_len: 200},
(google.api.field_behavior) = REQUIRED,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629012906488334\""}
];
enum Type {
TYPE_UNSPECIFIED = 0;
// Filter for projects that are owned by the organization.
OWNED = 1;
// Filter for projects that are granted to the organization.
GRANTED = 2;
// Filter for projects that are either owned by or granted to the organization.
OWNED_OR_GRANTED = 3;
}
// Defines whether to filter for owned, granted or both types of projects.
// If not specified, defaults to OWNED_OR_GRANTED and will return both owned and granted projects.
Type type = 2 [
(validate.rules).enum = {defined_only: true}
];
}
message ProjectGrantSearchFilter {
oneof filter {
option (validate.required) = true;
// Filter for project grants with a specific project name.
ProjectNameFilter project_name_filter = 1;
// Filter for project grants where a specific role is granted.
ProjectRoleKeyFilter role_key_filter = 2;
// Filter for project grants of a specific project ID.
zitadel.filter.v2.InIDsFilter in_project_ids_filter = 3;
// Filter for project grants that were granted from a specific organization.
zitadel.filter.v2.IDFilter organization_id_filter = 4;
// Filter for project grants that were granted to a specific organization.
zitadel.filter.v2.IDFilter granted_organization_id_filter = 5;
}
}
message ProjectRole {
// ProjectID is the ID of the project the role belongs to.
string project_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"69629026806489455\""}];
// Key of the project role. The key identifies the role. It's the only relevant attribute for Zitadel and
// will be used for authorization checks and as claim in tokens and user info responses.
string key = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"role.super.man\""}];
// CreationDate is the timestamp of the project role creation.
google.protobuf.Timestamp creation_date = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"2024-12-18T07:50:47.492Z\""}];
// ChangeDate is the timestamp of the last change to the project role.
google.protobuf.Timestamp change_date = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"2025-01-23T10:34:18.051Z\""}];
// DisplayName is a human readable name for the role, which might be displayed to users.
string display_name = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"Super man\""}];
// Group allows grouping roles for display purposes. Zitadel will not handle it in any way.
// It can be used to group roles in a UI to allow easier management for administrators.
// This attribute is not to be confused with groups as a collection of users.
string group = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"people\""}];
}
message ProjectRoleSearchFilter {
oneof filter {
option (validate.required) = true;
// Filter for project roles with a specific key.
ProjectRoleKeyFilter role_key_filter = 1;
// Filter for project roles with a specific display name.
ProjectRoleDisplayNameFilter display_name_filter = 2;
}
}
message ProjectRoleKeyFilter {
// The key of the project role to query for.
string key = 1 [
(validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"role.super.man\""}
];
// Defines which text comparison method used for the key query.
zitadel.filter.v2.TextFilterMethod method = 2 [(validate.rules).enum.defined_only = true];
}
message ProjectRoleDisplayNameFilter {
// The display name of the project role to query for.
string display_name = 1 [
(validate.rules).string = {max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {example: "\"SUPER\""}
];
// Defines which text comparison method used for the name query.
zitadel.filter.v2.TextFilterMethod method = 2 [(validate.rules).enum.defined_only = true];
}