Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-file-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
VOSpace INAF
vospace-file-service
Commits
3bc5b084
Commit
3bc5b084
authored
3 years ago
by
Sonia Zorba
Browse files
Options
Downloads
Patches
Plain Diff
Added URL encoding to group name in isMemberOf call
parent
f7a174e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#1223
passed
3 years ago
Stage: test
Stage: dockerize
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/it/inaf/ia2/transfer/auth/GmsClient.java
+10
-2
10 additions, 2 deletions
src/main/java/it/inaf/ia2/transfer/auth/GmsClient.java
with
10 additions
and
2 deletions
src/main/java/it/inaf/ia2/transfer/auth/GmsClient.java
+
10
−
2
View file @
3bc5b084
package
it.inaf.ia2.transfer.auth
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Collections
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cache.annotation.Cacheable
;
...
...
@@ -14,9 +18,11 @@ import org.springframework.web.client.RestTemplate;
@Component
public
class
GmsClient
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
GmsClient
.
class
);
@Value
(
"${gms_base_url}"
)
private
String
gmsBaseUrl
;
private
final
RestTemplate
restTemplate
;
@Autowired
...
...
@@ -27,7 +33,9 @@ public class GmsClient {
@Cacheable
(
"gms_cache"
)
public
boolean
isMemberOf
(
String
token
,
String
group
)
{
String
url
=
gmsBaseUrl
+
"/vo/search/"
+
group
;
LOG
.
trace
(
"called isMemberOf for group "
+
group
);
String
url
=
gmsBaseUrl
+
"/vo/search/"
+
URLEncoder
.
encode
(
group
,
StandardCharsets
.
UTF_8
);
String
gmsResponse
=
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
getEntity
(
token
),
String
.
class
).
getBody
();
if
(
gmsResponse
==
null
)
{
...
...
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