Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenID-Connect-Java-Spring-Server
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
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
Perun
Perun ProxyIdP
v1
OpenID-Connect-Java-Spring-Server
Commits
5d2750d5
Verified
Commit
5d2750d5
authored
1 year ago
by
Dominik Frantisek Bucik
Browse files
Options
Downloads
Patches
Plain Diff
fix:
claim modifiers in arrays retain only unique values
parent
79d3865b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!397
fix: 🐛 claim modifiers in arrays retain only unique values
Pipeline
#444674
passed
1 year ago
Stage: .pre
Stage: build
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
perun-oidc-server/src/main/java/cz/muni/ics/oidc/server/userInfo/PerunUserInfoCacheLoader.java
+7
-3
7 additions, 3 deletions
...ni/ics/oidc/server/userInfo/PerunUserInfoCacheLoader.java
with
7 additions
and
3 deletions
perun-oidc-server/src/main/java/cz/muni/ics/oidc/server/userInfo/PerunUserInfoCacheLoader.java
+
7
−
3
View file @
5d2750d5
...
...
@@ -303,18 +303,22 @@ public class PerunUserInfoCacheLoader extends CacheLoader<UserInfoCacheKey, User
return
TextNode
.
valueOf
(
modifier
.
modify
(
claimInJson
.
asText
()));
}
else
if
(
claimInJson
.
isArray
())
{
ArrayNode
arrayNode
=
(
ArrayNode
)
claimInJson
;
ArrayNode
newArrayNode
=
JsonNodeFactory
.
instance
.
arrayNode
();
Set
<
TextNode
>
uniqueValues
=
new
HashSet
<>
();
for
(
int
i
=
0
;
i
<
arrayNode
.
size
();
i
++)
{
JsonNode
item
=
arrayNode
.
get
(
i
);
if
(
item
.
isTextual
())
{
String
original
=
item
.
asText
();
String
modified
=
modifier
.
modify
(
original
);
if
(!
modifier
.
isReplaceOldValue
())
{
newArrayNode
.
add
(
TextNode
.
valueOf
(
original
));
uniqueValues
.
add
(
TextNode
.
valueOf
(
original
));
}
newArrayNode
.
add
(
TextNode
.
valueOf
(
modified
));
uniqueValues
.
add
(
TextNode
.
valueOf
(
modified
));
}
}
ArrayNode
newArrayNode
=
JsonNodeFactory
.
instance
.
arrayNode
();
for
(
TextNode
child
:
uniqueValues
)
{
newArrayNode
.
add
(
child
);
}
return
newArrayNode
;
}
else
{
log
.
warn
(
"Original value is neither string nor array of strings - cannot modify values"
);
...
...
This diff is collapsed.
Click to expand it.
Perun-GitLab Service Account
@9045464
mentioned in commit
948b33a3
·
1 year ago
mentioned in commit
948b33a3
mentioned in commit 948b33a3a2131f98b160165e70fecfaa6343d4a1
Toggle commit list
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