diff --git a/Documentation/connectors/github.md b/Documentation/connectors/github.md index b669e25e..f9395283 100644 --- a/Documentation/connectors/github.md +++ b/Documentation/connectors/github.md @@ -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 - useLoginAsId: false + useLoginAsID: false ``` ## GitHub Enterprise diff --git a/connector/github/github.go b/connector/github/github.go index 9d900414..13a00f52 100644 --- a/connector/github/github.go +++ b/connector/github/github.go @@ -48,7 +48,7 @@ type Config struct { RootCA string `json:"rootCA"` TeamNameField string `json:"teamNameField"` LoadAllGroups bool `json:"loadAllGroups"` - UseLoginAsId bool `json:"useLoginAsId"` + UseLoginAsID 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, - useLoginAsId: c.UseLoginAsId, + useLoginAsID: 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 - useLoginAsId bool + useLoginAsID 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.useLoginAsId { + if c.useLoginAsID { identity.UserID = user.Login } diff --git a/connector/github/github_test.go b/connector/github/github_test.go index 2ce085dc..539a2e69 100644 --- a/connector/github/github_test.go +++ b/connector/github/github_test.go @@ -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(), useLoginAsId: true} + c := githubConnector{apiURL: s.URL, hostName: hostURL.Host, httpClient: newClient(), useLoginAsID: true} identity, err := c.HandleCallback(connector.Scopes{Groups: true}, req) expectNil(t, err)