Class FederationRule
-
- All Implemented Interfaces:
public final class FederationRuleAuthorization rule binding an external OIDC identity to Anthropic.
Evaluates the match conditions and mints an OAuth access token for the resolved target, scoped to a single workspace where the rule is enabled (chosen by the caller at exchange time when the rule is enabled for more than one). For rules enabled via
workspace_idsorapplies_to_all_workspaces, the target service account must be a member of that workspace (it is implicitly a member of the default workspace); rules carrying only the legacyworkspace_idbinding do not enforce this.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFederationRule.BuilderA builder for FederationRule.
-
Method Summary
Modifier and Type Method Description final Stringid()Tagged ID of the federation rule. final BooleanappliesToAllWorkspaces()When true, this rule is enabled for every workspace in the org (including ones created after the rule). final Optional<OffsetDateTime>archivedAt()If set, this rule is archived and rejects token exchange. final Optional<String>archivedByActorId()Tagged ID ( user_/svac_) of the actor that archived this rule.final OffsetDateTimecreatedAt()When this rule was created. final Optional<String>createdByActorId()Tagged ID ( user_/svac_) of the actor that created this rule.final Optional<String>description()Optional free-text description. final StringissuerId()Tagged ID of the issuer whose tokens this rule accepts. final Optional<String>issuerName()Issuer's display name at read time. final FederationRuleMatchmatch()Conditions the verified JWT must satisfy for this rule to apply. final Stringname()Admin-chosen slug identifier. final StringoauthScope()Space-separated OAuth scopes granted on the minted token. final ServiceAccountTargettarget()What this rule targets. final LongtokenLifetimeSeconds()Lifetime in seconds of access tokens minted via this rule. final OffsetDateTimeupdatedAt()When this rule was last updated. final Optional<String>updatedByActorId()Tagged ID ( user_/svac_) of the actor that last updated this rule.final List<String>workspaceIds()Tagged IDs of the workspaces this rule is enabled for. final JsonValue_type()Expected to always return the following:
However, this method can be useful for debugging and logging (e.g.JsonValue.from("federation_rule")final JsonField<String>_id()Returns the raw JSON value of id. final JsonField<Boolean>_appliesToAllWorkspaces()Returns the raw JSON value of appliesToAllWorkspaces. final JsonField<OffsetDateTime>_archivedAt()Returns the raw JSON value of archivedAt. final JsonField<String>_archivedByActorId()Returns the raw JSON value of archivedByActorId. final JsonField<OffsetDateTime>_createdAt()Returns the raw JSON value of createdAt. final JsonField<String>_createdByActorId()Returns the raw JSON value of createdByActorId. final JsonField<String>_description()Returns the raw JSON value of description. final JsonField<String>_issuerId()Returns the raw JSON value of issuerId. final JsonField<String>_issuerName()Returns the raw JSON value of issuerName. final JsonField<FederationRuleMatch>_match()Returns the raw JSON value of match. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<String>_oauthScope()Returns the raw JSON value of oauthScope. final JsonField<ServiceAccountTarget>_target()Returns the raw JSON value of target. final JsonField<Long>_tokenLifetimeSeconds()Returns the raw JSON value of tokenLifetimeSeconds. final JsonField<OffsetDateTime>_updatedAt()Returns the raw JSON value of updatedAt. final JsonField<String>_updatedByActorId()Returns the raw JSON value of updatedByActorId. final JsonField<List<String>>_workspaceIds()Returns the raw JSON value of workspaceIds. final Map<String, JsonValue>_additionalProperties()final FederationRule.BuildertoBuilder()final FederationRulevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static FederationRule.Builderbuilder()Returns a mutable builder for constructing an instance of FederationRule. -
-
Method Detail
-
appliesToAllWorkspaces
final Boolean appliesToAllWorkspaces()
When true, this rule is enabled for every workspace in the org (including ones created after the rule).
workspace_idsis ignored at exchange time.
-
archivedAt
final Optional<OffsetDateTime> archivedAt()
If set, this rule is archived and rejects token exchange.
-
archivedByActorId
final Optional<String> archivedByActorId()
Tagged ID (
user_/svac_) of the actor that archived this rule.
-
createdAt
final OffsetDateTime createdAt()
When this rule was created.
-
createdByActorId
final Optional<String> createdByActorId()
Tagged ID (
user_/svac_) of the actor that created this rule.
-
description
final Optional<String> description()
Optional free-text description.
-
issuerName
final Optional<String> issuerName()
Issuer's display name at read time.
-
match
final FederationRuleMatch match()
Conditions the verified JWT must satisfy for this rule to apply. All populated matcher fields must pass.
-
oauthScope
final String oauthScope()
Space-separated OAuth scopes granted on the minted token.
-
target
final ServiceAccountTarget target()
What this rule targets. Check
typebefore reading the other fields. Tokens minted via a rule whose targettypeisservice_accountact as that service account.
-
tokenLifetimeSeconds
final Long tokenLifetimeSeconds()
Lifetime in seconds of access tokens minted via this rule. Minted tokens are capped at
max(60, min(this value, 2 × remaining assertion validity))seconds.
-
updatedAt
final OffsetDateTime updatedAt()
When this rule was last updated.
-
updatedByActorId
final Optional<String> updatedByActorId()
Tagged ID (
user_/svac_) of the actor that last updated this rule.
-
workspaceIds
final List<String> workspaceIds()
Tagged IDs of the workspaces this rule is enabled for. May be empty for older rules that only carry the legacy
workspace_idbinding. Ignored at exchange time whenapplies_to_all_workspacesis true (the list may still be non-empty).
-
_type
final JsonValue _type()
Expected to always return the following:
JsonValue.from("federation_rule")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_appliesToAllWorkspaces
final JsonField<Boolean> _appliesToAllWorkspaces()
Returns the raw JSON value of appliesToAllWorkspaces.
Unlike appliesToAllWorkspaces, this method doesn't throw if the JSON field has an unexpected type.
-
_archivedAt
final JsonField<OffsetDateTime> _archivedAt()
Returns the raw JSON value of archivedAt.
Unlike archivedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_archivedByActorId
final JsonField<String> _archivedByActorId()
Returns the raw JSON value of archivedByActorId.
Unlike archivedByActorId, this method doesn't throw if the JSON field has an unexpected type.
-
_createdAt
final JsonField<OffsetDateTime> _createdAt()
Returns the raw JSON value of createdAt.
Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.
-
_createdByActorId
final JsonField<String> _createdByActorId()
Returns the raw JSON value of createdByActorId.
Unlike createdByActorId, this method doesn't throw if the JSON field has an unexpected type.
-
_description
final JsonField<String> _description()
Returns the raw JSON value of description.
Unlike description, this method doesn't throw if the JSON field has an unexpected type.
-
_issuerId
final JsonField<String> _issuerId()
Returns the raw JSON value of issuerId.
Unlike issuerId, this method doesn't throw if the JSON field has an unexpected type.
-
_issuerName
final JsonField<String> _issuerName()
Returns the raw JSON value of issuerName.
Unlike issuerName, this method doesn't throw if the JSON field has an unexpected type.
-
_match
final JsonField<FederationRuleMatch> _match()
Returns the raw JSON value of match.
Unlike match, this method doesn't throw if the JSON field has an unexpected type.
-
_name
final JsonField<String> _name()
Returns the raw JSON value of name.
Unlike name, this method doesn't throw if the JSON field has an unexpected type.
-
_oauthScope
final JsonField<String> _oauthScope()
Returns the raw JSON value of oauthScope.
Unlike oauthScope, this method doesn't throw if the JSON field has an unexpected type.
-
_target
final JsonField<ServiceAccountTarget> _target()
Returns the raw JSON value of target.
Unlike target, this method doesn't throw if the JSON field has an unexpected type.
-
_tokenLifetimeSeconds
final JsonField<Long> _tokenLifetimeSeconds()
Returns the raw JSON value of tokenLifetimeSeconds.
Unlike tokenLifetimeSeconds, this method doesn't throw if the JSON field has an unexpected type.
-
_updatedAt
final JsonField<OffsetDateTime> _updatedAt()
Returns the raw JSON value of updatedAt.
Unlike updatedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_updatedByActorId
final JsonField<String> _updatedByActorId()
Returns the raw JSON value of updatedByActorId.
Unlike updatedByActorId, this method doesn't throw if the JSON field has an unexpected type.
-
_workspaceIds
final JsonField<List<String>> _workspaceIds()
Returns the raw JSON value of workspaceIds.
Unlike workspaceIds, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final FederationRule.Builder toBuilder()
-
validate
final FederationRule validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static FederationRule.Builder builder()
Returns a mutable builder for constructing an instance of FederationRule.
The following fields are required:
.id() .appliesToAllWorkspaces() .archivedAt() .archivedByActorId() .createdAt() .createdByActorId() .description() .issuerId() .issuerName() .match() .name() .oauthScope() .target() .tokenLifetimeSeconds() .updatedAt() .updatedByActorId() .workspaceIds()
-
-
-
-