mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-04 18:08:50 +00:00
* feat: add v2alpha policies service * feat: add v2alpha policies service * fix: rename of attributes and messages in v2alpha api * fix: rename of attributes and messages in v2alpha api * fix: linter corrections * fix: review corrections * fix: review corrections * fix: review corrections * fix: review corrections * fix grpc * refactor: rename to settings and more * Apply suggestions from code review Co-authored-by: Fabi <[email protected]> * add service to docs and rename legal settings * unit tests for converters * go mod tidy * ensure idp name and return list details * fix: use correct resource owner for active idps * change query to join --------- Co-authored-by: Livio Spring <[email protected]> Co-authored-by: Fabi <[email protected]> Co-authored-by: Tim Möhlmann <[email protected]>
357 lines
9.8 KiB
Protocol Buffer
357 lines
9.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package zitadel.settings.v2alpha;
|
|
|
|
import "zitadel/protoc_gen_zitadel/v2/options.proto";
|
|
import "zitadel/object/v2alpha/object.proto";
|
|
import "zitadel/settings/v2alpha/branding_settings.proto";
|
|
import "zitadel/settings/v2alpha/domain_settings.proto";
|
|
import "zitadel/settings/v2alpha/legal_settings.proto";
|
|
import "zitadel/settings/v2alpha/lockout_settings.proto";
|
|
import "zitadel/settings/v2alpha/login_settings.proto";
|
|
import "zitadel/settings/v2alpha/password_settings.proto";
|
|
import "google/api/annotations.proto";
|
|
import "google/api/field_behavior.proto";
|
|
import "protoc-gen-openapiv2/options/annotations.proto";
|
|
import "validate/validate.proto";
|
|
|
|
option go_package = "github.com/zitadel/zitadel/pkg/grpc/settings/v2alpha;settings";
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
|
info: {
|
|
title: "Settings Service";
|
|
version: "2.0-alpha";
|
|
description: "This API is intended to manage settings in a ZITADEL instance. This project is in alpha state. It can AND will continue breaking until the services provide the same functionality as the current login.";
|
|
contact:{
|
|
name: "ZITADEL"
|
|
url: "https://zitadel.com"
|
|
email: "[email protected]"
|
|
}
|
|
license: {
|
|
name: "Apache 2.0",
|
|
url: "https://github.com/zitadel/zitadel/blob/main/LICENSE";
|
|
};
|
|
};
|
|
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: "$ZITADEL_DOMAIN";
|
|
base_path: "/";
|
|
|
|
external_docs: {
|
|
description: "Detailed information about ZITADEL",
|
|
url: "https://zitadel.com/docs"
|
|
}
|
|
|
|
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 basic information over the instance
|
|
rpc GetGeneralSettings (GetGeneralSettingsRequest) returns (GetGeneralSettingsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get basic information over the instance";
|
|
description: "Return the basic information of the instance for the requested context"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get the login settings
|
|
rpc GetLoginSettings (GetLoginSettingsRequest) returns (GetLoginSettingsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings/login"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get the login settings";
|
|
description: "Return the settings for the requested context"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get the current active identity providers
|
|
rpc GetActiveIdentityProviders (GetActiveIdentityProvidersRequest) returns (GetActiveIdentityProvidersResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings/login/idps"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get the current active identity providers";
|
|
description: "Return the current active identity providers for the requested context"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get the password complexity settings
|
|
rpc GetPasswordComplexitySettings (GetPasswordComplexitySettingsRequest) returns (GetPasswordComplexitySettingsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings/password/complexity"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get the password complexity settings";
|
|
description: "Return the password complexity settings for the requested context"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get the current active branding settings
|
|
rpc GetBrandingSettings (GetBrandingSettingsRequest) returns (GetBrandingSettingsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings/branding"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get the current active branding settings";
|
|
description: "Return the current active branding settings for the requested context"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get the domain settings
|
|
rpc GetDomainSettings (GetDomainSettingsRequest) returns (GetDomainSettingsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings/domain"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get the domain settings";
|
|
description: "Return the domain settings for the requested context"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get the legal and support settings
|
|
rpc GetLegalAndSupportSettings (GetLegalAndSupportSettingsRequest) returns (GetLegalAndSupportSettingsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings/legal_support"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get the legal and support settings";
|
|
description: "Return the legal settings for the requested context"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get the lockout settings
|
|
rpc GetLockoutSettings (GetLockoutSettingsRequest) returns (GetLockoutSettingsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2alpha/settings/lockout"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "policy.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Get the lockout settings";
|
|
description: "Return the lockout settings for the requested context, which define when a user will be locked"
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "OK";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
message GetLoginSettingsRequest {
|
|
zitadel.object.v2alpha.RequestContext ctx = 1;
|
|
}
|
|
|
|
message GetLoginSettingsResponse {
|
|
zitadel.object.v2alpha.Details details = 1;
|
|
zitadel.settings.v2alpha.LoginSettings settings = 2;
|
|
}
|
|
|
|
message GetPasswordComplexitySettingsRequest {
|
|
zitadel.object.v2alpha.RequestContext ctx = 1;
|
|
}
|
|
|
|
message GetPasswordComplexitySettingsResponse {
|
|
zitadel.object.v2alpha.Details details = 1;
|
|
zitadel.settings.v2alpha.PasswordComplexitySettings settings = 2;
|
|
}
|
|
|
|
message GetBrandingSettingsRequest {
|
|
zitadel.object.v2alpha.RequestContext ctx = 1;
|
|
}
|
|
|
|
message GetBrandingSettingsResponse {
|
|
zitadel.object.v2alpha.Details details = 1;
|
|
zitadel.settings.v2alpha.BrandingSettings settings = 2;
|
|
}
|
|
|
|
message GetDomainSettingsRequest {
|
|
zitadel.object.v2alpha.RequestContext ctx = 1;
|
|
}
|
|
|
|
message GetDomainSettingsResponse {
|
|
zitadel.object.v2alpha.Details details = 1;
|
|
zitadel.settings.v2alpha.DomainSettings settings = 2;
|
|
}
|
|
|
|
message GetLegalAndSupportSettingsRequest {
|
|
zitadel.object.v2alpha.RequestContext ctx = 1;
|
|
}
|
|
|
|
message GetLegalAndSupportSettingsResponse {
|
|
zitadel.object.v2alpha.Details details = 1;
|
|
zitadel.settings.v2alpha.LegalAndSupportSettings settings = 2;
|
|
}
|
|
|
|
message GetLockoutSettingsRequest {
|
|
zitadel.object.v2alpha.RequestContext ctx = 1;
|
|
}
|
|
|
|
message GetLockoutSettingsResponse {
|
|
zitadel.object.v2alpha.Details details = 1;
|
|
zitadel.settings.v2alpha.LockoutSettings settings = 2;
|
|
}
|
|
|
|
message GetActiveIdentityProvidersRequest {
|
|
zitadel.object.v2alpha.RequestContext ctx = 1;
|
|
}
|
|
|
|
message GetActiveIdentityProvidersResponse {
|
|
zitadel.object.v2alpha.ListDetails details = 1;
|
|
repeated zitadel.settings.v2alpha.IdentityProvider identity_providers = 2;
|
|
}
|
|
|
|
message GetGeneralSettingsRequest {}
|
|
|
|
message GetGeneralSettingsResponse {
|
|
string default_org_id = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
description: "default organization for the current context"
|
|
}
|
|
];
|
|
string default_language = 2 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
description: "default language for the current context"
|
|
example: "\"en\""
|
|
}
|
|
];
|
|
repeated string supported_languages = 3 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "[\"en\", \"de\", \"it\"]"
|
|
}
|
|
];
|
|
}
|