Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
dex
Commits
1608b473
Commit
1608b473
authored
3 years ago
by
Happy2C0de
Browse files
Options
Downloads
Patches
Plain Diff
Remove false failed errors.
Signed-off-by:
Happy2C0de
<
46957159+Happy2C0de@users.noreply.github.com
>
parent
2b6bb199
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
connector/oidc/oidc.go
+1
-7
1 addition, 7 deletions
connector/oidc/oidc.go
connector/oidc/oidc_test.go
+1
-1
1 addition, 1 deletion
connector/oidc/oidc_test.go
with
2 additions
and
8 deletions
connector/oidc/oidc.go
+
1
−
7
View file @
1608b473
...
@@ -299,10 +299,7 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
...
@@ -299,10 +299,7 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
preferredUsername
,
found
:=
claims
[
prefUsername
]
.
(
string
)
preferredUsername
,
found
:=
claims
[
prefUsername
]
.
(
string
)
if
(
!
found
||
c
.
overrideClaimMapping
)
&&
c
.
preferredUsernameKey
!=
""
{
if
(
!
found
||
c
.
overrideClaimMapping
)
&&
c
.
preferredUsernameKey
!=
""
{
prefUsername
=
c
.
preferredUsernameKey
prefUsername
=
c
.
preferredUsernameKey
preferredUsername
,
found
=
claims
[
prefUsername
]
.
(
string
)
preferredUsername
,
_
=
claims
[
prefUsername
]
.
(
string
)
if
!
found
{
return
identity
,
fmt
.
Errorf
(
"missing
\"
%s
\"
claim"
,
prefUsername
)
}
}
}
hasEmailScope
:=
false
hasEmailScope
:=
false
...
@@ -319,9 +316,6 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
...
@@ -319,9 +316,6 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
if
(
!
found
||
c
.
overrideClaimMapping
)
&&
c
.
emailKey
!=
""
{
if
(
!
found
||
c
.
overrideClaimMapping
)
&&
c
.
emailKey
!=
""
{
emailKey
=
c
.
emailKey
emailKey
=
c
.
emailKey
email
,
found
=
claims
[
emailKey
]
.
(
string
)
email
,
found
=
claims
[
emailKey
]
.
(
string
)
if
!
found
{
return
identity
,
fmt
.
Errorf
(
"missing
\"
%s
\"
claim"
,
emailKey
)
}
}
}
if
!
found
&&
hasEmailScope
{
if
!
found
&&
hasEmailScope
{
...
...
This diff is collapsed.
Click to expand it.
connector/oidc/oidc_test.go
+
1
−
1
View file @
1608b473
...
@@ -253,7 +253,7 @@ func TestHandleCallback(t *testing.T) {
...
@@ -253,7 +253,7 @@ func TestHandleCallback(t *testing.T) {
},
},
},
},
{
{
name
:
"customGroupsKey
But
GroupsProvidedButOverride"
,
name
:
"customGroupsKey
Despite
GroupsProvidedButOverride"
,
overrideClaimMapping
:
true
,
overrideClaimMapping
:
true
,
groupsKey
:
"cognito:groups"
,
groupsKey
:
"cognito:groups"
,
expectUserID
:
"subvalue"
,
expectUserID
:
"subvalue"
,
...
...
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