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

Add account linking configs #4149

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
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
50 changes: 50 additions & 0 deletions pkg/lib/config/authentication_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ var _ = Schema.Add("AuthenticationFlowSignupFlow", `
"required": ["name", "steps"],
"properties": {
"name": { "$ref": "#/$defs/AuthenticationFlowObjectName" },
"account_linking": { "$ref": "#/$defs/AuthenticationFlowAccountLinking" },
"steps": {
"type": "array",
"minItems": 1,
Expand Down Expand Up @@ -624,6 +625,55 @@ var _ = Schema.Add("AuthenticationFlowAccountRecoveryIdentification", `
}
`)

var _ = Schema.Add("AuthenticationFlowAccountLinking", `
{
"type": "object",
"required": [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omit required.

"properties": {
"oauth": {
"type": "array",
"items": { "$ref": "#/$defs/AccountLinkingOAuth" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name the schema AuthenticationFlowAccountLinkOAuthItem

}
}
}
`)

var _ = Schema.Add("AccountLinkingOAuth", `
{
"type": "object",
"required": ["alias", "oauth_claim", "user_profile", "action"],
"properties": {
"alias": { "type": "string" },
"oauth_claim": { "$ref": "#/$defs/AccountLinkingJSONPointer" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name the schema AuthenticationFlowAccountLinkingJSONPointer

"user_profile": { "$ref": "#/$defs/AccountLinkingJSONPointer" },
"action": { "$ref": "#/$defs/AccountLinkingOAuthAction" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name the schema AuthenticationFlowAccountLinkingAction

}
}
`)

var _ = Schema.Add("AccountLinkingOAuthAction", `
{
"type": "string",
"enum": [
"error",
"login_and_link"
]
}
`)

var _ = Schema.Add("AccountLinkingJSONPointer", `
{
"type": "object",
"additionalProperties": false,
"properties": {
"pointer": {
"type": "string",
"format": "json-pointer"
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "required": ["pointer"]

}
`)

type AuthenticationFlowObject interface {
IsFlowObject()
}
Expand Down