@@ -15,8 +15,8 @@ import (
1515
1616 "github.com/aws/aws-sdk-go/aws"
1717 "github.com/aws/aws-sdk-go/service/dynamodb"
18- "github.com/duo-labs /webauthn/protocol"
19- "github.com/duo-labs /webauthn/webauthn"
18+ "github.com/go-webauthn /webauthn/protocol"
19+ "github.com/go-webauthn /webauthn/webauthn"
2020 "github.com/gorilla/mux"
2121 "github.com/stretchr/testify/require"
2222
@@ -35,7 +35,7 @@ const (
3535 testRpId = "dKbqkhPJnC90siSSsyDPQCYqlMGpUKA5fyklC2CEHvA"
3636
3737 AssertionTypeFido = "fido-u2f"
38- testRpOrigin = "localhost "
38+ testRpOrigin = "https://example.com "
3939)
4040
4141func getTestAssertionResponse (credID , authData , clientData , attestationObject string ) []byte {
@@ -52,7 +52,6 @@ func getTestAssertionResponse(credID, authData, clientData, attestationObject st
5252}
5353
5454func getTestAssertionRequest (credID1 , authData1 , clientData1 , attestObject1 string , user * DynamoUser ) * http.Request {
55-
5655 assertResp := getTestAssertionResponse (credID1 , authData1 , clientData1 , attestObject1 )
5756
5857 body := ioutil .NopCloser (bytes .NewReader (assertResp ))
@@ -138,6 +137,7 @@ func (ms *MfaSuite) Test_BeginRegistration() {
138137 RPDisplayName : "TestRPName" , // Display Name for your site
139138 RPID : "111.11.11.11" , // Generally the FQDN for your site
140139 Debug : true ,
140+ RPOrigins : []string {testRpOrigin },
141141 })
142142
143143 ms .NoError (err , "failed creating new webAuthnClient for test" )
@@ -429,6 +429,7 @@ func (ms *MfaSuite) Test_BeginLogin() {
429429 RPDisplayName : "TestRPName" , // Display Name for your site
430430 RPID : "111.11.11.11" , // Generally the FQDN for your site
431431 Debug : true ,
432+ RPOrigins : []string {testRpOrigin },
432433 })
433434
434435 ms .NoError (err , "failed creating new webAuthnClient for test" )
@@ -629,7 +630,7 @@ func (ms *MfaSuite) Test_FinishLogin() {
629630
630631 signature1 := GenerateAuthenticationSig (authDataBytes1 , cdBytes , privateKey1 )
631632
632- var assertionResponse1 = `{
633+ assertionResponse1 : = `{
633634 "id":"` + credIDEncoded1 + `",
634635 "rawId":"` + credIDEncoded1 + `",
635636 "type":"public-key",
@@ -651,7 +652,7 @@ func (ms *MfaSuite) Test_FinishLogin() {
651652
652653 signature2 := GenerateAuthenticationSig (authDataBytes2 , cdBytes , privateKey1 )
653654
654- var assertionResponse2 = `{
655+ assertionResponse2 : = `{
655656 "id":"` + credIDEncoded2 + `",
656657 "rawId":"` + credIDEncoded2 + `",
657658 "type":"public-key",
@@ -768,7 +769,6 @@ func Test_GetPublicKeyAsBytes(t *testing.T) {
768769 want := []byte {4 , 6 , 214 , 26 , 66 , 24 , 173 , 50 , 249 , 174 , 188 , 167 , 158 , 81 , 153 , 174 , 135 , 222 , 147 , 153 , 116 , 209 , 27 , 16 , 127 , 233 , 183 , 236 , 149 , 105 , 147 , 84 , 94 , 138 , 214 , 31 , 142 , 253 , 63 , 17 , 232 , 200 , 228 , 33 , 96 , 172 , 95 , 227 , 235 , 203 , 196 , 73 , 134 , 227 , 177 , 108 , 60 , 40 , 190 , 118 , 9 , 6 , 237 , 18 , 103 }
769770
770771 assert .Equal (want , got , "incorrect public Key" )
771-
772772}
773773
774774func Router () * mux.Router {
@@ -802,7 +802,6 @@ func testAuthnMiddleware(next http.Handler) http.Handler {
802802}
803803
804804func (ms * MfaSuite ) Test_DeleteCredential () {
805-
806805 baseConfigs := getDBConfig (ms )
807806
808807 users := getTestWebauthnUsers (ms , baseConfigs )
@@ -876,7 +875,6 @@ func (ms *MfaSuite) Test_DeleteCredential() {
876875 }
877876 for _ , tt := range tests {
878877 ms .T ().Run (tt .name , func (t * testing.T ) {
879-
880878 request , _ := http .NewRequest ("DELETE" , fmt .Sprintf ("/webauthn/credential/%s" , tt .credID ), nil )
881879
882880 request .Header .Set ("x-mfa-apikey" , tt .user .ApiKeyValue )
0 commit comments