Class AbstractUrlSigningProvider
java.lang.Object
org.opencastproject.security.urlsigning.provider.impl.AbstractUrlSigningProvider
- All Implemented Interfaces:
org.opencastproject.security.urlsigning.provider.UrlSigningProvider,org.osgi.service.cm.ManagedService
- Direct Known Subclasses:
GenericUrlSigningProvider,WowzaUrlSigningProvider
public abstract class AbstractUrlSigningProvider
extends Object
implements org.opencastproject.security.urlsigning.provider.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 org.opencastproject.security.api.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 TypeMethodDescriptionbooleanprotected AbstractUrlSigningProvider.KeyGetAbstractUrlSigningProvider.Keyfor a given URL.abstract org.slf4j.Loggerabstract org.opencastproject.urlsigning.common.ResourceStrategygetUris()voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) sign(org.opencastproject.urlsigning.common.Policy policy) voidupdated(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
protected org.opencastproject.security.api.SecurityService securityServiceThe 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
public abstract org.opencastproject.urlsigning.common.ResourceStrategy 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
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) - 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
- Specified by:
acceptsin interfaceorg.opencastproject.security.urlsigning.provider.UrlSigningProvider- Returns:
- true if the url is accepted (is valid, is not excluded and hat a key), false otherwise
-
sign
public String sign(org.opencastproject.urlsigning.common.Policy policy) throws org.opencastproject.security.urlsigning.exception.UrlSigningException - Specified by:
signin interfaceorg.opencastproject.security.urlsigning.provider.UrlSigningProvider- Returns:
- the policy signed
- Throws:
org.opencastproject.security.urlsigning.exception.UrlSigningException
-