This commit is contained in:
@@ -231,11 +231,25 @@ func TestConfigurationAndEntropyFailures(t *testing.T) {
|
||||
{RPID: "tend.gamertan.com", RPDisplayName: "Tend", Origin: "http://tend.gamertan.com"},
|
||||
{RPID: "tend.gamertan.com", RPDisplayName: "Tend", Origin: "https://other.gamertan.com"},
|
||||
{RPID: "tend.gamertan.com", RPDisplayName: "Tend", Origin: "https://tend.gamertan.com/path"},
|
||||
{RPID: "localhost", RPDisplayName: "Tend", Origin: "https://localhost:8443"},
|
||||
{RPID: "tend.gamertan.com", RPDisplayName: "Tend", Origin: "https://tend.gamertan.com:8443", AllowDevelopmentPort: true},
|
||||
{RPID: "localhost", RPDisplayName: "Tend", Origin: "https://localhost:443", AllowDevelopmentPort: true},
|
||||
{RPID: "localhost", RPDisplayName: "Tend", Origin: "https://localhost:08443", AllowDevelopmentPort: true},
|
||||
{RPID: "localhost", RPDisplayName: "Tend", Origin: "https://localhost:0", AllowDevelopmentPort: true},
|
||||
} {
|
||||
if _, err = authwebauthn.New(store, authService, config); err == nil {
|
||||
t.Fatalf("accepted config=%+v", config)
|
||||
}
|
||||
}
|
||||
for _, config := range []authwebauthn.Config{
|
||||
{RPID: "localhost", RPDisplayName: "Tend Local", Origin: "https://localhost:8443", AllowDevelopmentPort: true},
|
||||
{RPID: "tend.test", RPDisplayName: "Tend Local", Origin: "https://tend.test:8443", AllowDevelopmentPort: true},
|
||||
} {
|
||||
configured, configureErr := authwebauthn.New(store, authService, config)
|
||||
if configureErr != nil || configured == nil {
|
||||
t.Fatalf("development config=%+v service=%v err=%v", config, configured, configureErr)
|
||||
}
|
||||
}
|
||||
service, err := authwebauthn.New(store, authService, authwebauthn.Config{RPID: "tend.gamertan.com", RPDisplayName: "Tend", Origin: "https://tend.gamertan.com", Random: failingReader{}})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user