Class: Infrawrench::AccountsCredentialsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::AccountsCredentialsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.accounts.credentials
Instance Method Summary collapse
-
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Fetch the decrypted credentials for an account.
-
#initialize(transport) ⇒ AccountsCredentialsNamespace
constructor
private
A new instance of AccountsCredentialsNamespace.
-
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Rotate the credentials an account uses to talk to the upstream provider.
Constructor Details
#initialize(transport) ⇒ AccountsCredentialsNamespace
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 AccountsCredentialsNamespace.
20 21 22 |
# File 'lib/infrawrench/client.rb', line 20 def initialize(transport) @transport = transport end |
Instance Method Details
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Fetch the decrypted credentials for an account
Returns the credentials map as it was originally submitted. Sensitive — gate access carefully.
Requires permission: secrets:read.
GET /api/org/orgId/accounts/id/credentials
Raises on 404: Not found
41 42 43 44 45 46 47 48 |
# File 'lib/infrawrench/client.rb', line 41 def get(id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/accounts/{id}/credentials", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Rotate the credentials an account uses to talk to the upstream provider
Replaces the encrypted credentials blob in place. Used to swap a stale or narrowly-scoped token for a freshly-minted one without recreating the account (preserves existing resources, pins, dashboards, sync history).
Requires permission: secrets:write.
PUT /api/org/orgId/accounts/id/credentials
Raises on 400: Bad request
Raises on 404: Not found
71 72 73 74 75 76 77 78 79 |
# File 'lib/infrawrench/client.rb', line 71 def update(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/accounts/{id}/credentials", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |