Skip to content

Commit

Permalink
feat(webauthn): add new decoder schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 7, 2022
1 parent 97c8c9e commit c3e1501
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
22 changes: 21 additions & 1 deletion selfservice/strategy/webauthn/.schema/login.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@
},
"webauthn_login": {
"type": "string"
},
"method": {
"type": "string"
},
"identifier": {
"type": "string",
"minLength": 1
}
},
"oneOf": [
{
"required": [
"webauthn_login"
]
},
{
"required": [
"identifier",
"method"
]
}
}
]
}
35 changes: 35 additions & 0 deletions selfservice/strategy/webauthn/.schema/registration.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$id": "https://schemas.ory.sh/kratos/selfservice/strategy/password/registration.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"csrf_token": {
"type": "string"
},
"traits": {
"description": "This field will be overwritten in registration.go's decoder() method. Do not add anything to this field as it has no effect."
},
"method": {
"type": "string"
},
"webauthn_register": {
"type": "string"
},
"webauthn_register_displayname": {
"type": "string"
}
},
"oneOf": [
{
"required": [
"webauthn_register"
]
},
{
"required": [
"identifier",
"method"
]
}
]
}
3 changes: 3 additions & 0 deletions selfservice/strategy/webauthn/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ var loginSchema []byte

//go:embed .schema/settings.schema.json
var settingsSchema []byte

//go:embed .schema/registration.schema.json
var registrationSchema []byte

0 comments on commit c3e1501

Please sign in to comment.