mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 11:17:32 +00:00
fixup! fixup! fixup! fixup! fixup! added first event
This commit is contained in:
@@ -35,6 +35,15 @@ const (
|
||||
IDPStateInactive
|
||||
)
|
||||
|
||||
//go:generate enumer -type IDPAutoLinkingOption -transform lower -trimprefix IDPAutoLinkingOption
|
||||
type IDPAutoLinkingOption uint8
|
||||
|
||||
const (
|
||||
IDPAutoLinkingOptionUnspecified IDPAutoLinkingOption = iota
|
||||
IDPAutoLinkingOptionUserName
|
||||
IDPAutoLinkingOptionEmail
|
||||
)
|
||||
|
||||
type OIDCMappingField int8
|
||||
|
||||
const (
|
||||
@@ -57,8 +66,8 @@ type IdentityProvider struct {
|
||||
AllowAutoCreation bool `json:"allowAutoCreation,omitempty" db:"allow_auto_creation"`
|
||||
AllowAutoUpdate bool `json:"allowAutoUpdate,omitempty" db:"allow_auto_update"`
|
||||
AllowLinking bool `json:"allowLinking,omitempty" db:"allow_linking"`
|
||||
AllowAutoLinking bool `json:"allowAutoLinking,omitempty" db:"allow_auto_linking"`
|
||||
StylingType int16 `json:"stylingType,omitempty" db:"styling_type"`
|
||||
AllowAutoLinking string `json:"allowAutoLinking,omitempty" db:"allow_auto_linking"`
|
||||
StylingType *int16 `json:"stylingType,omitempty" db:"styling_type"`
|
||||
Payload *string `json:"payload,omitempty" db:"payload"`
|
||||
CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"`
|
||||
UpdatedAt time.Time `json:"updatedAt,omitempty" db:"updated_at"`
|
||||
@@ -74,6 +83,8 @@ type OIDC struct {
|
||||
Scopes []string `json:"scopes,omitempty"`
|
||||
IDPDisplayNameMapping OIDCMappingField `json:"IDPDisplayNameMapping,omitempty"`
|
||||
UserNameMapping OIDCMappingField `json:"usernameMapping,omitempty"`
|
||||
IsIDTokenMapping bool `json:"idTokenMapping,omitempty"`
|
||||
UsePKCE bool `json:"usePKCE,omitempty"`
|
||||
}
|
||||
|
||||
type IDPOIDC struct {
|
||||
@@ -94,6 +105,24 @@ type IDPJWT struct {
|
||||
JWT
|
||||
}
|
||||
|
||||
type OAuth struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name,omitempty"`
|
||||
ClientID string `json:"clientId,omitempty"`
|
||||
ClientSecret *crypto.CryptoValue `json:"clientSecret,omitempty"`
|
||||
AuthorizationEndpoint string `json:"authorizationEndpoint,omitempty"`
|
||||
TokenEndpoint string `json:"tokenEndpoint,omitempty"`
|
||||
UserEndpoint string `json:"userEndpoint,omitempty"`
|
||||
Scopes []string `json:"scopes,omitempty"`
|
||||
IDAttribute string `json:"idAttribute,omitempty"`
|
||||
UsePKCE bool `json:"usePKCE,omitempty"`
|
||||
}
|
||||
|
||||
type IDPOAuth struct {
|
||||
*IdentityProvider
|
||||
OAuth
|
||||
}
|
||||
|
||||
// IDPIdentifierCondition is used to help specify a single identity_provider,
|
||||
// it will either be used as the identity_provider ID or identity_provider name,
|
||||
// as identity_provider can be identified either using (instanceID + OrgID + ID) OR (instanceID + OrgID + name)
|
||||
@@ -132,7 +161,7 @@ type idProviderConditions interface {
|
||||
AllowAutoCreationCondition(allow bool) database.Condition
|
||||
AllowAutoUpdateCondition(allow bool) database.Condition
|
||||
AllowLinkingCondition(allow bool) database.Condition
|
||||
AllowAutoLinkingCondition(allow bool) database.Condition
|
||||
AllowAutoLinkingCondition(linkingType IDPAutoLinkingOption) database.Condition
|
||||
StylingTypeCondition(style int16) database.Condition
|
||||
PayloadCondition(payload string) database.Condition
|
||||
}
|
||||
@@ -164,4 +193,6 @@ type IDProviderRepository interface {
|
||||
|
||||
GetOIDC(ctx context.Context, id IDPIdentifierCondition, instanceID string, orgID *string) (*IDPOIDC, error)
|
||||
GetJWT(ctx context.Context, id IDPIdentifierCondition, instanceID string, orgID *string) (*IDPJWT, error)
|
||||
|
||||
GetOAuth(ctx context.Context, id IDPIdentifierCondition, instanceID string, orgID *string) (*IDPOAuth, error)
|
||||
}
|
||||
|
82
backend/v3/domain/idpautolinkingoption_enumer.go
Normal file
82
backend/v3/domain/idpautolinkingoption_enumer.go
Normal file
@@ -0,0 +1,82 @@
|
||||
// Code generated by "enumer -type IDPAutoLinkingOption -transform lower -trimprefix IDPAutoLinkingOption"; DO NOT EDIT.
|
||||
|
||||
package domain
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const _IDPAutoLinkingOptionName = "unspecifiedusernameemail"
|
||||
|
||||
var _IDPAutoLinkingOptionIndex = [...]uint8{0, 11, 19, 24}
|
||||
|
||||
const _IDPAutoLinkingOptionLowerName = "unspecifiedusernameemail"
|
||||
|
||||
func (i IDPAutoLinkingOption) String() string {
|
||||
if i >= IDPAutoLinkingOption(len(_IDPAutoLinkingOptionIndex)-1) {
|
||||
return fmt.Sprintf("IDPAutoLinkingOption(%d)", i)
|
||||
}
|
||||
return _IDPAutoLinkingOptionName[_IDPAutoLinkingOptionIndex[i]:_IDPAutoLinkingOptionIndex[i+1]]
|
||||
}
|
||||
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
func _IDPAutoLinkingOptionNoOp() {
|
||||
var x [1]struct{}
|
||||
_ = x[IDPAutoLinkingOptionUnspecified-(0)]
|
||||
_ = x[IDPAutoLinkingOptionUserName-(1)]
|
||||
_ = x[IDPAutoLinkingOptionEmail-(2)]
|
||||
}
|
||||
|
||||
var _IDPAutoLinkingOptionValues = []IDPAutoLinkingOption{IDPAutoLinkingOptionUnspecified, IDPAutoLinkingOptionUserName, IDPAutoLinkingOptionEmail}
|
||||
|
||||
var _IDPAutoLinkingOptionNameToValueMap = map[string]IDPAutoLinkingOption{
|
||||
_IDPAutoLinkingOptionName[0:11]: IDPAutoLinkingOptionUnspecified,
|
||||
_IDPAutoLinkingOptionLowerName[0:11]: IDPAutoLinkingOptionUnspecified,
|
||||
_IDPAutoLinkingOptionName[11:19]: IDPAutoLinkingOptionUserName,
|
||||
_IDPAutoLinkingOptionLowerName[11:19]: IDPAutoLinkingOptionUserName,
|
||||
_IDPAutoLinkingOptionName[19:24]: IDPAutoLinkingOptionEmail,
|
||||
_IDPAutoLinkingOptionLowerName[19:24]: IDPAutoLinkingOptionEmail,
|
||||
}
|
||||
|
||||
var _IDPAutoLinkingOptionNames = []string{
|
||||
_IDPAutoLinkingOptionName[0:11],
|
||||
_IDPAutoLinkingOptionName[11:19],
|
||||
_IDPAutoLinkingOptionName[19:24],
|
||||
}
|
||||
|
||||
// IDPAutoLinkingOptionString retrieves an enum value from the enum constants string name.
|
||||
// Throws an error if the param is not part of the enum.
|
||||
func IDPAutoLinkingOptionString(s string) (IDPAutoLinkingOption, error) {
|
||||
if val, ok := _IDPAutoLinkingOptionNameToValueMap[s]; ok {
|
||||
return val, nil
|
||||
}
|
||||
|
||||
if val, ok := _IDPAutoLinkingOptionNameToValueMap[strings.ToLower(s)]; ok {
|
||||
return val, nil
|
||||
}
|
||||
return 0, fmt.Errorf("%s does not belong to IDPAutoLinkingOption values", s)
|
||||
}
|
||||
|
||||
// IDPAutoLinkingOptionValues returns all values of the enum
|
||||
func IDPAutoLinkingOptionValues() []IDPAutoLinkingOption {
|
||||
return _IDPAutoLinkingOptionValues
|
||||
}
|
||||
|
||||
// IDPAutoLinkingOptionStrings returns a slice of all String values of the enum
|
||||
func IDPAutoLinkingOptionStrings() []string {
|
||||
strs := make([]string, len(_IDPAutoLinkingOptionNames))
|
||||
copy(strs, _IDPAutoLinkingOptionNames)
|
||||
return strs
|
||||
}
|
||||
|
||||
// IsAIDPAutoLinkingOption returns "true" if the value is listed in the enum definition. "false" otherwise
|
||||
func (i IDPAutoLinkingOption) IsAIDPAutoLinkingOption() bool {
|
||||
for _, v := range _IDPAutoLinkingOptionValues {
|
||||
if i == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user