feat: mfa policy (#913)

* feat: add mfa to login policy

* feat: add mfa to login policy

* feat: add mfa to login policy

* feat: add mfa to login policy

* feat: add mfa to login policy on org

* feat: add mfa to login policy on org

* feat: append events on policy views

* feat: iam login policy mfa definition

* feat: login policies on orgs

* feat: configured mfas in login process

* feat: configured mfas in login process

* Update internal/ui/login/static/i18n/en.yaml

Co-authored-by: Livio Amstutz <[email protected]>

* fix: rename software and hardware mfas

* fix: pr requests

* fix user mfa

* fix: test

* fix: oidc version

* fix: oidc version

* fix: proto gen

Co-authored-by: Livio Amstutz <[email protected]>
Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
Fabi
2020-11-04 11:26:10 +01:00
committed by GitHub
co-authored by Livio Amstutz Max Peintner
parent 51417be35d
commit 202aae4954
76 changed files with 12913 additions and 5614 deletions
+30
View File
@@ -184,6 +184,36 @@ var AdminService_AuthMethods = authz.MethodMapping{
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/GetDefaultLoginPolicySecondFactors": authz.Option{
Permission: "iam.policy.read",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/AddSecondFactorToDefaultLoginPolicy": authz.Option{
Permission: "iam.policy.write",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/RemoveSecondFactorFromDefaultLoginPolicy": authz.Option{
Permission: "iam.policy.write",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/GetDefaultLoginPolicyMultiFactors": authz.Option{
Permission: "iam.policy.read",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/AddMultiFactorToDefaultLoginPolicy": authz.Option{
Permission: "iam.policy.write",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/RemoveMultiFactorFromDefaultLoginPolicy": authz.Option{
Permission: "iam.policy.write",
CheckParam: "",
},
"/caos.zitadel.admin.api.v1.AdminService/GetDefaultPasswordComplexityPolicy": authz.Option{
Permission: "iam.policy.read",
CheckParam: "",
+1665 -961
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+274
View File
@@ -4496,6 +4496,8 @@ func (m *DefaultLoginPolicy) Validate() error {
}
}
// no validation rules for ForceMfa
return nil
}
@@ -4569,6 +4571,8 @@ func (m *DefaultLoginPolicyRequest) Validate() error {
// no validation rules for AllowExternalIdp
// no validation rules for ForceMfa
return nil
}
@@ -4734,6 +4738,8 @@ func (m *DefaultLoginPolicyView) Validate() error {
}
}
// no validation rules for ForceMfa
return nil
}
@@ -5035,6 +5041,274 @@ var _ interface {
ErrorName() string
} = IdpProviderSearchRequestValidationError{}
// Validate checks the field values on SecondFactorsResult with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *SecondFactorsResult) Validate() error {
if m == nil {
return nil
}
return nil
}
// SecondFactorsResultValidationError is the validation error returned by
// SecondFactorsResult.Validate if the designated constraints aren't met.
type SecondFactorsResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SecondFactorsResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SecondFactorsResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SecondFactorsResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SecondFactorsResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SecondFactorsResultValidationError) ErrorName() string {
return "SecondFactorsResultValidationError"
}
// Error satisfies the builtin error interface
func (e SecondFactorsResultValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSecondFactorsResult.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SecondFactorsResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SecondFactorsResultValidationError{}
// Validate checks the field values on SecondFactor with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *SecondFactor) Validate() error {
if m == nil {
return nil
}
// no validation rules for SecondFactor
return nil
}
// SecondFactorValidationError is the validation error returned by
// SecondFactor.Validate if the designated constraints aren't met.
type SecondFactorValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SecondFactorValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SecondFactorValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SecondFactorValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SecondFactorValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SecondFactorValidationError) ErrorName() string { return "SecondFactorValidationError" }
// Error satisfies the builtin error interface
func (e SecondFactorValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSecondFactor.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SecondFactorValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SecondFactorValidationError{}
// Validate checks the field values on MultiFactorsResult with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *MultiFactorsResult) Validate() error {
if m == nil {
return nil
}
return nil
}
// MultiFactorsResultValidationError is the validation error returned by
// MultiFactorsResult.Validate if the designated constraints aren't met.
type MultiFactorsResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e MultiFactorsResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e MultiFactorsResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e MultiFactorsResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e MultiFactorsResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e MultiFactorsResultValidationError) ErrorName() string {
return "MultiFactorsResultValidationError"
}
// Error satisfies the builtin error interface
func (e MultiFactorsResultValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sMultiFactorsResult.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = MultiFactorsResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = MultiFactorsResultValidationError{}
// Validate checks the field values on MultiFactor with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *MultiFactor) Validate() error {
if m == nil {
return nil
}
// no validation rules for MultiFactor
return nil
}
// MultiFactorValidationError is the validation error returned by
// MultiFactor.Validate if the designated constraints aren't met.
type MultiFactorValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e MultiFactorValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e MultiFactorValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e MultiFactorValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e MultiFactorValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e MultiFactorValidationError) ErrorName() string { return "MultiFactorValidationError" }
// Error satisfies the builtin error interface
func (e MultiFactorValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sMultiFactor.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = MultiFactorValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = MultiFactorValidationError{}
// Validate checks the field values on DefaultPasswordComplexityPolicy with the
// rules defined in the proto definition for this message. If any rules are
// violated, an error is returned.
+357 -78
View File
@@ -30,7 +30,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -52,7 +52,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -96,7 +96,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -118,7 +118,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -150,7 +150,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -182,7 +182,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -220,7 +220,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -248,7 +248,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -276,7 +276,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -314,7 +314,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -352,7 +352,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -390,7 +390,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -422,7 +422,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -454,7 +454,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -476,7 +476,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -504,7 +504,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -543,7 +543,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -579,7 +579,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -611,7 +611,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -644,7 +644,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -664,7 +664,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -696,7 +696,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -726,7 +726,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -754,7 +754,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -782,7 +782,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -818,7 +818,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -856,7 +856,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -876,7 +876,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -908,7 +908,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -928,7 +928,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -960,7 +960,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -992,7 +992,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1024,7 +1024,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1043,6 +1043,183 @@
]
}
},
"/policies/login/multifactors": {
"post": {
"operationId": "AdminService_AddMultiFactorToDefaultLoginPolicy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1MultiFactor"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1MultiFactor"
}
}
],
"tags": [
"AdminService"
]
}
},
"/policies/login/multifactors/_search": {
"get": {
"operationId": "AdminService_GetDefaultLoginPolicyMultiFactors",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1MultiFactorsResult"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
"AdminService"
]
}
},
"/policies/login/multifactors/{multi_factor}": {
"delete": {
"operationId": "AdminService_RemoveMultiFactorFromDefaultLoginPolicy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "multi_factor",
"in": "path",
"required": true,
"type": "string",
"enum": [
"MULTIFACTORTYPE_UNSPECIFIED",
"MULTIFACTORTYPE_U2F_WITH_PIN"
]
}
],
"tags": [
"AdminService"
]
}
},
"/policies/login/secondfactors": {
"post": {
"operationId": "AdminService_AddSecondFactorToDefaultLoginPolicy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1SecondFactor"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1SecondFactor"
}
}
],
"tags": [
"AdminService"
]
}
},
"/policies/login/secondfactors/_search": {
"get": {
"operationId": "AdminService_GetDefaultLoginPolicySecondFactors",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1SecondFactorsResult"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
"AdminService"
]
}
},
"/policies/login/secondfactors/{second_factor}": {
"delete": {
"operationId": "AdminService_RemoveSecondFactorFromDefaultLoginPolicy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "second_factor",
"in": "path",
"required": true,
"type": "string",
"enum": [
"SECONDFACTORTYPE_UNSPECIFIED",
"SECONDFACTORTYPE_OTP",
"SECONDFACTORTYPE_U2F"
]
}
],
"tags": [
"AdminService"
]
}
},
"/policies/password/age": {
"get": {
"operationId": "AdminService_GetDefaultPasswordAgePolicy",
@@ -1054,7 +1231,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1074,7 +1251,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1106,7 +1283,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1126,7 +1303,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1158,7 +1335,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1178,7 +1355,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1211,7 +1388,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1233,7 +1410,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1255,7 +1432,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1277,7 +1454,7 @@
}
},
"default": {
"description": "An unexpected error response.",
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
@@ -1398,13 +1575,15 @@
"type": "string"
},
"is_email_verified": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"phone": {
"type": "string"
},
"is_phone_verified": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"country": {
"type": "string"
@@ -1515,13 +1694,16 @@
"type": "object",
"properties": {
"allow_username_password": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"allow_register": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"allow_external_idp": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"creation_date": {
"type": "string",
@@ -1530,6 +1712,10 @@
"change_date": {
"type": "string",
"format": "date-time"
},
"force_mfa": {
"type": "boolean",
"format": "boolean"
}
}
},
@@ -1537,13 +1723,20 @@
"type": "object",
"properties": {
"allow_username_password": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"allow_register": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"allow_external_idp": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"force_mfa": {
"type": "boolean",
"format": "boolean"
}
}
},
@@ -1551,13 +1744,16 @@
"type": "object",
"properties": {
"allow_username_password": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"allow_register": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"allow_external_idp": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"creation_date": {
"type": "string",
@@ -1566,6 +1762,10 @@
"change_date": {
"type": "string",
"format": "date-time"
},
"force_mfa": {
"type": "boolean",
"format": "boolean"
}
}
},
@@ -1632,16 +1832,20 @@
"format": "uint64"
},
"has_uppercase": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_lowercase": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_number": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_symbol": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"creation_date": {
"type": "string",
@@ -1661,16 +1865,20 @@
"format": "uint64"
},
"has_uppercase": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_lowercase": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_number": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_symbol": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
}
}
},
@@ -1682,16 +1890,20 @@
"format": "uint64"
},
"has_uppercase": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_lowercase": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_number": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"has_symbol": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"creation_date": {
"type": "string",
@@ -1711,7 +1923,8 @@
"format": "uint64"
},
"show_lockout_failure": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"creation_date": {
"type": "string",
@@ -1731,7 +1944,8 @@
"format": "uint64"
},
"show_lockout_failure": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
}
}
},
@@ -1743,7 +1957,8 @@
"format": "uint64"
},
"show_lockout_failure": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"creation_date": {
"type": "string",
@@ -1823,13 +2038,15 @@
"type": "string"
},
"is_email_verified": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"phone": {
"type": "string"
},
"is_phone_verified": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"country": {
"type": "string"
@@ -2300,6 +2517,33 @@
}
}
},
"v1MultiFactor": {
"type": "object",
"properties": {
"multi_factor": {
"$ref": "#/definitions/v1MultiFactorType"
}
}
},
"v1MultiFactorType": {
"type": "string",
"enum": [
"MULTIFACTORTYPE_UNSPECIFIED",
"MULTIFACTORTYPE_U2F_WITH_PIN"
],
"default": "MULTIFACTORTYPE_UNSPECIFIED"
},
"v1MultiFactorsResult": {
"type": "object",
"properties": {
"multi_factors": {
"type": "array",
"items": {
"$ref": "#/definitions/v1MultiFactorType"
}
}
}
},
"v1OIDCMappingField": {
"type": "string",
"enum": [
@@ -2445,10 +2689,12 @@
"type": "string"
},
"user_login_must_be_domain": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"default": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"sequence": {
"type": "string",
@@ -2474,7 +2720,8 @@
"type": "string"
},
"user_login_must_be_domain": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
}
}
},
@@ -2485,10 +2732,12 @@
"type": "string"
},
"user_login_must_be_domain": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"default": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"sequence": {
"type": "string",
@@ -2552,7 +2801,8 @@
"$ref": "#/definitions/v1OrgSearchKey"
},
"asc": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
},
"queries": {
"type": "array",
@@ -2641,11 +2891,40 @@
],
"default": "SEARCHMETHOD_EQUALS"
},
"v1SecondFactor": {
"type": "object",
"properties": {
"second_factor": {
"$ref": "#/definitions/v1SecondFactorType"
}
}
},
"v1SecondFactorType": {
"type": "string",
"enum": [
"SECONDFACTORTYPE_UNSPECIFIED",
"SECONDFACTORTYPE_OTP",
"SECONDFACTORTYPE_U2F"
],
"default": "SECONDFACTORTYPE_UNSPECIFIED"
},
"v1SecondFactorsResult": {
"type": "object",
"properties": {
"second_factors": {
"type": "array",
"items": {
"$ref": "#/definitions/v1SecondFactorType"
}
}
}
},
"v1UniqueOrgResponse": {
"type": "object",
"properties": {
"is_unique": {
"type": "boolean"
"type": "boolean",
"format": "boolean"
}
}
},
+120
View File
@@ -77,6 +77,46 @@ func (mr *MockAdminServiceClientMockRecorder) AddIdpProviderToDefaultLoginPolicy
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddIdpProviderToDefaultLoginPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).AddIdpProviderToDefaultLoginPolicy), varargs...)
}
// AddMultiFactorToDefaultLoginPolicy mocks base method
func (m *MockAdminServiceClient) AddMultiFactorToDefaultLoginPolicy(arg0 context.Context, arg1 *admin.MultiFactor, arg2 ...grpc.CallOption) (*admin.MultiFactor, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "AddMultiFactorToDefaultLoginPolicy", varargs...)
ret0, _ := ret[0].(*admin.MultiFactor)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AddMultiFactorToDefaultLoginPolicy indicates an expected call of AddMultiFactorToDefaultLoginPolicy
func (mr *MockAdminServiceClientMockRecorder) AddMultiFactorToDefaultLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMultiFactorToDefaultLoginPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).AddMultiFactorToDefaultLoginPolicy), varargs...)
}
// AddSecondFactorToDefaultLoginPolicy mocks base method
func (m *MockAdminServiceClient) AddSecondFactorToDefaultLoginPolicy(arg0 context.Context, arg1 *admin.SecondFactor, arg2 ...grpc.CallOption) (*admin.SecondFactor, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "AddSecondFactorToDefaultLoginPolicy", varargs...)
ret0, _ := ret[0].(*admin.SecondFactor)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// AddSecondFactorToDefaultLoginPolicy indicates an expected call of AddSecondFactorToDefaultLoginPolicy
func (mr *MockAdminServiceClientMockRecorder) AddSecondFactorToDefaultLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSecondFactorToDefaultLoginPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).AddSecondFactorToDefaultLoginPolicy), varargs...)
}
// ChangeIamMember mocks base method
func (m *MockAdminServiceClient) ChangeIamMember(arg0 context.Context, arg1 *admin.ChangeIamMemberRequest, arg2 ...grpc.CallOption) (*admin.IamMember, error) {
m.ctrl.T.Helper()
@@ -237,6 +277,46 @@ func (mr *MockAdminServiceClientMockRecorder) GetDefaultLoginPolicyIdpProviders(
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultLoginPolicyIdpProviders", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDefaultLoginPolicyIdpProviders), varargs...)
}
// GetDefaultLoginPolicyMultiFactors mocks base method
func (m *MockAdminServiceClient) GetDefaultLoginPolicyMultiFactors(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.MultiFactorsResult, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetDefaultLoginPolicyMultiFactors", varargs...)
ret0, _ := ret[0].(*admin.MultiFactorsResult)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetDefaultLoginPolicyMultiFactors indicates an expected call of GetDefaultLoginPolicyMultiFactors
func (mr *MockAdminServiceClientMockRecorder) GetDefaultLoginPolicyMultiFactors(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultLoginPolicyMultiFactors", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDefaultLoginPolicyMultiFactors), varargs...)
}
// GetDefaultLoginPolicySecondFactors mocks base method
func (m *MockAdminServiceClient) GetDefaultLoginPolicySecondFactors(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.SecondFactorsResult, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "GetDefaultLoginPolicySecondFactors", varargs...)
ret0, _ := ret[0].(*admin.SecondFactorsResult)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetDefaultLoginPolicySecondFactors indicates an expected call of GetDefaultLoginPolicySecondFactors
func (mr *MockAdminServiceClientMockRecorder) GetDefaultLoginPolicySecondFactors(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultLoginPolicySecondFactors", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDefaultLoginPolicySecondFactors), varargs...)
}
// GetDefaultOrgIamPolicy mocks base method
func (m *MockAdminServiceClient) GetDefaultOrgIamPolicy(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.OrgIamPolicyView, error) {
m.ctrl.T.Helper()
@@ -597,6 +677,26 @@ func (mr *MockAdminServiceClientMockRecorder) RemoveIdpProviderFromDefaultLoginP
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveIdpProviderFromDefaultLoginPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).RemoveIdpProviderFromDefaultLoginPolicy), varargs...)
}
// RemoveMultiFactorFromDefaultLoginPolicy mocks base method
func (m *MockAdminServiceClient) RemoveMultiFactorFromDefaultLoginPolicy(arg0 context.Context, arg1 *admin.MultiFactor, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "RemoveMultiFactorFromDefaultLoginPolicy", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// RemoveMultiFactorFromDefaultLoginPolicy indicates an expected call of RemoveMultiFactorFromDefaultLoginPolicy
func (mr *MockAdminServiceClientMockRecorder) RemoveMultiFactorFromDefaultLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveMultiFactorFromDefaultLoginPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).RemoveMultiFactorFromDefaultLoginPolicy), varargs...)
}
// RemoveOrgIamPolicy mocks base method
func (m *MockAdminServiceClient) RemoveOrgIamPolicy(arg0 context.Context, arg1 *admin.OrgIamPolicyID, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
@@ -617,6 +717,26 @@ func (mr *MockAdminServiceClientMockRecorder) RemoveOrgIamPolicy(arg0, arg1 inte
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveOrgIamPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).RemoveOrgIamPolicy), varargs...)
}
// RemoveSecondFactorFromDefaultLoginPolicy mocks base method
func (m *MockAdminServiceClient) RemoveSecondFactorFromDefaultLoginPolicy(arg0 context.Context, arg1 *admin.SecondFactor, arg2 ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "RemoveSecondFactorFromDefaultLoginPolicy", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// RemoveSecondFactorFromDefaultLoginPolicy indicates an expected call of RemoveSecondFactorFromDefaultLoginPolicy
func (mr *MockAdminServiceClientMockRecorder) RemoveSecondFactorFromDefaultLoginPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveSecondFactorFromDefaultLoginPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).RemoveSecondFactorFromDefaultLoginPolicy), varargs...)
}
// SearchIamMembers mocks base method
func (m *MockAdminServiceClient) SearchIamMembers(arg0 context.Context, arg1 *admin.IamMemberSearchRequest, arg2 ...grpc.CallOption) (*admin.IamMemberSearchResponse, error) {
m.ctrl.T.Helper()
+92
View File
@@ -416,6 +416,68 @@ service AdminService {
};
}
rpc GetDefaultLoginPolicySecondFactors(google.protobuf.Empty) returns (SecondFactorsResult) {
option (google.api.http) = {
get: "/policies/login/secondfactors/_search"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.read"
};
}
rpc AddSecondFactorToDefaultLoginPolicy(SecondFactor) returns (SecondFactor) {
option (google.api.http) = {
post: "/policies/login/secondfactors"
body: "*"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.write"
};
}
rpc RemoveSecondFactorFromDefaultLoginPolicy(SecondFactor) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/policies/login/secondfactors/{second_factor}"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.write"
};
}
rpc GetDefaultLoginPolicyMultiFactors(google.protobuf.Empty) returns (MultiFactorsResult) {
option (google.api.http) = {
get: "/policies/login/multifactors/_search"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.read"
};
}
rpc AddMultiFactorToDefaultLoginPolicy(MultiFactor) returns (MultiFactor) {
option (google.api.http) = {
post: "/policies/login/multifactors"
body: "*"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.write"
};
}
rpc RemoveMultiFactorFromDefaultLoginPolicy(MultiFactor) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/policies/login/multifactors/{multi_factor}"
};
option (caos.zitadel.utils.v1.auth_option) = {
permission: "iam.policy.write"
};
}
rpc GetDefaultPasswordComplexityPolicy(google.protobuf.Empty) returns (DefaultPasswordComplexityPolicyView) {
option (google.api.http) = {
get: "/policies/password/complexity"
@@ -949,12 +1011,14 @@ message DefaultLoginPolicy {
bool allow_external_idp = 3;
google.protobuf.Timestamp creation_date = 4;
google.protobuf.Timestamp change_date = 5;
bool force_mfa = 6;
}
message DefaultLoginPolicyRequest {
bool allow_username_password = 1;
bool allow_register = 2;
bool allow_external_idp = 3;
bool force_mfa = 4;
}
message IdpProviderID {
@@ -967,6 +1031,7 @@ message DefaultLoginPolicyView {
bool allow_external_idp = 3;
google.protobuf.Timestamp creation_date = 4;
google.protobuf.Timestamp change_date = 5;
bool force_mfa = 6;
}
message IdpProviderView {
@@ -995,6 +1060,33 @@ message IdpProviderSearchRequest {
uint64 limit = 2;
}
message SecondFactorsResult {
repeated SecondFactorType second_factors = 1;
}
message SecondFactor {
SecondFactorType second_factor = 1;
}
enum SecondFactorType {
SECONDFACTORTYPE_UNSPECIFIED = 0;
SECONDFACTORTYPE_OTP = 1;
SECONDFACTORTYPE_U2F = 2;
}
message MultiFactorsResult {
repeated MultiFactorType multi_factors = 1;
}
message MultiFactor {
MultiFactorType multi_factor = 1;
}
enum MultiFactorType {
MULTIFACTORTYPE_UNSPECIFIED = 0;
MULTIFACTORTYPE_U2F_WITH_PIN = 1;
}
message DefaultPasswordComplexityPolicy {
uint64 min_length = 1;
bool has_uppercase = 2;