-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0765273
commit 7685ddf
Showing
5 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,19 @@ vouch: | |
- [email protected] | ||
- [email protected] | ||
|
||
# regexWhiteList - (optional) allows only the listed usernames | ||
# Note: whiteList always takes precidence and disables regexWhiteList | ||
# | ||
# Single-quotes(') are to prevent the yaml parser from misinterpreting the line) | ||
# usernames are usually email addresses (google, most oidc providers) or login/username for github and github enterprise | ||
# | ||
# regexWhiteList: | ||
# - '^bob[4-9][email protected]$' | ||
# - '^alice@.+\.com$' | ||
# - '^alice@your(other)?domain\.com$' | ||
# - '^joe@yourdomain\.com$' | ||
# - '^j[aneo]{1,3}@yourdomain\.(org|net|com)$' | ||
|
||
jwt: | ||
# secret - a random string used to cryptographically sign the jwt | ||
# Vouch Proxy complains if the string is less than 44 characters (256 bits as 32 base64 bytes) | ||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
vouch: | ||
logLevel: debug | ||
domains: | ||
- example.com | ||
|
||
regexWhiteList: | ||
- 'test1?\@(domain|example)\.com' | ||
|
||
jwt: | ||
secret: testingsecret | ||
|
||
oauth: | ||
provider: indieauth | ||
client_id: http://vouch.github.io | ||
auth_url: https://indielogin.com/auth | ||
callback_url: http://vouch.github.io:9090/auth |
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 |
---|---|---|
|
@@ -143,6 +143,14 @@ func TestVerifyUserPositiveUserInWhiteList(t *testing.T) { | |
assert.Nil(t, err) | ||
} | ||
|
||
func TestVerifyUserPositiveUserInRegexWhiteList(t *testing.T) { | ||
setUp("/config/testing/handler_regexwhitelist.yml") | ||
user := &structs.User{Username: "[email protected]", Email: "[email protected]", Name: "Test Name"} | ||
ok, err := VerifyUser(*user) | ||
assert.True(t, ok) | ||
assert.Nil(t, err) | ||
} | ||
|
||
func TestVerifyUserPositiveAllowAllUsers(t *testing.T) { | ||
setUp("/config/testing/handler_allowallusers.yml") | ||
|
||
|
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