Class: Infrawrench::AgentIdentityNamespace

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

Overview

client.agent.identity

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ AgentIdentityNamespace

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 AgentIdentityNamespace.

Parameters:



936
937
938
# File 'lib/infrawrench/client.rb', line 936

def initialize(transport)
  @transport = transport
end

Instance Method Details

#claim(request_options: nil) ⇒ Hash

Start the claim ceremony and mint a user code

Returns a code to show the user together with the verification URL. Replaces any code already outstanding for this registration.

POST /api/agent/identity/claim

Raises on 400: Already claimed

Raises on 401: Unknown or revoked credential

Raises on 403: Registration revoked

Parameters:

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

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

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

Returns:

  • (Hash)

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

Raises:



956
957
958
959
960
961
962
# File 'lib/infrawrench/client.rb', line 956

def claim(request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/agent/identity/claim",
    request_options: request_options
  )
end

#create(body: nil, request_options: nil) ⇒ Hash

Open an anonymous registration and a 24-hour trial workspace

Requires no authentication — this is how a client with no credentials gets one. Rate limited per source address. The workspace it opens is deleted 24 hours later unless a person completes the claim ceremony.

POST /api/agent/identity

Raises on 429: Too many registrations from this address

Raises on 500: Could not open a workspace

Parameters:

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

    Request body, shaped as AgentRegisterRequest.

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

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

  • body: (agent_register_request, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



980
981
982
983
984
985
986
987
# File 'lib/infrawrench/client.rb', line 980

def create(body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/agent/identity",
    body: body,
    request_options: request_options
  )
end

#get(request_options: nil) ⇒ Hash

Poll this registration's claim status and time remaining

GET /api/agent/identity

Raises on 401: Unknown or revoked credential

Raises on 404: Unknown registration

Parameters:

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

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

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

Returns:

  • (Hash)

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

Raises:



1000
1001
1002
1003
1004
1005
1006
# File 'lib/infrawrench/client.rb', line 1000

def get(request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/agent/identity",
    request_options: request_options
  )
end