Class RuleCreateParams
-
- All Implemented Interfaces:
-
com.anthropic.core.Params
public final class RuleCreateParams implements Params
Requires an OAuth access token with the
org:adminscope, fromant auth login --scope org:adminor a workload identity federation rule; Admin API keys are not accepted. See /docs/en/manage-claude/wif-admin-api.Create a federation rule owned by your organization.
The referenced issuer and the target service account must already exist in the same organization; invalid references are rejected with a 400 error. The workspace reference is validated. Membership is not checked at rule creation: token exchange resolves a single enabled workspace per call and is rejected unless the target service account is a member of that workspace (it is implicitly a member of the default workspace). Rules on well-known shared issuers (GitHub Actions, GitLab, Buildkite, Terraform Cloud, Google) must constrain tenant identity via an identity-bearing claim, a tenant-pinning subject prefix (such as
repo:YOUR_ORG/...), or a CEL condition referencing one of those identity claims (e.g.claims.repository_owner). OAuth callers may only manage rules whoseoauth_scopeisworkspace:developerorworkspace:inference; other scopes require a Console session.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classRuleCreateParams.BuilderA builder for RuleCreateParams.
public final classRuleCreateParams.Body
-
Method Summary
Modifier and Type Method Description final StringissuerId()Tagged ID of the federation issuer. final FederationRuleMatchmatch()Conditions the verified JWT must satisfy for this rule to apply. final Stringname()Slug identifier (lowercase, digits, hyphens). final StringoauthScope()Space-separated OAuth scopes. final ServiceAccountTargettarget()Identity that tokens minted via this rule act as. final Optional<Boolean>appliesToAllWorkspaces()When true, enable this rule for every workspace in the org (including workspaces created later). final Optional<String>description()Optional free-text description. final Optional<Long>tokenLifetimeSeconds()Lifetime in seconds for access tokens minted via this rule (60-86400). final Optional<String>workspaceId()Tagged ID of the workspace to enable this rule for. final JsonField<String>_issuerId()Returns the raw JSON value of issuerId. 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<Boolean>_appliesToAllWorkspaces()Returns the raw JSON value of appliesToAllWorkspaces. final JsonField<String>_description()Returns the raw JSON value of description. final JsonField<Long>_tokenLifetimeSeconds()Returns the raw JSON value of tokenLifetimeSeconds. final JsonField<String>_workspaceId()Returns the raw JSON value of workspaceId. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final RuleCreateParams.BuildertoBuilder()final RuleCreateParams.Body_body()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. SpanData_spanData()The data for the OpenTelemetry span of a call to the method with these parameters. Booleanequals(Object other)IntegerhashCode()StringtoString()final static RuleCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of RuleCreateParams. -
-
Method Detail
-
match
final FederationRuleMatch match()
Conditions the verified JWT must satisfy for this rule to apply. At least one of
subject_prefix(other than a wildcard-only value like*),claims, orconditionis required;audiencealone is not sufficient.
-
name
final String name()
Slug identifier (lowercase, digits, hyphens). Unique within the organization; a duplicate name returns 409.
-
oauthScope
final String oauthScope()
Space-separated OAuth scopes. OAuth callers may only set
workspace:developerorworkspace:inference; other scopes (such asorg:admin) require a Console session.
-
target
final ServiceAccountTarget target()
Identity that tokens minted via this rule act as. Currently always a
service_accounttarget.
-
appliesToAllWorkspaces
final Optional<Boolean> appliesToAllWorkspaces()
When true, enable this rule for every workspace in the org (including workspaces created later).
-
description
final Optional<String> description()
Optional free-text description.
-
tokenLifetimeSeconds
final Optional<Long> tokenLifetimeSeconds()
Lifetime in seconds for access tokens minted via this rule (60-86400). Defaults to 3600 (1h). Minted tokens are capped at
max(60, min(this value, 2 × remaining assertion validity))seconds.
-
workspaceId
final Optional<String> workspaceId()
Tagged ID of the workspace to enable this rule for. Required unless
applies_to_all_workspacesis true. Additional workspaces can be added via the/federation_rules/{federation_rule_id}/workspacessub-resource.
-
_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.
-
_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.
-
_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.
-
_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.
-
_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.
-
_workspaceId
final JsonField<String> _workspaceId()
Returns the raw JSON value of workspaceId.
Unlike workspaceId, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final RuleCreateParams.Builder toBuilder()
-
_body
final RuleCreateParams.Body _body()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
_spanData
SpanData _spanData()
The data for the OpenTelemetry span of a call to the method with these parameters.
-
builder
final static RuleCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of RuleCreateParams.
The following fields are required:
.issuerId() .match() .name() .oauthScope() .target()
-
-
-
-