mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 08:50:42 +02:00
webauthnutil: add helpers for webauthn (#2686)
* devices: add device protobuf types * webauthnutil: add helpers for webauthn
This commit is contained in:
parent
961bc8abb4
commit
1c445c426d
13 changed files with 872 additions and 2 deletions
18
pkg/webauthnutil/enrollment_token_test.go
Normal file
18
pkg/webauthnutil/enrollment_token_test.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package webauthnutil
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestEnrollmentToken(t *testing.T) {
|
||||
key := []byte{1, 2, 3}
|
||||
deviceEnrollmentID := "19be0131-184e-4873-acab-2be79321c30b"
|
||||
token, err := NewEnrollmentToken(key, time.Second*30, deviceEnrollmentID)
|
||||
assert.NoError(t, err)
|
||||
id, err := ParseAndVerifyEnrollmentToken(key, token)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, deviceEnrollmentID, id)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue