Package org.a2aproject.sdk.spec
Record Class AuthenticationInfo
java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.AuthenticationInfo
- Record Components:
scheme- security scheme name for authentication (required)credentials- optional credentials string (format depends on scheme, e.g., base64-encoded for Basic auth)
Authentication information for agent authentication and push notification endpoints.
This record encapsulates authentication schemes and credentials for two primary use cases:
- Agent Authentication: Clients authenticate to access protected agent resources.
The
schemereference a security scheme fromAgentCard.securitySchemes(). - Push Notification Authentication: Agents authenticate when POSTing task updates to client-provided push notification endpoints. Supports HTTP Basic, Bearer tokens, API keys, OAuth.
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationInfo(String scheme, String credentials) Compact constructor that validates required fields. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecredentialsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.scheme()Returns the value of theschemerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AuthenticationInfo
Compact constructor that validates required fields.- Parameters:
scheme- the schemes parameter (see class-level JavaDoc)credentials- the credentials parameter (see class-level JavaDoc)- Throws:
IllegalArgumentException- if schemes is null
-
-
Method Details
-
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). -
scheme
Returns the value of theschemerecord component.- Returns:
- the value of the
schemerecord component
-
credentials
Returns the value of thecredentialsrecord component.- Returns:
- the value of the
credentialsrecord component
-