From f6e49975d058d87ad55088757d1ce0d5ec60db75 Mon Sep 17 00:00:00 2001 From: lucio Date: Wed, 4 May 2022 19:11:33 +0200 Subject: [PATCH] added import of authorization-util --- pom.xml | 11 ++++++----- .../application/request/RequestAccounting.java | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index d73d0bb..6c73acf 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,12 @@ [1.0.0,2.0.0-SNAPSHOT) + + org.gcube.common + authorization-utils + [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) + + org.gcube.common authorization-client @@ -73,11 +79,6 @@ common-authorization - - org.gcube.common - authorization-utils - - org.gcube.data.publishing document-store-lib diff --git a/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java b/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java index 97dff80..3f7bab3 100644 --- a/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java +++ b/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java @@ -1,13 +1,12 @@ package org.gcube.smartgears.handlers.application.request; -import static org.gcube.smartgears.Constants.called_method_header; - import javax.xml.bind.annotation.XmlRootElement; 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.provider.AuthorizationProvider; import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.common.authorization.utils.manager.SecretManagerProvider; import org.gcube.common.scope.api.ScopeProvider; @@ -38,7 +37,7 @@ public class RequestAccounting extends RequestHandler { public void handleRequest(RequestEvent e) { ApplicationContext context = e.context(); - String calledMethod = e.request().getHeader(called_method_header); + String calledMethod = e.request().getHeader(Constants.called_method_header); if (calledMethod==null){ calledMethod = e.request().getRequestURI().substring(e.request().getContextPath().length()); if (calledMethod.isEmpty()) @@ -84,6 +83,7 @@ public class RequestAccounting extends RequestHandler { InnerMethodName.instance.reset(); if (resetScope) ScopeProvider.instance.reset(); + } void generateAccounting(String caller, String callerQualifier, String remoteHost, boolean success, ApplicationContext context){