Package org.forgerock.am.trees.model
Class TreeState
java.lang.Object
org.forgerock.am.trees.model.TreeState
An immutable container for the state associated with a partially or completely evaluated tree.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A builder for TreeState objects. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal UUID
The ID of the most recently processed node.final Optional<IdentifiedIdentity>
The identified users.The maximum duration of the tree.List of classes that are run after successful authentication.final SessionProperties
Properties that will be included in the user's session if/when it is created.final JsonValue
The state populated by the nodes in the tree.final JsonValue
The transient state populated by the nodes in the tree.The identity objects universal id.List of webhooks that are run after session logout. -
Method Summary
Modifier and TypeMethodDescriptionstatic TreeState.Builder
builder()
Creates a new TreeState builder.static TreeState
createInitial
(Realm realm, Integer targetAuthLevel, Map<String, Object> initialData, int maxTreeDuration) Creates a tree state that represents start of authentication tree.static TreeState
Returns a TreeState object from the JsonValue.The secure state populated by transient state which is promoted to be retained across callback boundaries.toJson()
Returns the JsonValue format of the TreeState object.The optional unencrypted secure state.
-
Field Details
-
transientState
The transient state populated by the nodes in the tree. The values stored in this state is request scoped would not be shared across multiple requests/callbacks in an authentication tree flow. Every time a callback is sent to the user the transient state would be reset to an empty json value object. As data may be promoted to secureState from transientState, transientState should not be accessed directly, but rather via theTreeContext.getState(String)
method. -
currentNodeId
The ID of the most recently processed node. -
sessionProperties
Properties that will be included in the user's session if/when it is created. -
sessionHooks
List of classes that are run after successful authentication. -
webhooks
List of webhooks that are run after session logout. -
universalId
The identity objects universal id. -
identifiedIdentity
The identified users. -
maxTreeDuration
The maximum duration of the tree.
-
Method Details
-
toJson
Returns the JsonValue format of the TreeState object.- Returns:
- JsonValue object of TreeState.
-
fromJson
Returns a TreeState object from the JsonValue.- Parameters:
json
- Json representation of the TreeState object.maxSessionTime
- the maximum session time.- Returns:
- TreeState object
-
createInitial
public static TreeState createInitial(Realm realm, Integer targetAuthLevel, Map<String, Object> initialData, int maxTreeDuration) Creates a tree state that represents start of authentication tree.- Parameters:
realm
- the realm in which the authentication is taking place.targetAuthLevel
- minimum auth level required for authentication.initialData
- the initial data passed to the newly created tree.maxTreeDuration
- the maximum duration of the authentication.- Returns:
- the initial TreeState
-
secureState
The secure state populated by transient state which is promoted to be retained across callback boundaries. Values are promoted to secure state from transient state under the condition that we are returning to the user with callbacks, and the key-data in transient state is marked as required by a node further down the tree. Data in secure state is encrypted, and stored within the shared state. As data may be promoted to secureState from transientState, secureState should not be accessed directly, but rather via theTreeContext.getState(String)
method.- Returns:
- The secure state.
-
unencryptedSecureState
The optional unencrypted secure state. This should never be added to the tree result JSON.- Returns:
- The unencrypted secure state.
-
builder
Creates a new TreeState builder.- Returns:
- the builder
-