Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply strategy filters in identifier first as well #4352

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .schema/openapi/patches/selfservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
value:
- "$ref": "#/components/schemas/updateRegistrationFlowWithPasswordMethod"
- "$ref": "#/components/schemas/updateRegistrationFlowWithOidcMethod"
- "$ref": "#/components/schemas/updateRegistrationFlowWithSamlMethod"
- "$ref": "#/components/schemas/updateRegistrationFlowWithWebAuthnMethod"
- "$ref": "#/components/schemas/updateRegistrationFlowWithCodeMethod"
- "$ref": "#/components/schemas/updateRegistrationFlowWithPasskeyMethod"
Expand All @@ -27,7 +28,7 @@
mapping:
password: "#/components/schemas/updateRegistrationFlowWithPasswordMethod"
oidc: "#/components/schemas/updateRegistrationFlowWithOidcMethod"
saml: "#/components/schemas/updateRegistrationFlowWithOidcMethod"
saml: "#/components/schemas/updateRegistrationFlowWithSamlMethod"
webauthn: "#/components/schemas/updateRegistrationFlowWithWebAuthnMethod"
code: "#/components/schemas/updateRegistrationFlowWithCodeMethod"
passkey: "#/components/schemas/updateRegistrationFlowWithPasskeyMethod"
Expand All @@ -52,6 +53,7 @@
value:
- "$ref": "#/components/schemas/updateLoginFlowWithPasswordMethod"
- "$ref": "#/components/schemas/updateLoginFlowWithOidcMethod"
- "$ref": "#/components/schemas/updateLoginFlowWithSamlMethod"
- "$ref": "#/components/schemas/updateLoginFlowWithTotpMethod"
- "$ref": "#/components/schemas/updateLoginFlowWithWebAuthnMethod"
- "$ref": "#/components/schemas/updateLoginFlowWithLookupSecretMethod"
Expand All @@ -65,7 +67,7 @@
mapping:
password: "#/components/schemas/updateLoginFlowWithPasswordMethod"
oidc: "#/components/schemas/updateLoginFlowWithOidcMethod"
saml: "#/components/schemas/updateLoginFlowWithOidcMethod"
saml: "#/components/schemas/updateLoginFlowWithSamlMethod"
totp: "#/components/schemas/updateLoginFlowWithTotpMethod"
webauthn: "#/components/schemas/updateLoginFlowWithWebAuthnMethod"
lookup_secret: "#/components/schemas/updateLoginFlowWithLookupSecretMethod"
Expand Down Expand Up @@ -147,6 +149,7 @@
- "$ref": "#/components/schemas/updateSettingsFlowWithPasswordMethod"
- "$ref": "#/components/schemas/updateSettingsFlowWithProfileMethod"
- "$ref": "#/components/schemas/updateSettingsFlowWithOidcMethod"
- "$ref": "#/components/schemas/updateSettingsFlowWithSamlMethod"
- "$ref": "#/components/schemas/updateSettingsFlowWithTotpMethod"
- "$ref": "#/components/schemas/updateSettingsFlowWithWebAuthnMethod"
- "$ref": "#/components/schemas/updateSettingsFlowWithLookupMethod"
Expand All @@ -159,7 +162,7 @@
password: "#/components/schemas/updateSettingsFlowWithPasswordMethod"
profile: "#/components/schemas/updateSettingsFlowWithProfileMethod"
oidc: "#/components/schemas/updateSettingsFlowWithOidcMethod"
saml: "#/components/schemas/updateSettingsFlowWithOidcMethod"
saml: "#/components/schemas/updateSettingsFlowWithSamlMethod"
totp: "#/components/schemas/updateSettingsFlowWithTotpMethod"
webauthn: "#/components/schemas/updateSettingsFlowWithWebAuthnMethod"
passkey: "#/components/schemas/updateSettingsFlowWithPasskeyMethod"
Expand Down
9 changes: 7 additions & 2 deletions driver/config/testhelpers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@
type (
TestConfigProvider struct {
contextx.Contextualizer
Options []configx.OptionModifier
Options []configx.OptionModifier
ConfigSchema []byte
}
contextKey int
)

func (t *TestConfigProvider) NewProvider(ctx context.Context, opts ...configx.OptionModifier) (*configx.Provider, error) {
return configx.New(ctx, []byte(embedx.ConfigSchema), append(t.Options, opts...)...)
schema := []byte(embedx.ConfigSchema)
if len(t.ConfigSchema) > 0 {
schema = t.ConfigSchema

Check warning on line 30 in driver/config/testhelpers/config.go

View check run for this annotation

Codecov / codecov/patch

driver/config/testhelpers/config.go#L30

Added line #L30 was not covered by tests
}
return configx.New(ctx, schema, append(t.Options, opts...)...)
}

func (t *TestConfigProvider) Config(ctx context.Context, config *configx.Provider) *configx.Provider {
Expand Down
7 changes: 6 additions & 1 deletion identity/credentials_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func (c *CredentialsOIDCEncryptedTokens) GetIDToken() string {

// NewCredentialsOIDC creates a new OIDC credential.
func NewCredentialsOIDC(tokens *CredentialsOIDCEncryptedTokens, provider, subject, organization string) (*Credentials, error) {
return NewOIDCLikeCredentials(tokens, CredentialsTypeOIDC, provider, subject, organization)
}

// NewOIDCLikeCredentials creates a new OIDC-like credential.
func NewOIDCLikeCredentials(tokens *CredentialsOIDCEncryptedTokens, t CredentialsType, provider, subject, organization string) (*Credentials, error) {
if provider == "" {
return nil, errors.New("received empty provider in oidc credentials")
}
Expand All @@ -89,7 +94,7 @@ func NewCredentialsOIDC(tokens *CredentialsOIDCEncryptedTokens, provider, subjec
}

return &Credentials{
Type: CredentialsTypeOIDC,
Type: t,
Identifiers: []string{OIDCUniqueID(provider, subject)},
Config: b.Bytes(),
}, nil
Expand Down
6 changes: 6 additions & 0 deletions internal/client-go/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ docs/UpdateLoginFlowWithLookupSecretMethod.md
docs/UpdateLoginFlowWithOidcMethod.md
docs/UpdateLoginFlowWithPasskeyMethod.md
docs/UpdateLoginFlowWithPasswordMethod.md
docs/UpdateLoginFlowWithSamlMethod.md
docs/UpdateLoginFlowWithTotpMethod.md
docs/UpdateLoginFlowWithWebAuthnMethod.md
docs/UpdateRecoveryFlowBody.md
Expand All @@ -121,13 +122,15 @@ docs/UpdateRegistrationFlowWithOidcMethod.md
docs/UpdateRegistrationFlowWithPasskeyMethod.md
docs/UpdateRegistrationFlowWithPasswordMethod.md
docs/UpdateRegistrationFlowWithProfileMethod.md
docs/UpdateRegistrationFlowWithSamlMethod.md
docs/UpdateRegistrationFlowWithWebAuthnMethod.md
docs/UpdateSettingsFlowBody.md
docs/UpdateSettingsFlowWithLookupMethod.md
docs/UpdateSettingsFlowWithOidcMethod.md
docs/UpdateSettingsFlowWithPasskeyMethod.md
docs/UpdateSettingsFlowWithPasswordMethod.md
docs/UpdateSettingsFlowWithProfileMethod.md
docs/UpdateSettingsFlowWithSamlMethod.md
docs/UpdateSettingsFlowWithTotpMethod.md
docs/UpdateSettingsFlowWithWebAuthnMethod.md
docs/UpdateVerificationFlowBody.md
Expand Down Expand Up @@ -237,6 +240,7 @@ model_update_login_flow_with_lookup_secret_method.go
model_update_login_flow_with_oidc_method.go
model_update_login_flow_with_passkey_method.go
model_update_login_flow_with_password_method.go
model_update_login_flow_with_saml_method.go
model_update_login_flow_with_totp_method.go
model_update_login_flow_with_web_authn_method.go
model_update_recovery_flow_body.go
Expand All @@ -248,13 +252,15 @@ model_update_registration_flow_with_oidc_method.go
model_update_registration_flow_with_passkey_method.go
model_update_registration_flow_with_password_method.go
model_update_registration_flow_with_profile_method.go
model_update_registration_flow_with_saml_method.go
model_update_registration_flow_with_web_authn_method.go
model_update_settings_flow_body.go
model_update_settings_flow_with_lookup_method.go
model_update_settings_flow_with_oidc_method.go
model_update_settings_flow_with_passkey_method.go
model_update_settings_flow_with_password_method.go
model_update_settings_flow_with_profile_method.go
model_update_settings_flow_with_saml_method.go
model_update_settings_flow_with_totp_method.go
model_update_settings_flow_with_web_authn_method.go
model_update_verification_flow_body.go
Expand Down
3 changes: 3 additions & 0 deletions internal/client-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ Class | Method | HTTP request | Description
- [UpdateLoginFlowWithOidcMethod](docs/UpdateLoginFlowWithOidcMethod.md)
- [UpdateLoginFlowWithPasskeyMethod](docs/UpdateLoginFlowWithPasskeyMethod.md)
- [UpdateLoginFlowWithPasswordMethod](docs/UpdateLoginFlowWithPasswordMethod.md)
- [UpdateLoginFlowWithSamlMethod](docs/UpdateLoginFlowWithSamlMethod.md)
- [UpdateLoginFlowWithTotpMethod](docs/UpdateLoginFlowWithTotpMethod.md)
- [UpdateLoginFlowWithWebAuthnMethod](docs/UpdateLoginFlowWithWebAuthnMethod.md)
- [UpdateRecoveryFlowBody](docs/UpdateRecoveryFlowBody.md)
Expand All @@ -246,13 +247,15 @@ Class | Method | HTTP request | Description
- [UpdateRegistrationFlowWithPasskeyMethod](docs/UpdateRegistrationFlowWithPasskeyMethod.md)
- [UpdateRegistrationFlowWithPasswordMethod](docs/UpdateRegistrationFlowWithPasswordMethod.md)
- [UpdateRegistrationFlowWithProfileMethod](docs/UpdateRegistrationFlowWithProfileMethod.md)
- [UpdateRegistrationFlowWithSamlMethod](docs/UpdateRegistrationFlowWithSamlMethod.md)
- [UpdateRegistrationFlowWithWebAuthnMethod](docs/UpdateRegistrationFlowWithWebAuthnMethod.md)
- [UpdateSettingsFlowBody](docs/UpdateSettingsFlowBody.md)
- [UpdateSettingsFlowWithLookupMethod](docs/UpdateSettingsFlowWithLookupMethod.md)
- [UpdateSettingsFlowWithOidcMethod](docs/UpdateSettingsFlowWithOidcMethod.md)
- [UpdateSettingsFlowWithPasskeyMethod](docs/UpdateSettingsFlowWithPasskeyMethod.md)
- [UpdateSettingsFlowWithPasswordMethod](docs/UpdateSettingsFlowWithPasswordMethod.md)
- [UpdateSettingsFlowWithProfileMethod](docs/UpdateSettingsFlowWithProfileMethod.md)
- [UpdateSettingsFlowWithSamlMethod](docs/UpdateSettingsFlowWithSamlMethod.md)
- [UpdateSettingsFlowWithTotpMethod](docs/UpdateSettingsFlowWithTotpMethod.md)
- [UpdateSettingsFlowWithWebAuthnMethod](docs/UpdateSettingsFlowWithWebAuthnMethod.md)
- [UpdateVerificationFlowBody](docs/UpdateVerificationFlowBody.md)
Expand Down
42 changes: 37 additions & 5 deletions internal/client-go/model_update_login_flow_body.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading