commit to solve buil dissue on release 4.24

This commit is contained in:
Lucio Lelii 2020-06-22 16:49:16 +02:00
parent 0e2a8dfbed
commit 3cf3505e6a
2 changed files with 6 additions and 11 deletions

View File

@ -34,9 +34,6 @@ import org.gcube.common.authorization.library.utils.MultiServiceTokenRequest;
import org.gcube.common.authorizationservice.filters.AuthorizedCallFilter; import org.gcube.common.authorizationservice.filters.AuthorizedCallFilter;
import org.gcube.common.authorizationservice.util.Constants; import org.gcube.common.authorizationservice.util.Constants;
import org.gcube.common.authorizationservice.util.TokenPersistence; import org.gcube.common.authorizationservice.util.TokenPersistence;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.scope.api.ServiceMap;
import org.gcube.common.scope.impl.ScopedServiceMap;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -80,6 +77,7 @@ public class TokenManager {
.entity("token "+token+" not found").type(MediaType.TEXT_PLAIN).build()); .entity("token "+token+" not found").type(MediaType.TEXT_PLAIN).build());
} }
/*
try{ try{
ScopeProvider.instance.set(info.getContext()); ScopeProvider.instance.set(info.getContext());
ServiceMap map = ((ScopedServiceMap)ServiceMap.instance).currentMap(); ServiceMap map = ((ScopedServiceMap)ServiceMap.instance).currentMap();
@ -87,7 +85,7 @@ public class TokenManager {
info.setMap(map); info.setMap(map);
}catch(Throwable e){ }catch(Throwable e){
log.error("error retrieving map for {}", info.getContext(), e); log.error("error retrieving map for {}", info.getContext(), e);
} }*/
log.debug("returning info {}", info); log.debug("returning info {}", info);
return info; return info;
@ -105,21 +103,22 @@ public class TokenManager {
@Produces(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML)
public AuthorizationEntryList retrieveTokenBunch(@NotNull @QueryParam("token") List<String> tokens ) { public AuthorizationEntryList retrieveTokenBunch(@NotNull @QueryParam("token") List<String> tokens ) {
CalledMethodProvider.instance.set("retrieve"); CalledMethodProvider.instance.set("retrieve");
log.info("token retreiver called with tokens {}",tokens); log.info("token retreiver in bunch called with tokens {}",tokens);
List<AuthorizationEntry> toReturn = new ArrayList<AuthorizationEntry>(); List<AuthorizationEntry> toReturn = new ArrayList<AuthorizationEntry>();
for (String token : tokens ) { for (String token : tokens ) {
try { try {
AuthorizationEntry info = persistence.getAuthorizationEntry(token); AuthorizationEntry info = persistence.getAuthorizationEntry(token);
/*
try{ try{
ScopeProvider.instance.set(info.getContext()); ScopeProvider.instance.set(info.getContext());
ServiceMap map = ((ScopedServiceMap)ServiceMap.instance).currentMap(); DefaultServiceMap map = (DefaultServiceMap)((ScopedServiceMap)ServiceMap.instance).currentMap();
ScopeProvider.instance.reset(); ScopeProvider.instance.reset();
info.setMap(map); info.setMap(map);
}catch(Throwable e){ }catch(Throwable e){
log.error("error retrieving map for {}", info.getContext(), e); log.error("error retrieving map for {}", info.getContext(), e);
} }
*/
toReturn.add(info); toReturn.add(info);
}catch(Exception t) { }catch(Exception t) {
log.error("erorr on authorization", t); log.error("erorr on authorization", t);

View File

@ -16,9 +16,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.gcube.accounting.datamodel.UsageRecord.OperationResult; import org.gcube.accounting.datamodel.UsageRecord.OperationResult;
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
import org.gcube.accounting.persistence.AccountingPersistence;
import org.gcube.accounting.persistence.AccountingPersistenceFactory;
import org.gcube.common.authorization.library.AuthorizationEntry; import org.gcube.common.authorization.library.AuthorizationEntry;
import org.gcube.common.authorization.library.provider.CalledMethodProvider; import org.gcube.common.authorization.library.provider.CalledMethodProvider;
import org.gcube.common.authorizationservice.configuration.AllowedEntity; import org.gcube.common.authorizationservice.configuration.AllowedEntity;
@ -26,7 +23,6 @@ import org.gcube.common.authorizationservice.configuration.AuthorizationConfigur
import org.gcube.common.authorizationservice.configuration.AuthorizationRule; import org.gcube.common.authorizationservice.configuration.AuthorizationRule;
import org.gcube.common.authorizationservice.configuration.ConfigurationHolder; import org.gcube.common.authorizationservice.configuration.ConfigurationHolder;
import org.gcube.common.authorizationservice.util.TokenPersistence; import org.gcube.common.authorizationservice.util.TokenPersistence;
import org.gcube.common.scope.api.ScopeProvider;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;