forked from gCubeSystem/common-smartgears-legacy
Make valid tokens that come without resource_access to be granted for minimal privileges on context identified by audience
This commit is contained in:
parent
406016cd29
commit
db87ad7f3b
|
@ -14,6 +14,8 @@ import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class GcubeJwt {
|
public class GcubeJwt {
|
||||||
|
|
||||||
|
protected final static List<String> MINIMAL_ROLES = List.of("Member");
|
||||||
|
|
||||||
@JsonProperty("aud")
|
@JsonProperty("aud")
|
||||||
private String context;
|
private String context;
|
||||||
|
|
||||||
|
@ -33,7 +35,7 @@ public class GcubeJwt {
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
public List<String> getRoles(){
|
public List<String> getRoles(){
|
||||||
return contextAccess.get(this.context).roles;
|
return contextAccess.get(this.context) == null ? MINIMAL_ROLES : contextAccess.get(this.context).roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContext() {
|
public String getContext() {
|
||||||
|
|
Loading…
Reference in New Issue