Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize by GitHub org and or team membership #205

Merged
merged 21 commits into from
Mar 12, 2020
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5507bd6
Check GitHub user team memberships and store them in User struct
eikehartmann Jan 23, 2020
7b0f0a3
Evaluate team memberships when verifying user
eikehartmann Jan 31, 2020
0b99ff8
Remover Org from config and use <orgId>/<teamSlug> as format for gith…
eikehartmann Jan 31, 2020
fd72962
Add test assertions on urls called
eikehartmann Jan 31, 2020
4ad1f13
Add org membership url to config and github defaults
eikehartmann Jan 31, 2020
4a9d20a
Add method to check for github org membership
eikehartmann Jan 31, 2020
6ad9c84
Check for GitHub Org membership if no team qualified in TeamWhiteList…
eikehartmann Jan 31, 2020
227cd5b
Add documentation for teamWhitelist to github example config
eikehartmann Feb 3, 2020
fd1019a
Move Github-related handler stuff to own package
eikehartmann Feb 9, 2020
cfb5be2
Move IndieAuth-related handler stuff to own package
eikehartmann Feb 9, 2020
82f7c18
Move ADFS-related handler stuff to own package
eikehartmann Feb 9, 2020
eacccd5
Move HomeAssistant-related handler stuff to own package
eikehartmann Feb 9, 2020
d367704
Move OpenStax-related handler stuff to own package
eikehartmann Feb 9, 2020
2b6659d
Move Google-related handler stuff to own package
eikehartmann Feb 9, 2020
fb73f16
Move OpenID-related handler stuff to own package
eikehartmann Feb 9, 2020
02dd4da
Refactor to common parameters for different vendor methods
eikehartmann Feb 9, 2020
1244cbd
Use strategy pattern-like switch to select vendor-specific handler
eikehartmann Feb 9, 2020
6e05f94
Add org/team configuration relevant urls to github enterprise sample …
eikehartmann Feb 9, 2020
785ec9f
Add read:org scope if team whitelist is configured for github
eikehartmann Feb 10, 2020
e26ea0c
Improve logging and error handling in github org/team membership retr…
eikehartmann Feb 10, 2020
35dbe19
remove port before testing host
bnfinet Mar 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/domains/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ func Refresh() {
// TODO return all matches
// Matches return the first match of the
func Matches(s string) string {
if strings.Contains(s, ":") {
// then we have a port and we just want to check the host
split := strings.Split(s, ":")
log.Debugf("removing port from %s to test domain %s", s, split[0])
s = split[0]
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

for i, v := range domains {
if s == v || strings.HasSuffix(s, "." + v) {
if s == v || strings.HasSuffix(s, "."+v) {
log.Debugf("domain %s matched array value at [%d]=%v", s, i, v)
return v
}
Expand Down