mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-07 20:08:17 +02:00
webauthn: only return known device credentials that match the given type
This commit is contained in:
parent
f2a5bda162
commit
b966264cfd
2 changed files with 9 additions and 2 deletions
|
@ -81,9 +81,12 @@ func TestGenerateRequestOptions(t *testing.T) {
|
|||
t.Run(DefaultDeviceType, func(t *testing.T) {
|
||||
key := []byte{1, 2, 3}
|
||||
options := GenerateRequestOptions(r, key, predefinedDeviceTypes[DefaultDeviceType], []*device.Credential{
|
||||
{Id: "device1", Specifier: &device.Credential_Webauthn{Webauthn: &device.Credential_WebAuthn{
|
||||
{Id: "device1", TypeId: DefaultDeviceType, Specifier: &device.Credential_Webauthn{Webauthn: &device.Credential_WebAuthn{
|
||||
Id: []byte{4, 5, 6},
|
||||
}}},
|
||||
{Id: "device2", TypeId: "some-other-type", Specifier: &device.Credential_Webauthn{Webauthn: &device.Credential_WebAuthn{
|
||||
Id: []byte{7, 8, 9},
|
||||
}}},
|
||||
})
|
||||
options.Challenge = nil
|
||||
assert.Equal(t, &webauthn.PublicKeyCredentialRequestOptions{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue