This repository was archived by the owner on Jan 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[RDY] google: Support restricting access to a specific group(s) #139
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
github.com/BurntSushi/toml 3883ac1ce943878302255f538fce319d23226223 | ||
github.com/bitly/go-simplejson 3378bdcb5cebedcbf8b5750edee28010f128fe24 | ||
github.com/mreiferson/go-options ee94b57f2fbf116075426f853e5abbcdfeca8b3d | ||
github.com/bmizerany/assert e17e99893cb6509f428e1728281c2ad60a6b31e3 | ||
gopkg.in/fsnotify.v1 v1.2.0 | ||
github.com/BurntSushi/toml 3883ac1ce943878302255f538fce319d23226223 | ||
github.com/bitly/go-simplejson 3378bdcb5cebedcbf8b5750edee28010f128fe24 | ||
github.com/mreiferson/go-options ee94b57f2fbf116075426f853e5abbcdfeca8b3d | ||
github.com/bmizerany/assert e17e99893cb6509f428e1728281c2ad60a6b31e3 | ||
gopkg.in/fsnotify.v1 v1.2.0 | ||
golang.org/x/oauth2 397fe7649477ff2e8ced8fc0b2696f781e53745a | ||
golang.org/x/oauth2/google 397fe7649477ff2e8ced8fc0b2696f781e53745a | ||
google.golang.org/api/admin/directory/v1 a5c3e2a4792aff40e59840d9ecdff0542a202a80 |
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 |
---|---|---|
|
@@ -40,6 +40,32 @@ func TestNewOptions(t *testing.T) { | |
assert.Equal(t, expected, err.Error()) | ||
} | ||
|
||
func TestGoogleGroupOptions(t *testing.T) { | ||
o := testOptions() | ||
o.GoogleGroups = []string{"googlegroup"} | ||
err := o.Validate() | ||
assert.NotEqual(t, nil, err) | ||
|
||
expected := errorMsg([]string{ | ||
"missing setting: google-admin-email", | ||
"missing setting: google-service-account-json"}) | ||
assert.Equal(t, expected, err.Error()) | ||
} | ||
|
||
func TestGoogleGroupInvalidFile(t *testing.T) { | ||
o := testOptions() | ||
o.GoogleGroups = []string{"test_group"} | ||
o.GoogleAdminEmail = "[email protected]" | ||
o.GoogleServiceAccountJSON = "file_doesnt_exist.json" | ||
err := o.Validate() | ||
assert.NotEqual(t, nil, err) | ||
|
||
expected := errorMsg([]string{ | ||
"invalid Google credentials file: file_doesnt_exist.json", | ||
}) | ||
assert.Equal(t, expected, err.Error()) | ||
} | ||
|
||
func TestInitializedOptions(t *testing.T) { | ||
o := testOptions() | ||
assert.Equal(t, nil, o.Validate()) | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jburnham can you capture these dependencies in the Godeps file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jehiah Added