Skip to content

Commit ec3ecc5

Browse files
authored
fix: apply strategy filters in identifier first as well (#4352)
1 parent 9a6dadf commit ec3ecc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2967
-124
lines changed

.schema/openapi/patches/selfservice.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
value:
1717
- "$ref": "#/components/schemas/updateRegistrationFlowWithPasswordMethod"
1818
- "$ref": "#/components/schemas/updateRegistrationFlowWithOidcMethod"
19+
- "$ref": "#/components/schemas/updateRegistrationFlowWithSamlMethod"
1920
- "$ref": "#/components/schemas/updateRegistrationFlowWithWebAuthnMethod"
2021
- "$ref": "#/components/schemas/updateRegistrationFlowWithCodeMethod"
2122
- "$ref": "#/components/schemas/updateRegistrationFlowWithPasskeyMethod"
@@ -27,7 +28,7 @@
2728
mapping:
2829
password: "#/components/schemas/updateRegistrationFlowWithPasswordMethod"
2930
oidc: "#/components/schemas/updateRegistrationFlowWithOidcMethod"
30-
saml: "#/components/schemas/updateRegistrationFlowWithOidcMethod"
31+
saml: "#/components/schemas/updateRegistrationFlowWithSamlMethod"
3132
webauthn: "#/components/schemas/updateRegistrationFlowWithWebAuthnMethod"
3233
code: "#/components/schemas/updateRegistrationFlowWithCodeMethod"
3334
passkey: "#/components/schemas/updateRegistrationFlowWithPasskeyMethod"
@@ -52,6 +53,7 @@
5253
value:
5354
- "$ref": "#/components/schemas/updateLoginFlowWithPasswordMethod"
5455
- "$ref": "#/components/schemas/updateLoginFlowWithOidcMethod"
56+
- "$ref": "#/components/schemas/updateLoginFlowWithSamlMethod"
5557
- "$ref": "#/components/schemas/updateLoginFlowWithTotpMethod"
5658
- "$ref": "#/components/schemas/updateLoginFlowWithWebAuthnMethod"
5759
- "$ref": "#/components/schemas/updateLoginFlowWithLookupSecretMethod"
@@ -65,7 +67,7 @@
6567
mapping:
6668
password: "#/components/schemas/updateLoginFlowWithPasswordMethod"
6769
oidc: "#/components/schemas/updateLoginFlowWithOidcMethod"
68-
saml: "#/components/schemas/updateLoginFlowWithOidcMethod"
70+
saml: "#/components/schemas/updateLoginFlowWithSamlMethod"
6971
totp: "#/components/schemas/updateLoginFlowWithTotpMethod"
7072
webauthn: "#/components/schemas/updateLoginFlowWithWebAuthnMethod"
7173
lookup_secret: "#/components/schemas/updateLoginFlowWithLookupSecretMethod"
@@ -147,6 +149,7 @@
147149
- "$ref": "#/components/schemas/updateSettingsFlowWithPasswordMethod"
148150
- "$ref": "#/components/schemas/updateSettingsFlowWithProfileMethod"
149151
- "$ref": "#/components/schemas/updateSettingsFlowWithOidcMethod"
152+
- "$ref": "#/components/schemas/updateSettingsFlowWithSamlMethod"
150153
- "$ref": "#/components/schemas/updateSettingsFlowWithTotpMethod"
151154
- "$ref": "#/components/schemas/updateSettingsFlowWithWebAuthnMethod"
152155
- "$ref": "#/components/schemas/updateSettingsFlowWithLookupMethod"
@@ -159,7 +162,7 @@
159162
password: "#/components/schemas/updateSettingsFlowWithPasswordMethod"
160163
profile: "#/components/schemas/updateSettingsFlowWithProfileMethod"
161164
oidc: "#/components/schemas/updateSettingsFlowWithOidcMethod"
162-
saml: "#/components/schemas/updateSettingsFlowWithOidcMethod"
165+
saml: "#/components/schemas/updateSettingsFlowWithSamlMethod"
163166
totp: "#/components/schemas/updateSettingsFlowWithTotpMethod"
164167
webauthn: "#/components/schemas/updateSettingsFlowWithWebAuthnMethod"
165168
passkey: "#/components/schemas/updateSettingsFlowWithPasskeyMethod"

driver/config/testhelpers/config.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ import (
1818
type (
1919
TestConfigProvider struct {
2020
contextx.Contextualizer
21-
Options []configx.OptionModifier
21+
Options []configx.OptionModifier
22+
ConfigSchema []byte
2223
}
2324
contextKey int
2425
)
2526

2627
func (t *TestConfigProvider) NewProvider(ctx context.Context, opts ...configx.OptionModifier) (*configx.Provider, error) {
27-
return configx.New(ctx, []byte(embedx.ConfigSchema), append(t.Options, opts...)...)
28+
schema := []byte(embedx.ConfigSchema)
29+
if len(t.ConfigSchema) > 0 {
30+
schema = t.ConfigSchema
31+
}
32+
return configx.New(ctx, schema, append(t.Options, opts...)...)
2833
}
2934

3035
func (t *TestConfigProvider) Config(ctx context.Context, config *configx.Provider) *configx.Provider {

identity/credentials_oidc.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ func (c *CredentialsOIDCEncryptedTokens) GetIDToken() string {
6363

6464
// NewCredentialsOIDC creates a new OIDC credential.
6565
func NewCredentialsOIDC(tokens *CredentialsOIDCEncryptedTokens, provider, subject, organization string) (*Credentials, error) {
66+
return NewOIDCLikeCredentials(tokens, CredentialsTypeOIDC, provider, subject, organization)
67+
}
68+
69+
// NewOIDCLikeCredentials creates a new OIDC-like credential.
70+
func NewOIDCLikeCredentials(tokens *CredentialsOIDCEncryptedTokens, t CredentialsType, provider, subject, organization string) (*Credentials, error) {
6671
if provider == "" {
6772
return nil, errors.New("received empty provider in oidc credentials")
6873
}
@@ -89,7 +94,7 @@ func NewCredentialsOIDC(tokens *CredentialsOIDCEncryptedTokens, provider, subjec
8994
}
9095

9196
return &Credentials{
92-
Type: CredentialsTypeOIDC,
97+
Type: t,
9398
Identifiers: []string{OIDCUniqueID(provider, subject)},
9499
Config: b.Bytes(),
95100
}, nil

internal/client-go/.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ docs/UpdateLoginFlowWithLookupSecretMethod.md
113113
docs/UpdateLoginFlowWithOidcMethod.md
114114
docs/UpdateLoginFlowWithPasskeyMethod.md
115115
docs/UpdateLoginFlowWithPasswordMethod.md
116+
docs/UpdateLoginFlowWithSamlMethod.md
116117
docs/UpdateLoginFlowWithTotpMethod.md
117118
docs/UpdateLoginFlowWithWebAuthnMethod.md
118119
docs/UpdateRecoveryFlowBody.md
@@ -124,13 +125,15 @@ docs/UpdateRegistrationFlowWithOidcMethod.md
124125
docs/UpdateRegistrationFlowWithPasskeyMethod.md
125126
docs/UpdateRegistrationFlowWithPasswordMethod.md
126127
docs/UpdateRegistrationFlowWithProfileMethod.md
128+
docs/UpdateRegistrationFlowWithSamlMethod.md
127129
docs/UpdateRegistrationFlowWithWebAuthnMethod.md
128130
docs/UpdateSettingsFlowBody.md
129131
docs/UpdateSettingsFlowWithLookupMethod.md
130132
docs/UpdateSettingsFlowWithOidcMethod.md
131133
docs/UpdateSettingsFlowWithPasskeyMethod.md
132134
docs/UpdateSettingsFlowWithPasswordMethod.md
133135
docs/UpdateSettingsFlowWithProfileMethod.md
136+
docs/UpdateSettingsFlowWithSamlMethod.md
134137
docs/UpdateSettingsFlowWithTotpMethod.md
135138
docs/UpdateSettingsFlowWithWebAuthnMethod.md
136139
docs/UpdateVerificationFlowBody.md
@@ -243,6 +246,7 @@ model_update_login_flow_with_lookup_secret_method.go
243246
model_update_login_flow_with_oidc_method.go
244247
model_update_login_flow_with_passkey_method.go
245248
model_update_login_flow_with_password_method.go
249+
model_update_login_flow_with_saml_method.go
246250
model_update_login_flow_with_totp_method.go
247251
model_update_login_flow_with_web_authn_method.go
248252
model_update_recovery_flow_body.go
@@ -254,13 +258,15 @@ model_update_registration_flow_with_oidc_method.go
254258
model_update_registration_flow_with_passkey_method.go
255259
model_update_registration_flow_with_password_method.go
256260
model_update_registration_flow_with_profile_method.go
261+
model_update_registration_flow_with_saml_method.go
257262
model_update_registration_flow_with_web_authn_method.go
258263
model_update_settings_flow_body.go
259264
model_update_settings_flow_with_lookup_method.go
260265
model_update_settings_flow_with_oidc_method.go
261266
model_update_settings_flow_with_passkey_method.go
262267
model_update_settings_flow_with_password_method.go
263268
model_update_settings_flow_with_profile_method.go
269+
model_update_settings_flow_with_saml_method.go
264270
model_update_settings_flow_with_totp_method.go
265271
model_update_settings_flow_with_web_authn_method.go
266272
model_update_verification_flow_body.go

internal/client-go/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ Class | Method | HTTP request | Description
238238
- [UpdateLoginFlowWithOidcMethod](docs/UpdateLoginFlowWithOidcMethod.md)
239239
- [UpdateLoginFlowWithPasskeyMethod](docs/UpdateLoginFlowWithPasskeyMethod.md)
240240
- [UpdateLoginFlowWithPasswordMethod](docs/UpdateLoginFlowWithPasswordMethod.md)
241+
- [UpdateLoginFlowWithSamlMethod](docs/UpdateLoginFlowWithSamlMethod.md)
241242
- [UpdateLoginFlowWithTotpMethod](docs/UpdateLoginFlowWithTotpMethod.md)
242243
- [UpdateLoginFlowWithWebAuthnMethod](docs/UpdateLoginFlowWithWebAuthnMethod.md)
243244
- [UpdateRecoveryFlowBody](docs/UpdateRecoveryFlowBody.md)
@@ -249,13 +250,15 @@ Class | Method | HTTP request | Description
249250
- [UpdateRegistrationFlowWithPasskeyMethod](docs/UpdateRegistrationFlowWithPasskeyMethod.md)
250251
- [UpdateRegistrationFlowWithPasswordMethod](docs/UpdateRegistrationFlowWithPasswordMethod.md)
251252
- [UpdateRegistrationFlowWithProfileMethod](docs/UpdateRegistrationFlowWithProfileMethod.md)
253+
- [UpdateRegistrationFlowWithSamlMethod](docs/UpdateRegistrationFlowWithSamlMethod.md)
252254
- [UpdateRegistrationFlowWithWebAuthnMethod](docs/UpdateRegistrationFlowWithWebAuthnMethod.md)
253255
- [UpdateSettingsFlowBody](docs/UpdateSettingsFlowBody.md)
254256
- [UpdateSettingsFlowWithLookupMethod](docs/UpdateSettingsFlowWithLookupMethod.md)
255257
- [UpdateSettingsFlowWithOidcMethod](docs/UpdateSettingsFlowWithOidcMethod.md)
256258
- [UpdateSettingsFlowWithPasskeyMethod](docs/UpdateSettingsFlowWithPasskeyMethod.md)
257259
- [UpdateSettingsFlowWithPasswordMethod](docs/UpdateSettingsFlowWithPasswordMethod.md)
258260
- [UpdateSettingsFlowWithProfileMethod](docs/UpdateSettingsFlowWithProfileMethod.md)
261+
- [UpdateSettingsFlowWithSamlMethod](docs/UpdateSettingsFlowWithSamlMethod.md)
259262
- [UpdateSettingsFlowWithTotpMethod](docs/UpdateSettingsFlowWithTotpMethod.md)
260263
- [UpdateSettingsFlowWithWebAuthnMethod](docs/UpdateSettingsFlowWithWebAuthnMethod.md)
261264
- [UpdateVerificationFlowBody](docs/UpdateVerificationFlowBody.md)

internal/client-go/model_update_login_flow_body.go

Lines changed: 37 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)