Class SecurityUtils
java.lang.Object
net.sourceforge.plantuml.security.SecurityUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhitelist of paths from where scripts can load data.static final StringWhitelist of urlsstatic final StringIndicates, that we have no authentication and credentials to access the URL.static final StringJava class paths to import files from.static final StringPaths to include files.static final StringPaths to folders with security specific content (not allowed to read via SFile).static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic FileOutputStreamcreateFileOutputStream(String path) static FileReadercreateFileReader(String path) static PrintStreamstatic PrintStreamcreatePrintStream(OutputStream os, boolean autoFlush, String charset) static PrintStreamcreatePrintStream(OutputStream os, boolean autoFlush, Charset charset) static PrintWriterstatic PrintWritercreatePrintWriter(OutputStream os, boolean append) static PrintWritercreatePrintWriter(String path) static booleanexistsSecurityCredentials(String userToken) Checks if user credentials existing.static SecurityAccessInterceptorgetAccessInterceptor(SecurityAuthentication authentication) Returns the authentication interceptor for aSecurityAuthentication.static SecurityAuthorizeManagergetAuthenticationManager(SecurityCredentials credentialConfiguration) Returns the authorize-manager for a security credentials configuration.static Stringstatic SFileLoads the path to the configured security folder, if existing.static SecurityProfilestatic booleanignoreThisLink(String url) static booleanConfiguration for Non-SSL authentication methods.static SecurityCredentialsloadSecurityCredentials(String userToken) Loads the user credentials from the file system.static BufferedImagereadRasterImage(ImageIcon imageIcon)
-
Field Details
-
NO_CREDENTIALS
Indicates, that we have no authentication and credentials to access the URL.- See Also:
-
PATHS_CLASSES
Java class paths to import files from.- See Also:
-
PATHS_INCLUDES
Paths to include files.- See Also:
-
ALLOWLIST_LOCAL_PATHS
Whitelist of paths from where scripts can load data.- See Also:
-
ALLOWLIST_URL
Whitelist of urls- See Also:
-
PATHS_SECURITY
Paths to folders with security specific content (not allowed to read via SFile).- See Also:
-
SECURITY_ALLOW_NONSSL_AUTH
- See Also:
-
-
Constructor Details
-
SecurityUtils
public SecurityUtils()
-
-
Method Details
-
ignoreThisLink
-
readRasterImage
-
getSecurityProfile
-
getenv
-
isNonSSLAuthenticationAllowed
public static boolean isNonSSLAuthenticationAllowed()Configuration for Non-SSL authentication methods.- Returns:
- true, if plantUML should allow authentication in plain connections (without encryption).
- See Also:
-
getPath
-
allowSvgText
public static boolean allowSvgText() -
createPrintWriter
-
createPrintWriter
-
createPrintStream
-
createPrintStream
public static PrintStream createPrintStream(OutputStream os, boolean autoFlush, String charset) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
createPrintStream
public static PrintStream createPrintStream(OutputStream os, boolean autoFlush, Charset charset) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
createFileReader
- Throws:
FileNotFoundException
-
createPrintWriter
- Throws:
FileNotFoundException
-
createFileOutputStream
- Throws:
FileNotFoundException
-
getAuthenticationManager
public static SecurityAuthorizeManager getAuthenticationManager(SecurityCredentials credentialConfiguration) Returns the authorize-manager for a security credentials configuration.- Parameters:
credentialConfiguration- the credentials- Returns:
- the manager.
-
getAccessInterceptor
Returns the authentication interceptor for aSecurityAuthentication.- Parameters:
authentication- the authentication data- Returns:
- the interceptor.
-
existsSecurityCredentials
Checks if user credentials existing.- Parameters:
userToken- name of the credential file- Returns:
- boolean, if exists
-
loadSecurityCredentials
Loads the user credentials from the file system.- Parameters:
userToken- name of the credential file- Returns:
- the credentials or NONE
-
getSecurityPath
Loads the path to the configured security folder, if existing.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.
- Returns:
- SFile folder or null
-