added roles to ExternalService client info

This commit is contained in:
Lucio Lelii 2022-04-20 16:22:38 +02:00
parent 72a5e54edd
commit a71d8d1fac
3 changed files with 7 additions and 3 deletions

View File

@ -2,6 +2,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for Common Smartgears
## [v3.1.5-SNAPSHOT] - 2022-04-20
- Added roles to ExternalService Info on request handler verification
## [v3.1.4] - 2022-03-29
- fixes issue [#23075]

View File

@ -11,7 +11,7 @@
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears</artifactId>
<version>3.1.4</version>
<version>3.1.5-SNAPSHOT</version>
<name>SmartGears</name>
<dependencyManagement>

View File

@ -146,8 +146,8 @@ public class RequestContextRetriever extends RequestHandler {
if (!jwt.isExternalService())
clientInfo = new UserInfo(jwt.getUsername(), jwt.getRoles(), jwt.getEmail(), jwt.getFirstName(), jwt.getLastName());
else
clientInfo = new ExternalServiceInfo(jwt.getUsername(), "unknown");
clientInfo = new ExternalServiceInfo(jwt.getUsername(), "unknown", jwt.getRoles());
log.info("caller type is {}",clientInfo.getType());
AuthorizationProvider.instance.set(new Caller(clientInfo, "token"));