Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-elliott committed Feb 18, 2022
1 parent 6fdbfef commit ada74b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion protocol/credential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package protocol
import (
"bytes"
"encoding/base64"
"github.com/duo-labs/webauthn/protocol/webauthncbor"
"io/ioutil"
"net/http"
"reflect"
"testing"

"github.com/duo-labs/webauthn/protocol/webauthncbor"
)

func TestParseCredentialCreationResponse(t *testing.T) {
Expand Down Expand Up @@ -43,6 +44,7 @@ func TestParseCredentialCreationResponse(t *testing.T) {
},
RawID: byteID,
},
Transports: []AuthenticatorTransport{USB, NFC},
Response: ParsedAttestationResponse{
CollectedClientData: CollectedClientData{
Type: CeremonyType("webauthn.create"),
Expand Down Expand Up @@ -78,6 +80,7 @@ func TestParseCredentialCreationResponse(t *testing.T) {
},
AttestationObject: byteAttObject,
},
Transports: []string{"usb", "nfc"},
},
},
wantErr: false,
Expand Down Expand Up @@ -235,6 +238,7 @@ var testCredentialRequestBody = `{
"id":"6xrtBhJQW6QU4tOaB4rrHaS2Ks0yDDL_q8jDC16DEjZ-VLVf4kCRkvl2xp2D71sTPYns-exsHQHTy3G-zJRK8g",
"rawId":"6xrtBhJQW6QU4tOaB4rrHaS2Ks0yDDL_q8jDC16DEjZ-VLVf4kCRkvl2xp2D71sTPYns-exsHQHTy3G-zJRK8g",
"type":"public-key",
"transports":["usb","nfc"],
"response":{
"attestationObject":"o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YVjEdKbqkhPJnC90siSSsyDPQCYqlMGpUKA5fyklC2CEHvBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAQOsa7QYSUFukFOLTmgeK6x2ktirNMgwy_6vIwwtegxI2flS1X-JAkZL5dsadg-9bEz2J7PnsbB0B08txvsyUSvKlAQIDJiABIVggLKF5xS0_BntttUIrm2Z2tgZ4uQDwllbdIfrrBMABCNciWCDHwin8Zdkr56iSIh0MrB5qZiEzYLQpEOREhMUkY6q4Vw",
"clientDataJSON":"eyJjaGFsbGVuZ2UiOiJXOEd6RlU4cEdqaG9SYldyTERsYW1BZnFfeTRTMUNaRzFWdW9lUkxBUnJFIiwib3JpZ2luIjoiaHR0cHM6Ly93ZWJhdXRobi5pbyIsInR5cGUiOiJ3ZWJhdXRobi5jcmVhdGUifQ"
Expand Down

0 comments on commit ada74b6

Please sign in to comment.