-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from eurofurence/issue-188-preps
Issue 188 preps
- Loading branch information
Showing
9 changed files
with
189 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ func tstNoToken() string { | |
|
||
const valid_JWT_is_not_staff_sub1234567890 = `eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdF9oYXNoIjoidDdWYkV5NVQ3STdYSlh3VHZ4S3hLdyIsImF1ZCI6WyIxNGQ5ZjM3YS0xZWVjLTQ3YzktYTk0OS01ZjFlYmRmOWM4ZTUiXSwiYXV0aF90aW1lIjoxNTE2MjM5MDIyLCJlbWFpbCI6ImpzcXVpc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TQ3YjctYWM1Zi0wNmI5Mjc0MzI4NDgiLCJuYW1lIjoiSm9obiBTdGFmZiIsIm5vbmNlIjoiMzBjODNjMTNjOTE3OTgwNGFhMGY5YjM5MzQyNTlkNzUiLCJyYXQiOjE2NzUxMTcxNzcsInNpZCI6ImQ3YjhmZTdhLTA3OWEtNDU5Ni04ZTUzLWE2MGY4NmEwOGFjNiIsInN1YiI6IjEyMzQ1Njc4OTAifQ.GgzYXcFQf6q6xRxRgjJx2F8CCcAV-lYZ0ZS1Legv8_uEyZcyzX27hoPBwR1w4HcEEPK-QRQCKs4qj7Jyr0GRGNcN5ZFZZzo4LOUZsmU26Hc9YNzAzc9jin783yWrF5cH2QnUxpmH9TmQGG1yekDSNn3Mn2AB-0iyUAl_vHQ8REJPT_Cilhd5l0wxAy8Ht-Lal5pcz5LDJ9mFUTpBR1B614Aq6QBdShfeWXCYje7dGVvDRfFXxpQ4kRRog9dTkMAa0MyFJ3MgF2Uv53lmq7BDbcwSYed3beIHUqe7TLkImsG8jtpGKfcOadnW8qOGr7FI4AhJi_GKJzvnepz9jrVBNg` | ||
|
@@ -21,6 +22,8 @@ const valid_JWT_is_admin_sub1234567890 = `eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.e | |
func tstValidUserToken(t *testing.T, id uint) string { | ||
if id == 101 { | ||
return valid_JWT_is_not_staff_sub101 | ||
} else if id == 102 { | ||
return valid_JWT_ev_sub102 | ||
} else { | ||
return valid_JWT_is_not_staff_sub1234567890 | ||
} | ||
|
@@ -68,6 +71,13 @@ func tstSetupAuthMockResponses() { | |
Email: "[email protected]", | ||
EmailVerified: true, | ||
}) | ||
authMock.SetupResponse(valid_JWT_ev_sub102, "access"+valid_JWT_ev_sub102, authservice.UserInfoResponse{ | ||
Audiences: []string{"14d9f37a-1eec-47c9-a949-5f1ebdf9c8e5"}, | ||
Subject: "102", | ||
Name: "John Doe", | ||
Email: "[email protected]", | ||
EmailVerified: true, | ||
}) | ||
authMock.SetupResponse(valid_JWT_is_staff_sub1234567890, "access"+valid_JWT_is_staff_sub1234567890, authservice.UserInfoResponse{ | ||
Audiences: []string{"14d9f37a-1eec-47c9-a949-5f1ebdf9c8e5"}, | ||
Subject: "1234567890", | ||
|
@@ -108,6 +118,13 @@ func tstSetupAuthMockResponses() { | |
Email: "[email protected]", | ||
EmailVerified: true, | ||
}) | ||
authMock.SetupResponse("", "access"+valid_JWT_ev_sub102, authservice.UserInfoResponse{ | ||
Audiences: []string{"14d9f37a-1eec-47c9-a949-5f1ebdf9c8e5"}, | ||
Subject: "102", | ||
Name: "John Doe", | ||
Email: "[email protected]", | ||
EmailVerified: true, | ||
}) | ||
authMock.SetupResponse("", "access"+valid_JWT_is_staff_sub1234567890, authservice.UserInfoResponse{ | ||
Audiences: []string{"14d9f37a-1eec-47c9-a949-5f1ebdf9c8e5"}, | ||
Subject: "1234567890", | ||
|
Oops, something went wrong.