Class: Infrawrench::SshKeysNamespace
- Inherits:
-
Object
- Object
- Infrawrench::SshKeysNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.ssh_keys
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Generate a new Ed25519 keypair (private key returned once).
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete an SSH key (owner only).
-
#import(body:, org_id: nil, request_options: nil) ⇒ Hash
Import an existing public key.
-
#initialize(transport) ⇒ SshKeysNamespace
constructor
private
A new instance of SshKeysNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List org SSH keys.
-
#sign(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Sign an SSH auth challenge with a cloud-held key (the cloud as an SSH agent).
Constructor Details
#initialize(transport) ⇒ SshKeysNamespace
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 SshKeysNamespace.
14178 14179 14180 |
# File 'lib/infrawrench/client.rb', line 14178 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Generate a new Ed25519 keypair (private key returned once)
Requires permission: ssh-keys:write.
POST /api/org/orgId/ssh-keys
Raises on 400: Bad request
14196 14197 14198 14199 14200 14201 14202 14203 14204 |
# File 'lib/infrawrench/client.rb', line 14196 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/ssh-keys", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete an SSH key (owner only)
Requires permission: ssh-keys:write.
DELETE /api/org/orgId/ssh-keys/id
14218 14219 14220 14221 14222 14223 14224 14225 |
# File 'lib/infrawrench/client.rb', line 14218 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/ssh-keys/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#import(body:, org_id: nil, request_options: nil) ⇒ Hash
Import an existing public key
Requires permission: ssh-keys:write.
POST /api/org/orgId/ssh-keys/import
Raises on 400: Bad request
14241 14242 14243 14244 14245 14246 14247 14248 14249 |
# File 'lib/infrawrench/client.rb', line 14241 def import(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/ssh-keys/import", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List org SSH keys
Requires permission: ssh-keys:read.
GET /api/org/orgId/ssh-keys
14263 14264 14265 14266 14267 14268 14269 14270 |
# File 'lib/infrawrench/client.rb', line 14263 def list(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/ssh-keys", path_params: { "orgId" => org_id }, request_options: ) end |
#sign(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Sign an SSH auth challenge with a cloud-held key (the cloud as an SSH agent)
Signs one publickey-authentication challenge with a server-generated org
key whose private half never leaves Infrawrench Cloud. Requires the
resources:execute permission — producing an auth signature is the same
authority as opening a shell. Imported keys cannot sign (only their public
half is stored). Every call is audited.
POST /api/org/orgId/ssh-keys/id/sign
Raises on 400: Bad request
Raises on 404: Not found
14295 14296 14297 14298 14299 14300 14301 14302 14303 |
# File 'lib/infrawrench/client.rb', line 14295 def sign(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/ssh-keys/{id}/sign", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |