Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
9840fccd
Commit
9840fccd
authored
Feb 04, 2019
by
James Nord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename useLoginAsId -> useLoginAsID
parent
5822a5ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
github.md
Documentation/connectors/github.md
+1
-1
github.go
connector/github/github.go
+4
-4
github_test.go
connector/github/github_test.go
+1
-1
No files found.
Documentation/connectors/github.md
View file @
9840fccd
...
...
@@ -69,7 +69,7 @@ connectors:
teamNameField
:
slug
# flag which will switch from using the internal GitHub id to the users handle (@mention) as the user id.
# It is possible for a user to change their own user name but it is very rare for them to do so
useLoginAsI
d
:
false
useLoginAsI
D
:
false
```
## GitHub Enterprise
...
...
connector/github/github.go
View file @
9840fccd
...
...
@@ -48,7 +48,7 @@ type Config struct {
RootCA
string
`json:"rootCA"`
TeamNameField
string
`json:"teamNameField"`
LoadAllGroups
bool
`json:"loadAllGroups"`
UseLoginAsI
d
bool
`json:"useLoginAsId
"`
UseLoginAsI
D
bool
`json:"useLoginAsID
"`
}
// Org holds org-team filters, in which teams are optional.
...
...
@@ -84,7 +84,7 @@ func (c *Config) Open(id string, logger logrus.FieldLogger) (connector.Connector
clientSecret
:
c
.
ClientSecret
,
apiURL
:
apiURL
,
logger
:
logger
,
useLoginAsI
d
:
c
.
UseLoginAsId
,
useLoginAsI
D
:
c
.
UseLoginAsID
,
}
if
c
.
HostName
!=
""
{
...
...
@@ -151,7 +151,7 @@ type githubConnector struct {
// if set to true and no orgs are configured then connector loads all user claims (all orgs and team)
loadAllGroups
bool
// if set to true will use the users handle rather than their numeric id as the ID
useLoginAsI
d
bool
useLoginAsI
D
bool
}
// groupsRequired returns whether dex requires GitHub's 'read:org' scope. Dex
...
...
@@ -271,7 +271,7 @@ func (c *githubConnector) HandleCallback(s connector.Scopes, r *http.Request) (i
Email
:
user
.
Email
,
EmailVerified
:
true
,
}
if
c
.
useLoginAsI
d
{
if
c
.
useLoginAsI
D
{
identity
.
UserID
=
user
.
Login
}
...
...
connector/github/github_test.go
View file @
9840fccd
...
...
@@ -192,7 +192,7 @@ func TestLoginUsedAsIDWhenConfigured(t *testing.T) {
req
,
err
:=
http
.
NewRequest
(
"GET"
,
hostURL
.
String
(),
nil
)
expectNil
(
t
,
err
)
c
:=
githubConnector
{
apiURL
:
s
.
URL
,
hostName
:
hostURL
.
Host
,
httpClient
:
newClient
(),
useLoginAsI
d
:
true
}
c
:=
githubConnector
{
apiURL
:
s
.
URL
,
hostName
:
hostURL
.
Host
,
httpClient
:
newClient
(),
useLoginAsI
D
:
true
}
identity
,
err
:=
c
.
HandleCallback
(
connector
.
Scopes
{
Groups
:
true
},
req
)
expectNil
(
t
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment