Files
ZitPlane/auth/ui/v2/proto/zitadel/settings/v2/settings_service.proto
T

746 lines
24 KiB
Protocol Buffer

syntax = "proto3";
package zitadel.settings.v2;
import "zitadel/protoc_gen_zitadel/v2/options.proto";
import "zitadel/object/v2/object.proto";
import "zitadel/settings/v2/branding_settings.proto";
import "zitadel/settings/v2/domain_settings.proto";
import "zitadel/settings/v2/legal_settings.proto";
import "zitadel/settings/v2/lockout_settings.proto";
import "zitadel/settings/v2/login_settings.proto";
import "zitadel/settings/v2/password_settings.proto";
import "zitadel/settings/v2/security_settings.proto";
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "validate/validate.proto";
import "google/protobuf/struct.proto";
import "zitadel/settings/v2/settings.proto";
import "google/protobuf/timestamp.proto";
import "zitadel/filter/v2/filter.proto";
option go_package = "github.com/zitadel/zitadel/pkg/grpc/settings/v2;settings";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Settings Service";
version: "2.0";
description: "This API is intended to manage settings in a Zitadel instance.";
contact:{
name: "ZITADEL"
url: "https://zitadel.com"
email: "hi@zitadel.com"
}
license: {
name: "Apache 2.0",
url: "https://github.com/zitadel/zitadel/blob/main/LICENSING.md";
};
};
schemes: HTTPS;
schemes: HTTP;
consumes: "application/json";
consumes: "application/grpc";
produces: "application/json";
produces: "application/grpc";
consumes: "application/grpc-web+proto";
produces: "application/grpc-web+proto";
host: "$CUSTOM_DOMAIN";
base_path: "/";
external_docs: {
description: "Detailed information about ZITADEL",
url: "https://zitadel.com/docs"
}
security_definitions: {
security: {
key: "OAuth2";
value: {
type: TYPE_OAUTH2;
flow: FLOW_ACCESS_CODE;
authorization_url: "$CUSTOM_DOMAIN/oauth/v2/authorize";
token_url: "$CUSTOM_DOMAIN/oauth/v2/token";
scopes: {
scope: {
key: "openid";
value: "openid";
}
scope: {
key: "urn:zitadel:iam:org:project:id:zitadel:aud";
value: "urn:zitadel:iam:org:project:id:zitadel:aud";
}
}
}
}
}
security: {
security_requirement: {
key: "OAuth2";
value: {
scope: "openid";
scope: "urn:zitadel:iam:org:project:id:zitadel:aud";
}
}
}
responses: {
key: "403";
value: {
description: "Returned when the user does not have permission to access the resource.";
schema: {
json_schema: {
ref: "#/definitions/rpcStatus";
}
}
}
}
responses: {
key: "404";
value: {
description: "Returned when the resource does not exist.";
schema: {
json_schema: {
ref: "#/definitions/rpcStatus";
}
}
}
}
};
service SettingsService {
// Get General Settings
//
// Get basic information of the instance like the default organization, default language and supported languages.
//
// Required permissions:
// - `policy.read`
rpc GetGeneralSettings (GetGeneralSettingsRequest) returns (GetGeneralSettingsResponse) {
option (google.api.http) = {
get: "/v2/settings"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Login Settings
//
// Get the login settings for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned settings will fall back to the instance settings if not explicitly set on the organization.
//
// Required permissions:
// - `policy.read`
rpc GetLoginSettings (GetLoginSettingsRequest) returns (GetLoginSettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/login"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Active Identity Providers
//
// Get the current active identity providers for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned identity providers will fall back to the active instance identity providers
// if not explicitly set on the organization.
//
// Optionally, filter the identity providers by their allowed actions:
// - creation_allowed: only return identity providers that are allowed for user creation
// - linking_allowed: only return identity providers that are allowed for linking to existing users
// - auto_creation: only return identity providers that are allowed for automatic user creation
// - auto_linking: only return identity providers that are allowed for automatic linking to existing users
//
// Required permissions:
// - `policy.read`
rpc GetActiveIdentityProviders (GetActiveIdentityProvidersRequest) returns (GetActiveIdentityProvidersResponse) {
option (google.api.http) = {
get: "/v2/settings/login/idps"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Password Complexity Settings
//
// Get the password complexity settings for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned settings will fall back to the instance settings if not explicitly set on the organization.
//
// Required permissions:
// - `policy.read`
rpc GetPasswordComplexitySettings (GetPasswordComplexitySettingsRequest) returns (GetPasswordComplexitySettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/password/complexity"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Password Expiry Settings
//
// Get the password expiry settings for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned settings will fall back to the instance settings if not explicitly set on the organization.
//
// Required permissions:
// - `policy.read`
rpc GetPasswordExpirySettings (GetPasswordExpirySettingsRequest) returns (GetPasswordExpirySettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/password/expiry"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Branding Settings
//
// Get the current active branding settings for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned settings will fall back to the instance settings if not explicitly set on the organization.
//
// Required permissions:
// - `policy.read`
rpc GetBrandingSettings (GetBrandingSettingsRequest) returns (GetBrandingSettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/branding"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Domain Settings
//
// Get the domain settings for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned settings will fall back to the instance settings if not explicitly set on the organization.
//
// Required permissions:
// - `policy.read`
rpc GetDomainSettings (GetDomainSettingsRequest) returns (GetDomainSettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/domain"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Legal and Support Settings
//
// Get the legal and support settings for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned settings will fall back to the instance settings if not explicitly set on the organization.
//
// Required permissions:
// - `policy.read`
rpc GetLegalAndSupportSettings (GetLegalAndSupportSettingsRequest) returns (GetLegalAndSupportSettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/legal_support"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Lockout Settings
//
// Get the lockout settings for the requested context.
// This can be the instance or an organization. In case of an organization,
// the returned settings will fall back to the instance settings if not explicitly set on the organization.
//
// Lockout settings define how many failed attempts are allowed before a user is locked out.
//
// Required permissions:
// - `policy.read`
rpc GetLockoutSettings (GetLockoutSettingsRequest) returns (GetLockoutSettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/lockout"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "policy.read"
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200"
value: {
description: "OK";
}
};
};
}
// Get Security Settings
//
// Get the security settings of the Zitadel instance.
// Security settings include settings like enabling impersonation and embedded iframe settings.
//
// Required permissions:
// - `iam.policy.read`
rpc GetSecuritySettings(GetSecuritySettingsRequest) returns (GetSecuritySettingsResponse) {
option (google.api.http) = {
get: "/v2/settings/security";
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "iam.policy.read"
}
};
}
// Set Security Settings
//
// Set the security settings of the instance.
//
// Required permissions:
// - `iam.policy.write`
rpc SetSecuritySettings(SetSecuritySettingsRequest) returns (SetSecuritySettingsResponse) {
option (google.api.http) = {
put: "/v2/settings/security";
body: "*";
additional_bindings {
put: "/v2/policies/security";
body: "*";
}
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "iam.policy.write"
}
};
}
// Get Hosted Login Translation
//
// Returns the translations in the requested locale for the hosted login.
// The translations returned are based on the input level specified (system, instance or organization).
//
// If the requested level doesn't contain all translations, and ignore_inheritance is set to false,
// a merging process fallbacks onto the higher levels ensuring all keys in the file have a translation,
// which could be in the default language if the one of the locale is missing on all levels.
//
// The etag returned in the response represents the hash of the translations as they are stored on DB
// and its reliable only if ignore_inheritance = true.
//
// Required permissions:
// - `iam.policy.read`
rpc GetHostedLoginTranslation(GetHostedLoginTranslationRequest) returns (GetHostedLoginTranslationResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200";
value: {
description: "The localized translations.";
}
};
};
option (google.api.http) = {
get: "/v2/settings/hosted_login_translation"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "iam.policy.read"
}
};
}
// Set Hosted Login Translation
//
// Sets the input translations at the specified level (instance or organization) for the input language.
//
// Required permissions:
// - `iam.policy.write`
rpc SetHostedLoginTranslation(SetHostedLoginTranslationRequest) returns (SetHostedLoginTranslationResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
responses: {
key: "200";
value: {
description: "The translations was successfully set.";
}
};
};
option (google.api.http) = {
put: "/v2/settings/hosted_login_translation";
body: "*"
};
option (zitadel.protoc_gen_zitadel.v2.options) = {
auth_option: {
permission: "iam.policy.write"
}
};
}
}
message GetLoginSettingsRequest {
// Specify the context for which the login settings should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned settings will fall back to the instance settings
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
}
message GetLoginSettingsResponse {
zitadel.object.v2.Details details = 1;
zitadel.settings.v2.LoginSettings settings = 2;
}
message GetPasswordComplexitySettingsRequest {
// Specify the context for which the password complexity settings should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned settings will fall back to the instance settings
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
}
message GetPasswordComplexitySettingsResponse {
zitadel.object.v2.Details details = 1;
zitadel.settings.v2.PasswordComplexitySettings settings = 2;
}
message GetPasswordExpirySettingsRequest {
// Specify the context for which the password expiry settings should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned settings will fall back to the instance settings
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
}
message GetPasswordExpirySettingsResponse {
zitadel.object.v2.Details details = 1;
zitadel.settings.v2.PasswordExpirySettings settings = 2;
}
message GetBrandingSettingsRequest {
// Specify the context for which the branding settings should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned settings will fall back to the instance settings
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
}
message GetBrandingSettingsResponse {
zitadel.object.v2.Details details = 1;
zitadel.settings.v2.BrandingSettings settings = 2;
}
message GetDomainSettingsRequest {
// Specify the context for which the domain settings should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned settings will fall back to the instance settings
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
}
message GetDomainSettingsResponse {
zitadel.object.v2.Details details = 1;
zitadel.settings.v2.DomainSettings settings = 2;
}
message GetLegalAndSupportSettingsRequest {
// Specify the context for which the legal and support settings should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned settings will fall back to the instance settings
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
}
message GetLegalAndSupportSettingsResponse {
zitadel.object.v2.Details details = 1;
zitadel.settings.v2.LegalAndSupportSettings settings = 2;
}
message GetLockoutSettingsRequest {
// Specify the context for which the lockout settings should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned settings will fall back to the instance settings
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
}
message GetLockoutSettingsResponse {
zitadel.object.v2.Details details = 1;
zitadel.settings.v2.LockoutSettings settings = 2;
}
message GetActiveIdentityProvidersRequest {
// Specify the context for which the active identity providers should be returned.
// This can be the instance or an organization.
// In case of an organization, the returned providers will fall back to the instance providers
// if not explicitly set on the organization.
zitadel.object.v2.RequestContext ctx = 1;
optional bool creation_allowed = 2;
optional bool linking_allowed = 3;
optional bool auto_creation = 4;
optional bool auto_linking = 5;
}
message GetActiveIdentityProvidersResponse {
zitadel.object.v2.ListDetails details = 1;
repeated zitadel.settings.v2.IdentityProvider identity_providers = 2;
}
message GetGeneralSettingsRequest {}
message GetGeneralSettingsResponse {
// The unique identifier of the default organization.
// The default organization is used to assign new users to an organization if no other organization is specified.
// Deprecated: use default_organization_id instead.
string default_org_id = 1;
// The default language is use if no other language is specified or detected.
// The format is a BCP 47 language tag (e.g. "en", "de", "fr-CH").
string default_language = 2 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"en\""
}
];
// The list of supported languages.
// Note that the instance might restrict the languages further
// only allowing a subset of these languages to be used.
// The format is a BCP 47 language tag (e.g. "en", "de", "fr-CH").
repeated string supported_languages = 3 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "[\"en\", \"de\", \"it\"]"
}
];
// The unique identifier of the default organization.
// The default organization is used to assign new users to an organization if no other organization is specified.
string default_organization_id = 4;
// The list of allowed languages for the instance.
// This is a subset of the supported languages to be used in the instance
// e.g. for user selection during registration or language detection in the UI.
// The format is a BCP 47 language tag (e.g. "en", "de", "fr-CH").
repeated string allowed_languages = 5 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "[\"en\", \"de\", \"it\"]"
}
];
}
message GetSecuritySettingsRequest{}
message GetSecuritySettingsResponse{
zitadel.object.v2.Details details = 1;
SecuritySettings settings = 2;
}
message SetSecuritySettingsRequest{
// EmbeddedIframeSettings defines if the login UI can be embedded in an iframe
// and which origins are allowed to do so.
EmbeddedIframeSettings embedded_iframe = 1;
// If enabled, users are allowed to impersonate other users.
// The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well".
bool enable_impersonation = 2;
// DynamicClientRegistrationSettings defines if OAuth 2.0 clients may register
// themselves at runtime (RFC 7591) and whether they may do so without a token.
DynamicClientRegistrationSettings dynamic_client_registration = 3;
}
message SetSecuritySettingsResponse{
zitadel.object.v2.Details details = 1;
}
message GetHostedLoginTranslationRequest {
// Specify the level from which the translation should be returned.
// If the requested level doesn't contain all translations, and ignore_inheritance is set to false
// a merging process fallbacks onto the higher levels ensuring all keys in the file have a translation.
oneof level {
bool system = 1 [(validate.rules).bool = {const: true}];
bool instance = 2 [(validate.rules).bool = {const: true}];
string organization_id = 3;
}
// The locale of the translations to be returned.
// Needs to be a BCP 47 language tag (e.g. "en", "de", "fr-CH").
string locale = 4 [
(validate.rules).string = {min_len: 2},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
min_length: 2;
example: "\"fr-FR\"";
}
];
// if set to true, higher levels are ignored, if false higher levels are merged into the file
bool ignore_inheritance = 5;
}
message GetHostedLoginTranslationResponse {
// hash of the payload
string etag = 1 [
(validate.rules).string = {min_len: 32, max_len: 32},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
min_length: 32;
max_length: 32;
example: "\"42a1ba123e6ea6f0c93e286ed97c7018\"";
}
];
// Translations contains the translations in the requested language.
google.protobuf.Struct translations = 2 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "{\"common\":{\"back\":\"Indietro\"},\"accounts\":{\"title\":\"Account\",\"description\":\"Seleziona l'account che desideri utilizzare.\",\"addAnother\":\"Aggiungi un altro account\",\"noResults\":\"Nessun account trovato\"}}";
}
];
}
message SetHostedLoginTranslationRequest {
// Specify the level on which the translation should be set.
// Only instance or organization level is allowed.
// System level translations can't be modified.
// In case of organization level, the organization_id needs to be set.
// If a translation already exists on the specified level, it will be overwritten.
oneof level {
bool instance = 1 [(validate.rules).bool = {const: true}];
string organization_id = 2;
}
// The locale of the translations to be set.
// Needs to be a BCP 47 language tag (e.g. "en", "de", "fr-CH").
string locale = 3 [
(validate.rules).string = {min_len: 2},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
min_length: 2;
example: "\"fr-FR\"";
}
];
// Translations should contain the translations in the specified locale.
google.protobuf.Struct translations = 4 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "{\"common\":{\"back\":\"Indietro\"},\"accounts\":{\"title\":\"Account\",\"description\":\"Seleziona l'account che desideri utilizzare.\",\"addAnother\":\"Aggiungi un altro account\",\"noResults\":\"Nessun account trovato\"}}";
}
];
}
message SetHostedLoginTranslationResponse {
// hash of the saved translation. Valid only when ignore_inheritance = true
string etag = 1 [
(validate.rules).string = {min_len: 32, max_len: 32},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
min_length: 32;
max_length: 32;
example: "\"42a1ba123e6ea6f0c93e286ed97c7018\"";
}
];
}