Package org.keycloak.models.utils
Class ModelToRepresentation
java.lang.Object
org.keycloak.models.utils.ModelToRepresentation
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildGroupPath
(GroupModel group) static void
exportAuthenticationFlows
(KeycloakSession session, RealmModel realm, RealmRepresentation rep) static void
exportGroups
(KeycloakSession session, RealmModel realm, RealmRepresentation rep) static void
exportRequiredActions
(RealmModel realm, RealmRepresentation rep) static <M,
R> Stream<R> filterValidRepresentations
(Stream<M> models, Function<M, R> transformer) Handles exceptions that occur when transforming the model to a representation and will remove all null objects from the stream.static GroupRepresentation
static Stream<GroupModel>
searchGroupModelsByAttributes
(KeycloakSession session, RealmModel realm, Map<String, String> attributes, Integer first, Integer max) stripClientAttributesIncludedAsFields
(Map<String, String> attributes) stripRealmAttributesIncludedAsFields
(Map<String, String> attributes) static RealmRepresentation
toBriefRepresentation
(RealmModel realm) toBriefRepresentation
(RealmModel realm, IdentityProviderModel identityProviderModel) static RoleRepresentation
static UserRepresentation
static GroupRepresentation
toGroupHierarchy
(GroupModel group, boolean full) Deprecated.static GroupRepresentation
toGroupHierarchy
(GroupModel group, boolean full, String search) Deprecated.static GroupRepresentation
toGroupHierarchy
(GroupModel group, boolean full, String search, Boolean exact) Deprecated.static Stream<GroupRepresentation>
toGroupHierarchy
(KeycloakSession session, RealmModel realm, boolean full) Deprecated.static List<ConfigPropertyRepresentation>
toRepresentation
(List<ProviderConfigProperty> configProperties) toRepresentation
(PermissionTicket ticket, AuthorizationProvider authorization) toRepresentation
(PermissionTicket ticket, AuthorizationProvider authorization, boolean returnNames) static <R extends AbstractPolicyRepresentation>
RtoRepresentation
(Policy policy, AuthorizationProvider authorization) static <R extends AbstractPolicyRepresentation>
RtoRepresentation
(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export) static <R extends AbstractPolicyRepresentation>
RtoRepresentation
(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export, boolean allFields) static ResourceRepresentation
toRepresentation
(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization) static ResourceRepresentation
toRepresentation
(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization, Boolean deep) static ResourceServerRepresentation
toRepresentation
(ResourceServer model, ClientModel client) static ScopeRepresentation
toRepresentation
(Scope model) toRepresentation
(CredentialMetadata credentialMetadata) static CredentialRepresentation
static AdminEventRepresentation
toRepresentation
(AdminEvent adminEvent) static AuthDetailsRepresentation
toRepresentation
(AuthDetails authDetails) static EventRepresentation
toRepresentation
(Event event) static ClientRepresentation
toRepresentation
(ClientModel clientModel, KeycloakSession session) static ClientScopeRepresentation
toRepresentation
(ClientScopeModel clientScopeModel) toRepresentation
(FederatedIdentityModel socialLink) static GroupRepresentation
toRepresentation
(GroupModel group, boolean full) static ComponentRepresentation
toRepresentation
(KeycloakSession session, ComponentModel component, boolean internal) static RealmRepresentation
toRepresentation
(KeycloakSession session, RealmModel realm, boolean internal) static RealmRepresentation
toRepresentation
(KeycloakSession session, RealmModel realm, boolean internal, boolean export) toRepresentation
(KeycloakSession session, RealmModel realm, AuthenticationExecutionModel model) toRepresentation
(KeycloakSession session, RealmModel realm, AuthenticationFlowModel model) static UserRepresentation
toRepresentation
(KeycloakSession session, RealmModel realm, UserModel user) static ProtocolMapperRepresentation
toRepresentation
(RealmModel realm, IdentityProviderModel identityProviderModel) toRepresentation
(RealmModel realm, IdentityProviderModel identityProviderModel, boolean export) static RoleRepresentation
toRepresentation
(RoleModel role) static UserConsentRepresentation
toRepresentation
(UserConsentModel model) static CredentialRepresentation
static UserSessionRepresentation
toRepresentation
(UserSessionModel session) static ConfigPropertyRepresentation
static ComponentRepresentation
toRepresentationWithoutConfig
(ComponentModel component) static ResourceServerRepresentation
toResourceServerRepresentation
(KeycloakSession session, ClientModel client)
-
Field Details
-
REALM_EXCLUDED_ATTRIBUTES
-
CLIENT_EXCLUDED_ATTRIBUTES
-
-
Constructor Details
-
ModelToRepresentation
public ModelToRepresentation()
-
-
Method Details
-
buildGroupPath
-
groupToBriefRepresentation
-
toRepresentation
-
searchGroupModelsByAttributes
public static Stream<GroupModel> searchGroupModelsByAttributes(KeycloakSession session, RealmModel realm, Map<String, String> attributes, Integer first, Integer max) -
toGroupHierarchy
@Deprecated public static Stream<GroupRepresentation> toGroupHierarchy(KeycloakSession session, RealmModel realm, boolean full) Deprecated. -
toGroupHierarchy
Deprecated. -
toGroupHierarchy
@Deprecated public static GroupRepresentation toGroupHierarchy(GroupModel group, boolean full, String search) Deprecated. -
toGroupHierarchy
@Deprecated public static GroupRepresentation toGroupHierarchy(GroupModel group, boolean full, String search, Boolean exact) Deprecated. -
toRepresentation
public static UserRepresentation toRepresentation(KeycloakSession session, RealmModel realm, UserModel user) -
toBriefRepresentation
-
toRepresentation
-
toRepresentation
-
toRepresentation
-
toRepresentation
-
toBriefRepresentation
-
toBriefRepresentation
-
toRepresentation
public static RealmRepresentation toRepresentation(KeycloakSession session, RealmModel realm, boolean internal) -
toRepresentation
public static RealmRepresentation toRepresentation(KeycloakSession session, RealmModel realm, boolean internal, boolean export) -
stripRealmAttributesIncludedAsFields
-
stripClientAttributesIncludedAsFields
-
exportGroups
-
exportAuthenticationFlows
public static void exportAuthenticationFlows(KeycloakSession session, RealmModel realm, RealmRepresentation rep) -
exportRequiredActions
-
toEventsConfigReprensetation
-
filterValidRepresentations
public static <M,R> Stream<R> filterValidRepresentations(Stream<M> models, Function<M, R> transformer) Handles exceptions that occur when transforming the model to a representation and will remove all null objects from the stream. Entities that have been removed from the store or where a lazy loading exception occurs will not show up in the output stream. -
toRepresentation
-
toRepresentation
-
toRepresentation
public static CredentialMetadataRepresentation toRepresentation(CredentialMetadata credentialMetadata) -
toRepresentation
-
toRepresentation
-
toRepresentation
-
toRepresentation
public static ClientRepresentation toRepresentation(ClientModel clientModel, KeycloakSession session) -
toBriefRepresentation
public static IdentityProviderRepresentation toBriefRepresentation(RealmModel realm, IdentityProviderModel identityProviderModel) -
toRepresentation
public static IdentityProviderRepresentation toRepresentation(RealmModel realm, IdentityProviderModel identityProviderModel) -
toRepresentation
public static IdentityProviderRepresentation toRepresentation(RealmModel realm, IdentityProviderModel identityProviderModel, boolean export) -
toRepresentation
-
toRepresentation
public static IdentityProviderMapperRepresentation toRepresentation(IdentityProviderMapperModel model) -
toRepresentation
-
toRepresentation
public static AuthenticationFlowRepresentation toRepresentation(KeycloakSession session, RealmModel realm, AuthenticationFlowModel model) -
toRepresentation
public static AuthenticationExecutionExportRepresentation toRepresentation(KeycloakSession session, RealmModel realm, AuthenticationExecutionModel model) -
toRepresentation
public static AuthenticationExecutionRepresentation toRepresentation(AuthenticationExecutionModel model) -
toRepresentation
-
toRepresentation
public static RequiredActionProviderRepresentation toRepresentation(RequiredActionProviderModel model) -
toRepresentation
public static List<ConfigPropertyRepresentation> toRepresentation(List<ProviderConfigProperty> configProperties) -
toRepresentation
-
toRepresentation
public static ComponentRepresentation toRepresentation(KeycloakSession session, ComponentModel component, boolean internal) -
toRepresentationWithoutConfig
-
toRepresentation
-
toRepresentation
public static ResourceServerRepresentation toRepresentation(ResourceServer model, ClientModel client) -
toRepresentation
public static <R extends AbstractPolicyRepresentation> R toRepresentation(Policy policy, AuthorizationProvider authorization) -
toRepresentation
public static <R extends AbstractPolicyRepresentation> R toRepresentation(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export) -
toRepresentation
public static <R extends AbstractPolicyRepresentation> R toRepresentation(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export, boolean allFields) -
toRepresentation
public static ResourceRepresentation toRepresentation(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization) -
toRepresentation
public static ResourceRepresentation toRepresentation(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization, Boolean deep) -
toRepresentation
public static PermissionTicketRepresentation toRepresentation(PermissionTicket ticket, AuthorizationProvider authorization) -
toRepresentation
public static PermissionTicketRepresentation toRepresentation(PermissionTicket ticket, AuthorizationProvider authorization, boolean returnNames) -
toResourceServerRepresentation
public static ResourceServerRepresentation toResourceServerRepresentation(KeycloakSession session, ClientModel client) -
toRepresentation
-