Class: Anthropic::Resources::Beta::Organization::Federation::Rules
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Organization::Federation::Rules
- Defined in:
- lib/anthropic/resources/beta/organization/federation/rules.rb,
lib/anthropic/resources/beta/organization/federation/rules/workspaces.rb,
sig/anthropic/resources/beta/organization/federation/rules.rbs,
sig/anthropic/resources/beta/organization/federation/rules/workspaces.rbs
Defined Under Namespace
Classes: Workspaces
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#archive(federation_rule_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
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. -
#create(issuer_id:, match:, name:, oauth_scope:, target:, applies_to_all_workspaces: nil, attributes: nil, description: nil, token_lifetime_seconds: nil, workspace_id: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
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. -
#initialize(client:) ⇒ Rules
constructor
private
A new instance of Rules.
-
#list(include_archived: nil, issuer_id: nil, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Organization::Federation::BetaFederationRule>
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. -
#retrieve(federation_rule_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
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. -
#update(federation_rule_id, applies_to_all_workspaces: nil, attributes: nil, description: nil, match: nil, name: nil, oauth_scope: nil, target: nil, token_lifetime_seconds: nil, workspace_id: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
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.
Constructor Details
#initialize(client:) ⇒ Rules
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Rules.
256 257 258 259 |
# File 'lib/anthropic/resources/beta/organization/federation/rules.rb', line 256 def initialize(client:) @client = client @workspaces = Anthropic::Resources::Beta::Organization::Federation::Rules::Workspaces.new(client: client) end |
Instance Attribute Details
#workspaces ⇒ Anthropic::Resources::Beta::Organization::Federation::Rules::Workspaces (readonly)
10 11 12 |
# File 'lib/anthropic/resources/beta/organization/federation/rules.rb', line 10 def workspaces @workspaces end |
Instance Method Details
#archive(federation_rule_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
Requires an OAuth access token with the org:admin scope, from
ant auth login --scope org:admin or a workload identity federation rule; Admin
API keys are not accepted. See
Manage WIF with the Admin API.
Archive a federation rule.
Token exchange through this rule stops immediately. Idempotent; re-archiving
returns the rule with its original archived_at. Archiving clears the rule's
workspace targeting (workspace_id and workspace_ids are emptied). Tokens
already minted before archive remain valid until they expire. OAuth callers may
only manage rules whose oauth_scope is workspace:developer or
workspace:inference; other scopes require a Console session.
242 243 244 245 246 247 248 249 250 251 |
# File 'lib/anthropic/resources/beta/organization/federation/rules.rb', line 242 def archive(federation_rule_id, params = {}) parsed, = Anthropic::Beta::Organization::Federation::RuleArchiveParams.dump_request(params) @client.request( method: :post, path: ["v1/organizations/federation_rules/%1$s/archive?beta=true", federation_rule_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::Organization::Federation::BetaFederationRule, options: ) end |
#create(issuer_id:, match:, name:, oauth_scope:, target:, applies_to_all_workspaces: nil, attributes: nil, description: nil, token_lifetime_seconds: nil, workspace_id: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
Requires an OAuth access token with the org:admin scope, from
ant auth login --scope org:admin or a workload identity federation rule; Admin
API keys are not accepted. See
Manage WIF with the 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 whose oauth_scope is workspace:developer or
workspace:inference; other scopes require a Console session.
Some parameter documentations has been truncated, see Models::Beta::Organization::Federation::RuleCreateParams for more details.
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/anthropic/resources/beta/organization/federation/rules.rb', line 65 def create(params) parsed, = Anthropic::Beta::Organization::Federation::RuleCreateParams.dump_request(params) header_params = {betas: "anthropic-beta"} @client.request( method: :post, path: "v1/organizations/federation_rules?beta=true", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::Organization::Federation::BetaFederationRule, options: ) end |
#list(include_archived: nil, issuer_id: nil, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Organization::Federation::BetaFederationRule>
Requires an OAuth access token with the org:admin scope, from
ant auth login --scope org:admin or a workload identity federation rule; Admin
API keys are not accepted. See
Manage WIF with the Admin API.
List federation rules in your organization.
Optionally filter by issuer with issuer_id. Archived rules are excluded unless
include_archived=true.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/anthropic/resources/beta/organization/federation/rules.rb', line 202 def list(params = {}) query_params = [:include_archived, :issuer_id, :limit, :page] parsed, = Anthropic::Beta::Organization::Federation::RuleListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/organizations/federation_rules?beta=true", query: query, headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"), page: Anthropic::Internal::PageCursor, model: Anthropic::Beta::Organization::Federation::BetaFederationRule, options: ) end |
#retrieve(federation_rule_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
Requires an OAuth access token with the org:admin scope, from
ant auth login --scope org:admin or a workload identity federation rule; Admin
API keys are not accepted. See
Manage WIF with the Admin API.
Retrieve a federation rule by its ID (fdrl_...).
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/anthropic/resources/beta/organization/federation/rules.rb', line 96 def retrieve(federation_rule_id, params = {}) parsed, = Anthropic::Beta::Organization::Federation::RuleRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/organizations/federation_rules/%1$s?beta=true", federation_rule_id], headers: parsed.transform_keys(betas: "anthropic-beta"), model: Anthropic::Beta::Organization::Federation::BetaFederationRule, options: ) end |
#update(federation_rule_id, applies_to_all_workspaces: nil, attributes: nil, description: nil, match: nil, name: nil, oauth_scope: nil, target: nil, token_lifetime_seconds: nil, workspace_id: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Organization::Federation::BetaFederationRule
Requires an OAuth access token with the org:admin scope, from
ant auth login --scope org:admin or a workload identity federation rule; Admin
API keys are not accepted. See
Manage WIF with the Admin API.
Partially update a federation rule.
issuer_id is immutable. match and target are replaced as whole objects
when set. Referenced service accounts and workspaces must exist in your
organization; invalid references are rejected with a 400 error. Archived rules
cannot be updated; this returns 400. Create a new rule instead. 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). On
these issuers the requirement is re-checked on every update; if an existing
rule's stored match does not yet constrain tenant identity, any update (even a
rename or description change) must also supply a conforming match in the same
request. OAuth callers may only manage rules whose oauth_scope is
workspace:developer or workspace:inference; other scopes require a Console
session.
Some parameter documentations has been truncated, see Models::Beta::Organization::Federation::RuleUpdateParams for more details.
162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/anthropic/resources/beta/organization/federation/rules.rb', line 162 def update(federation_rule_id, params = {}) parsed, = Anthropic::Beta::Organization::Federation::RuleUpdateParams.dump_request(params) header_params = {betas: "anthropic-beta"} @client.request( method: :post, path: ["v1/organizations/federation_rules/%1$s?beta=true", federation_rule_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Anthropic::Beta::Organization::Federation::BetaFederationRule, options: ) end |