Module org.elasticsearch.xcore
Record Class AuthorizationEngine.ParentActionAuthorization
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.ParentActionAuthorization
- Record Components:
action- the parent action
- All Implemented Interfaces:
Writeable
- Enclosing interface:
AuthorizationEngine
public static record AuthorizationEngine.ParentActionAuthorization(String action)
extends Record
implements Writeable
Holds information about authorization of a parent action which is used to pre-authorize its child actions.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParentActionAuthorization(String action) Creates an instance of aParentActionAuthorizationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.readFrom(StreamInput in) Reads anAuthorizationEngine.ParentActionAuthorizationfrom aStreamInputreadFromThreadContext(ThreadContext context) Read and deserialize parent authorization from thread context.final StringtoString()Returns a string representation of this record class.voidwriteTo(StreamOutput out) voidwriteToThreadContext(ThreadContext context) Writes the authorization to the context.
-
Field Details
-
THREAD_CONTEXT_KEY
- See Also:
-
-
Constructor Details
-
ParentActionAuthorization
Creates an instance of aParentActionAuthorizationrecord class.- Parameters:
action- the value for theactionrecord component
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
readFrom
public static AuthorizationEngine.ParentActionAuthorization readFrom(StreamInput in) throws IOException Reads anAuthorizationEngine.ParentActionAuthorizationfrom aStreamInput- Parameters:
in- theStreamInputto read from- Returns:
AuthorizationEngine.ParentActionAuthorization- Throws:
IOException- if I/O operation fails
-
readFromThreadContext
@Nullable public static AuthorizationEngine.ParentActionAuthorization readFromThreadContext(ThreadContext context) throws IOException Read and deserialize parent authorization from thread context.- Parameters:
context- the thread context to read from- Returns:
AuthorizationEngine.ParentActionAuthorizationor null- Throws:
IOException- if reading fails due to I/O exception
-
writeToThreadContext
Writes the authorization to the context. There must not be an existing authorization in the context and if there is anIllegalStateExceptionwill be thrown.- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-