public class UPConfigUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ROLE_ADMIN |
static String |
ROLE_USER |
Constructor and Description |
---|
UPConfigUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canBeAuthFlowContext(UserProfileContext context)
Check if context CAN BE part of the AuthenticationFlow.
|
static String |
capitalizeFirstLetter(String str) |
static List<String> |
getChunks(String src,
int partLength)
Break string to substrings of given length.
|
static boolean |
isRoleForContext(UserProfileContext context,
List<String> roles)
Check if roles configuration contains role given current context.
|
static boolean |
isValidAttributeName(String attributeName) |
static UPConfig |
readConfig(InputStream is)
Load configuration from JSON file.
|
static List<String> |
validate(KeycloakSession session,
UPConfig config)
Validate object representation of the configuration.
|
public static final String ROLE_USER
public static final String ROLE_ADMIN
public static UPConfig readConfig(InputStream is) throws IOException
Configuration is not validated, use #validate(UPConfig)
to validate it and get list of errors.
is
- JSON file to be loadedIOException
- if JSON configuration can't be loaded (eg due to JSON format errors etc)public static List<String> validate(KeycloakSession session, UPConfig config)
session
- to be used for Validator SPI integrationconfig
- to validatepublic static boolean isValidAttributeName(String attributeName)
attributeName
- to validatepublic static List<String> getChunks(String src, int partLength)
src
- to breakpartLength
- public static boolean canBeAuthFlowContext(UserProfileContext context)
context
- to checkpublic static boolean isRoleForContext(UserProfileContext context, List<String> roles)
context
- to be checkedroles
- to be inspectedCopyright © 2021 JBoss by Red Hat. All rights reserved.