Class: Infrawrench::AccountsCredentialsNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.accounts.credentials

Instance Method Summary collapse

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.

Parameters:



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

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as Hash — see sig/infrawrench/sdk.rbs.

Raises:



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: 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

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • body (Hash)

    Request body, shaped as Hash.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • body: ({ "credentials" => Hash[String, String] })
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as Hash — see sig/infrawrench/sdk.rbs.

Raises:



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: request_options
  )
end