Class AbstractUrlSigningProvider
java.lang.Object
org.opencastproject.security.urlsigning.provider.impl.AbstractUrlSigningProvider
- All Implemented Interfaces:
UrlSigningProvider,org.osgi.service.cm.ManagedService
- Direct Known Subclasses:
GenericUrlSigningProvider,WowzaUrlSigningProvider
public abstract class AbstractUrlSigningProvider
extends Object
implements UrlSigningProvider, org.osgi.service.cm.ManagedService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA class representing a URL signing key. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue indicating that the key can be used by any organizationstatic final StringThe configuration key used for the exlusion liststatic final StringThe prefix for key configuration keysstatic final StringThe attribute name in the configuration file to define the organization owning the key.static final StringThe attribute name in the configuration file to define the encryption key.protected SecurityServiceThe security servicestatic final StringThe attribute name in the configuration file to define the matching url.protected TreeMap<String, AbstractUrlSigningProvider.Key> A mapping of URL prefixes to keys used to lookup keys for a given URL. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the implementation accepts to sign thebaseUrl.protected AbstractUrlSigningProvider.KeyGetAbstractUrlSigningProvider.Keyfor a given URL.abstract org.slf4j.Loggerabstract ResourceStrategygetUris()voidsetSecurityService(SecurityService securityService) Creates the necessary query string to sign a resource using the givenPolicyvoidupdated(Dictionary<String, ?> properties)
-
Field Details
-
KEY_PROPERTY_PREFIX
The prefix for key configuration keys- See Also:
-
SECRET
The attribute name in the configuration file to define the encryption key.- See Also:
-
URL
The attribute name in the configuration file to define the matching url.- See Also:
-
ORGANIZATION
The attribute name in the configuration file to define the organization owning the key.- See Also:
-
ANY_ORGANIZATION
Value indicating that the key can be used by any organization- See Also:
-
EXCLUSION_PROPERTY_KEY
The configuration key used for the exlusion list- See Also:
-
securityService
The security service -
urls
A mapping of URL prefixes to keys used to lookup keys for a given URL.
-
-
Constructor Details
-
AbstractUrlSigningProvider
public AbstractUrlSigningProvider()
-
-
Method Details
-
getResourceStrategy
- Returns:
- The method that an implementation class will convert base urls to resource urls.
-
getLogger
public abstract org.slf4j.Logger getLogger()- Returns:
- The logger to use for this signing provider.
-
setSecurityService
- Parameters:
securityService- the securityService to set
-
getUris
- Returns:
- The current set of url beginnings this signing provider is looking for.
-
getKey
GetAbstractUrlSigningProvider.Keyfor a given URL. This method supports multi-tenancy in means of only returning keys that can be used by the current organization. In case the current organization cannot be determined, no key will be returned.- Parameters:
baseUrl- The URL that needs to be signed.- Returns:
- The
AbstractUrlSigningProvider.Keyif it is available.
-
updated
public void updated(Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationException- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
accepts
Description copied from interface:UrlSigningProviderReturns true if the implementation accepts to sign thebaseUrl.- Specified by:
acceptsin interfaceUrlSigningProvider- Parameters:
baseUrl- The base URL of the resource that needs to be signed- Returns:
- true if the url is accepted (is valid, is not excluded and hat a key), false otherwise
-
sign
Description copied from interface:UrlSigningProviderCreates the necessary query string to sign a resource using the givenPolicy- Specified by:
signin interfaceUrlSigningProvider- Parameters:
policy- ThePolicyto sign.- Returns:
- the policy signed
- Throws:
UrlSigningException- Thrown if unable to sign the url.
-