Package org.gcube.dataharvest.utils
Class ContextAuthorization
- java.lang.Object
-
- org.gcube.dataharvest.utils.ContextAuthorization
-
public class ContextAuthorization extends Object
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLIENT_IDprotected StringclientSecretprotected Map<String,org.gcube.common.authorization.utils.secret.Secret>contextToTokenContains Context full name as key and Token as Valueprotected Propertiespropertiesprotected Map<org.gcube.common.authorization.utils.secret.Secret,String>tokenToContextContains Token as key and Context full name as Value
-
Constructor Summary
Constructors Constructor Description ContextAuthorization()Contains Properties used to generate tokensContextAuthorization(Properties properties)Contains Properties used to generate tokens
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.gcube.common.authorization.utils.secret.SecretgetCatalogueSecretForContext(String context)StringgetContextFromSecret(org.gcube.common.authorization.utils.secret.Secret secret)SortedSet<String>getContexts()org.gcube.common.authorization.utils.secret.SecretgetSecretForContext(String context)protected voidretrieveContextsAndTokens()
-
-
-
Field Detail
-
CLIENT_ID
public static final String CLIENT_ID
- See Also:
- Constant Field Values
-
clientSecret
protected String clientSecret
-
contextToToken
protected Map<String,org.gcube.common.authorization.utils.secret.Secret> contextToToken
Contains Context full name as key and Token as Value
-
tokenToContext
protected Map<org.gcube.common.authorization.utils.secret.Secret,String> tokenToContext
Contains Token as key and Context full name as Value
-
properties
protected Properties properties
-
-
Constructor Detail
-
ContextAuthorization
public ContextAuthorization(Properties properties) throws Exception
Contains Properties used to generate tokens- Throws:
Exception
-
-
Method Detail
-
getCatalogueSecretForContext
public org.gcube.common.authorization.utils.secret.Secret getCatalogueSecretForContext(String context) throws Exception
- Throws:
Exception
-
retrieveContextsAndTokens
protected void retrieveContextsAndTokens() throws Exception- Throws:
Exception
-
getSecretForContext
public org.gcube.common.authorization.utils.secret.Secret getSecretForContext(String context)
-
getContextFromSecret
public String getContextFromSecret(org.gcube.common.authorization.utils.secret.Secret secret)
-
-