test: fix test

feat-otp-verification
James Elliott 2023-02-19 14:08:18 +11:00
parent 257bd2a25a
commit a3d7212f23
No known key found for this signature in database
GPG Key ID: 0F1C4A096E857E49
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
ALTER TABLE webauthn_devices
DROP CONSTRAINT IF EXISTS webauthn_devices_pkey;
DROP INDEX IF EXISTS webauthn_devices_pkey;
DROP INDEX IF EXISTS webauthn_devices_kid_key;
DROP INDEX IF EXISTS webauthn_devices_lookup_key;
ALTER TABLE webauthn_devices ALTER TABLE webauthn_devices
RENAME TO _bkp_UP_V0008_webauthn_devices; RENAME TO _bkp_UP_V0008_webauthn_devices;
@ -34,7 +41,7 @@ FROM _bkp_UP_V0008_webauthn_devices;
DROP TABLE IF EXISTS _bkp_UP_V0008_webauthn_devices; DROP TABLE IF EXISTS _bkp_UP_V0008_webauthn_devices;
CREATE TABLE IF NOT EXISTS webauthn_users ( CREATE TABLE IF NOT EXISTS webauthn_users (
id SERIAL CONSTRAINT webauthn_devices_pkey PRIMARY KEY, id SERIAL CONSTRAINT webauthn_users_pkey PRIMARY KEY,
rpid VARCHAR(512) NOT NULL, rpid VARCHAR(512) NOT NULL,
username VARCHAR(100) NOT NULL, username VARCHAR(100) NOT NULL,
userid CHAR(64) NOT NULL userid CHAR(64) NOT NULL

View File

@ -43,7 +43,7 @@ func (s *BackendProtectionScenario) TestProtectionOfBackendEndpoints() {
s.AssertRequestStatusCode("POST", fmt.Sprintf("%s/api/secondfactor/totp", AutheliaBaseURL), 403) s.AssertRequestStatusCode("POST", fmt.Sprintf("%s/api/secondfactor/totp", AutheliaBaseURL), 403)
s.AssertRequestStatusCode("GET", fmt.Sprintf("%s/api/secondfactor/webauthn/credentials", AutheliaBaseURL), 403) s.AssertRequestStatusCode("GET", fmt.Sprintf("%s/api/secondfactor/webauthn/credentials", AutheliaBaseURL), 403)
s.AssertRequestStatusCode("POST", fmt.Sprintf("%s/api/secondfactor/webauthn", AutheliaBaseURL), 403) s.AssertRequestStatusCode("POST", fmt.Sprintf("%s/api/secondfactor/webauthn", AutheliaBaseURL), 403)
s.AssertRequestStatusCode("GET", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/register", AutheliaBaseURL), 403) s.AssertRequestStatusCode("PUT", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/register", AutheliaBaseURL), 403)
s.AssertRequestStatusCode("POST", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/register", AutheliaBaseURL), 403) s.AssertRequestStatusCode("POST", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/register", AutheliaBaseURL), 403)
s.AssertRequestStatusCode("DELETE", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/1", AutheliaBaseURL), 403) s.AssertRequestStatusCode("DELETE", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/1", AutheliaBaseURL), 403)
s.AssertRequestStatusCode("PUT", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/1", AutheliaBaseURL), 403) s.AssertRequestStatusCode("PUT", fmt.Sprintf("%s/api/secondfactor/webauthn/credential/1", AutheliaBaseURL), 403)