2015-05-18 19:15:58 +02:00
|
|
|
package org.gcube.common.authorization.client.proxy;
|
|
|
|
|
2016-10-26 09:48:56 +02:00
|
|
|
import java.io.File;
|
2015-06-04 18:49:59 +02:00
|
|
|
import java.util.List;
|
2016-06-23 18:14:16 +02:00
|
|
|
import java.util.Map;
|
2015-06-04 18:49:59 +02:00
|
|
|
|
2015-07-30 17:33:48 +02:00
|
|
|
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
2015-05-18 19:15:58 +02:00
|
|
|
import org.gcube.common.authorization.library.AuthorizationEntry;
|
2015-11-27 18:06:28 +01:00
|
|
|
import org.gcube.common.authorization.library.enpoints.AuthorizationEndpoint;
|
2016-09-22 10:44:15 +02:00
|
|
|
import org.gcube.common.authorization.library.enpoints.EndpointsContainer;
|
2016-01-22 17:28:17 +01:00
|
|
|
import org.gcube.common.authorization.library.policies.Policy;
|
2016-07-22 14:27:10 +02:00
|
|
|
import org.gcube.common.authorization.library.provider.ContainerInfo;
|
2016-06-15 13:47:22 +02:00
|
|
|
import org.gcube.common.authorization.library.provider.ServiceInfo;
|
2016-07-22 14:27:10 +02:00
|
|
|
import org.gcube.common.authorization.library.provider.UserInfo;
|
2019-12-09 17:55:30 +01:00
|
|
|
import org.gcube.common.authorization.library.utils.MultiServiceTokenRequest;
|
2015-05-18 19:15:58 +02:00
|
|
|
|
|
|
|
public interface AuthorizationProxy {
|
|
|
|
|
2016-06-23 18:14:16 +02:00
|
|
|
AuthorizationEndpoint getEndpoint(int infrastructureHash);
|
2015-11-27 18:06:28 +01:00
|
|
|
|
2016-09-22 10:44:15 +02:00
|
|
|
void setEndpoint(EndpointsContainer endpoints);
|
2016-01-22 17:28:17 +01:00
|
|
|
|
2015-11-24 19:26:37 +01:00
|
|
|
AuthorizationEntry get(String token) throws ObjectNotFound, Exception;
|
2019-12-09 17:55:30 +01:00
|
|
|
|
|
|
|
List<AuthorizationEntry> get(List<String> tokens) throws ObjectNotFound, Exception;
|
2016-07-22 14:27:10 +02:00
|
|
|
|
2016-01-22 17:28:17 +01:00
|
|
|
void addPolicies(List<Policy> policies) throws Exception;
|
2015-11-27 18:06:28 +01:00
|
|
|
|
2016-01-22 17:28:17 +01:00
|
|
|
void removePolicies(long ... ids) throws Exception;
|
2015-06-04 18:49:59 +02:00
|
|
|
|
2016-01-22 17:28:17 +01:00
|
|
|
List<Policy> getPolicies(String context) throws Exception;
|
2016-06-29 14:54:12 +02:00
|
|
|
|
|
|
|
String generateApiKey(String apiQualifier) throws Exception;
|
2016-07-22 14:27:10 +02:00
|
|
|
|
|
|
|
String generateServiceToken(ServiceInfo client) throws Exception;
|
2019-12-09 17:55:30 +01:00
|
|
|
|
|
|
|
List<String> generateServiceToken(ServiceInfo client, List<String> containerTokens) throws Exception;
|
|
|
|
|
2016-07-22 14:27:10 +02:00
|
|
|
|
|
|
|
String generateUserToken(UserInfo client, String context)
|
|
|
|
throws Exception;
|
|
|
|
|
2016-09-30 12:22:58 +02:00
|
|
|
String requestActivation(ContainerInfo container) throws Exception;
|
2016-09-30 18:27:04 +02:00
|
|
|
|
|
|
|
String requestActivation(ContainerInfo container, String context) throws Exception;
|
|
|
|
|
|
|
|
Map<String, String> retrieveApiKeys() throws Exception;
|
2016-09-07 14:11:39 +02:00
|
|
|
|
2016-10-26 09:48:56 +02:00
|
|
|
File getSymmKey(String filePath) throws Exception;
|
2016-11-14 17:39:00 +01:00
|
|
|
|
|
|
|
String resolveTokenByUserAndContext(String user, String context)
|
|
|
|
throws Exception;
|
|
|
|
|
|
|
|
String generateExternalServiceToken(String serviceId)
|
|
|
|
throws Exception;
|
2016-11-22 12:29:28 +01:00
|
|
|
|
|
|
|
Map<String, String> retrieveExternalServiceGenerated() throws Exception;
|
2018-02-21 16:22:14 +01:00
|
|
|
|
2018-02-22 18:13:45 +01:00
|
|
|
void removeAllReleatedToken(String clientId, String context) throws Exception;
|
2019-10-07 09:19:54 +02:00
|
|
|
|
|
|
|
void setTokenRoles(String token, List<String> roles) throws Exception;
|
2016-07-14 17:47:45 +02:00
|
|
|
|
2015-05-18 19:15:58 +02:00
|
|
|
}
|