Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cashier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
cashier
Commits
e1b780c4
There was a problem fetching the pipeline summary.
Commit
e1b780c4
authored
Jan 14, 2017
by
Kevin Lyda
Browse files
Options
Downloads
Patches
Plain Diff
Rename organisation to group.
parent
0ec8b5c8
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/auth/gitlab/gitlab.go
+12
-12
12 additions, 12 deletions
server/auth/gitlab/gitlab.go
with
12 additions
and
12 deletions
server/auth/gitlab/gitlab.go
+
12
−
12
View file @
e1b780c4
...
...
@@ -20,7 +20,7 @@ const (
// Gitlab account.
type
Config
struct
{
config
*
oauth2
.
Config
organisation
string
group
string
whitelist
map
[
string
]
bool
allusers
bool
}
...
...
@@ -35,8 +35,8 @@ func New(c *config.Auth) (auth.Provider, error) {
if
c
.
ProviderOpts
[
"allusers"
]
==
"true"
{
allUsers
=
true
}
if
!
allUsers
&&
c
.
ProviderOpts
[
"
organisation
"
]
==
""
&&
len
(
uw
)
==
0
{
return
nil
,
errors
.
New
(
"gitlab_opts
organisation
and the users whitelist must not be both empty if allusers isn't true"
)
if
!
allUsers
&&
c
.
ProviderOpts
[
"
group
"
]
==
""
&&
len
(
uw
)
==
0
{
return
nil
,
errors
.
New
(
"gitlab_opts
group
and the users whitelist must not be both empty if allusers isn't true"
)
}
if
c
.
ProviderOpts
[
"authurl"
]
==
""
||
c
.
ProviderOpts
[
"tokenurl"
]
==
""
{
return
nil
,
errors
.
New
(
"gitlab_opts authurl and tokenurl must be set"
)
...
...
@@ -54,7 +54,7 @@ func New(c *config.Auth) (auth.Provider, error) {
"api"
,
},
},
organisation
:
c
.
ProviderOpts
[
"
organisation
"
],
group
:
c
.
ProviderOpts
[
"
group
"
],
whitelist
:
uw
,
allusers
:
allUsers
,
},
nil
...
...
@@ -81,8 +81,8 @@ func (c *Config) Valid(token *oauth2.Token) bool {
if
!
token
.
Valid
()
{
return
false
}
if
c
.
organisation
==
""
{
// There's no
organisation
and token is valid. Can only reach
if
c
.
group
==
""
{
// There's no
group
and token is valid. Can only reach
// here if user whitelist is set and user is in whitelist.
return
true
}
...
...
@@ -92,7 +92,7 @@ func (c *Config) Valid(token *oauth2.Token) bool {
return
false
}
for
_
,
g
:=
range
groups
{
if
g
.
Name
==
c
.
organisation
{
if
g
.
Name
==
c
.
group
{
return
true
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment