Class: Infrawrench::AgentClaimNamespace
- Inherits:
-
Object
- Object
- Infrawrench::AgentClaimNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.agent.claim
Instance Method Summary collapse
-
#create(body: nil, request_options: nil) ⇒ Hash
Confirm a claim, binding the workspace to the signed-in user.
-
#initialize(transport) ⇒ AgentClaimNamespace
constructor
private
A new instance of AgentClaimNamespace.
-
#lookup(body: nil, request_options: nil) ⇒ Hash
Resolve a user code so the claim page can show what is being claimed.
Constructor Details
#initialize(transport) ⇒ AgentClaimNamespace
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 AgentClaimNamespace.
864 865 866 |
# File 'lib/infrawrench/client.rb', line 864 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body: nil, request_options: nil) ⇒ Hash
Confirm a claim, binding the workspace to the signed-in user
The code is re-resolved here rather than trusting a registration id from the lookup, so the lookup cannot be used as an oracle. Rate limited per user.
POST /api/agent/claim
Raises on 400: Bad code, already claimed, revoked, or a merge with no valid target
Raises on 401: Unauthenticated
Raises on 402: The merge would put a free target organization over its plan limits
Raises on 403: You lack the permission the merge needs in the target
organization (accounts:write, plus costs:write when moving history).
Raises on 429: Too many attempts
893 894 895 896 897 898 899 900 |
# File 'lib/infrawrench/client.rb', line 893 def create(body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/agent/claim", body: body, request_options: ) end |
#lookup(body: nil, request_options: nil) ⇒ Hash
Resolve a user code so the claim page can show what is being claimed
A POST rather than a GET with the code in the path: the code is a live
bearer secret for 15 minutes, and a URL lands in history, in Referer,
and in access logs. Rate limited per user.
POST /api/agent/claim/lookup
Raises on 400: Missing, malformed, or expired code
Raises on 401: Unauthenticated
Raises on 404: The workspace no longer exists
Raises on 429: Too many attempts
922 923 924 925 926 927 928 929 |
# File 'lib/infrawrench/client.rb', line 922 def lookup(body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/agent/claim/lookup", body: body, request_options: ) end |