Class UrlSigningServiceOsgiUtil
java.lang.Object
org.opencastproject.security.urlsigning.utils.UrlSigningServiceOsgiUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BooleanThe default for whether to use the client IP in the signature.static final longThe default time before a piece of signed content expires. 2 Hours.static final StringThe default key in the OSGI service configuration for when signed URLs will expire.static final StringThe default key in the OSGI service configuration for whether to use client IP in the signature. -
Method Summary
Modifier and TypeMethodDescriptionstatic longgetUpdatedSigningExpiration(Dictionary properties, String className) Get the amount of seconds before a signed URL should expire from aDictionary.static longgetUpdatedSigningExpiration(Dictionary properties, String className, String key, long defaultExpiry) Get the amount of seconds before a signed URL should expire from aDictionary.static booleangetUpdatedSignWithClientIP(Dictionary properties, String className) Get whether a signed URL should contain the client's IP from aDictionary.static booleangetUpdatedSignWithClientIP(Dictionary properties, String className, String key, boolean defaultSignWithIP) Get whether a signed URL should contain the client's IP from aDictionary.
-
Field Details
-
URL_SIGNING_EXPIRES_DURATION_SECONDS_KEY
The default key in the OSGI service configuration for when signed URLs will expire.- See Also:
-
URL_SIGNING_USE_CLIENT_IP
The default key in the OSGI service configuration for whether to use client IP in the signature.- See Also:
-
DEFAULT_URL_SIGNING_EXPIRE_DURATION
public static final long DEFAULT_URL_SIGNING_EXPIRE_DURATIONThe default time before a piece of signed content expires. 2 Hours.- See Also:
-
DEFAULT_SIGN_WITH_CLIENT_IP
The default for whether to use the client IP in the signature.
-
-
Method Details
-
getUpdatedSigningExpiration
Get the amount of seconds before a signed URL should expire from aDictionary. Uses theUrlSigningServiceOsgiUtil's default value and default key name.- Parameters:
properties- TheDictionaryto look through to get the expire duration.className- The name of the class that is getting the expire duration for logging.- Returns:
- The duration that URLs expire from the properties if present, the default if it isn't.
-
getUpdatedSigningExpiration
public static long getUpdatedSigningExpiration(Dictionary properties, String className, String key, long defaultExpiry) Get the amount of seconds before a signed URL should expire from aDictionary.- Parameters:
properties- TheDictionaryto look through to get the expire duration.className- The name of the class that is getting the expire duration for logging.key- The key in the dictionary that should contain the expire duration.defaultExpiry- The expire duration to use if one is not found in theDictionary- Returns:
- The duration that URLs expire from the properties if present, the default if it isn't.
-
getUpdatedSignWithClientIP
Get whether a signed URL should contain the client's IP from aDictionary. Uses theUrlSigningServiceOsgiUtil's default value and default key name.- Parameters:
properties- TheDictionaryto look through for whether the IP should be included.className- The name of the class that is getting the value for logging.- Returns:
- Whether the URLs that are signed should contain the client's IP address
-
getUpdatedSignWithClientIP
public static boolean getUpdatedSignWithClientIP(Dictionary properties, String className, String key, boolean defaultSignWithIP) Get whether a signed URL should contain the client's IP from aDictionary.- Parameters:
properties- TheDictionaryto look through for whether the IP should be included.className- The name of the class that is getting the value for logging.key- The key in the dictionary that should contain the value.defaultSignWithIP- The default to use if the value is not found in theDictionary- Returns:
- true if signed URLs should contain the client IP, false if not.
-