public class SecurityUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NO_CREDENTIALS
Indicates, that we have no authentication and credentials to access the URL.
|
static java.lang.String |
PATHS_ALLOWED
Whitelist of paths from where scripts can load data.
|
static java.lang.String |
PATHS_CLASSES
Java class paths to import files from.
|
static java.lang.String |
PATHS_INCLUDES
Paths to include files.
|
static java.lang.String |
PATHS_SECURITY
Paths to folders with security specific content (not allowed to read via
SFile).
|
static java.lang.String |
SECURITY_ALLOW_NONSSL_AUTH |
Constructor and Description |
---|
SecurityUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
allowSvgText() |
static java.io.FileOutputStream |
createFileOutputStream(java.lang.String path) |
static java.io.FileReader |
createFileReader(java.lang.String path) |
static java.io.PrintStream |
createPrintStream(java.io.OutputStream os) |
static java.io.PrintStream |
createPrintStream(java.io.OutputStream os,
boolean autoFlush,
java.nio.charset.Charset charset) |
static java.io.PrintStream |
createPrintStream(java.io.OutputStream os,
boolean autoFlush,
java.lang.String charset) |
static java.io.PrintWriter |
createPrintWriter(java.io.OutputStream os) |
static java.io.PrintWriter |
createPrintWriter(java.io.OutputStream os,
boolean append) |
static java.io.PrintWriter |
createPrintWriter(java.lang.String path) |
static boolean |
existsSecurityCredentials(java.lang.String userToken)
Checks if user credentials existing.
|
static SecurityAccessInterceptor |
getAccessInterceptor(SecurityAuthentication authentication)
Returns the authentication interceptor for a
SecurityAuthentication . |
static SecurityAuthorizeManager |
getAuthenticationManager(SecurityCredentials credentialConfiguration)
Returns the authorize-manager for a security credentials configuration.
|
static java.lang.String |
getenv(java.lang.String name) |
static java.util.List<SFile> |
getPath(java.lang.String prop) |
static SFile |
getSecurityPath()
Loads the path to the configured security folder, if existing.
|
static SecurityProfile |
getSecurityProfile() |
static boolean |
ignoreThisLink(java.lang.String url) |
static boolean |
isNonSSLAuthenticationAllowed()
Configuration for Non-SSL authentication methods.
|
static boolean |
isSecurityEnv(java.lang.String name)
Checks the environment variable and returns true if the variable is used in
security context.
|
static SecurityCredentials |
loadSecurityCredentials(java.lang.String userToken)
Loads the user credentials from the file system.
|
static java.awt.image.BufferedImage |
readRasterImage(javax.swing.ImageIcon imageIcon) |
public static final java.lang.String NO_CREDENTIALS
public static final java.lang.String PATHS_CLASSES
public static final java.lang.String PATHS_INCLUDES
public static final java.lang.String PATHS_ALLOWED
public static final java.lang.String PATHS_SECURITY
public static final java.lang.String SECURITY_ALLOW_NONSSL_AUTH
public static SecurityProfile getSecurityProfile()
public static boolean ignoreThisLink(java.lang.String url)
public static java.lang.String getenv(java.lang.String name)
public static boolean isSecurityEnv(java.lang.String name)
name
- Environment variable to checkpublic static boolean isNonSSLAuthenticationAllowed()
SECURITY_ALLOW_NONSSL_AUTH
public static java.util.List<SFile> getPath(java.lang.String prop)
public static boolean allowSvgText()
public static java.io.PrintWriter createPrintWriter(java.io.OutputStream os)
public static java.io.PrintWriter createPrintWriter(java.io.OutputStream os, boolean append)
public static java.io.PrintStream createPrintStream(java.io.OutputStream os)
public static java.io.PrintStream createPrintStream(java.io.OutputStream os, boolean autoFlush, java.lang.String charset) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.io.PrintStream createPrintStream(java.io.OutputStream os, boolean autoFlush, java.nio.charset.Charset charset) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.awt.image.BufferedImage readRasterImage(javax.swing.ImageIcon imageIcon)
public static java.io.FileReader createFileReader(java.lang.String path) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.io.PrintWriter createPrintWriter(java.lang.String path) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.io.FileOutputStream createFileOutputStream(java.lang.String path) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static SecurityAuthorizeManager getAuthenticationManager(SecurityCredentials credentialConfiguration)
credentialConfiguration
- the credentialspublic static SecurityAccessInterceptor getAccessInterceptor(SecurityAuthentication authentication)
SecurityAuthentication
.authentication
- the authentication datapublic static boolean existsSecurityCredentials(java.lang.String userToken)
userToken
- name of the credential filepublic static SecurityCredentials loadSecurityCredentials(java.lang.String userToken)
userToken
- name of the credential filepublic static SFile getSecurityPath()
Please note: A SFile referenced to a security folder cannot access the files. The content of the files in the security path should never have passed to DSL scripts.