Class: OryClient::APIKeysApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ory-client/api/api_keys_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ APIKeysApi

Returns a new instance of APIKeysApi.



19
20
21
# File 'lib/ory-client/api/api_keys_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ory-client/api/api_keys_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#admin_batch_import_api_keys(batch_import_api_keys_request, opts = {}) ⇒ BatchImportAPIKeysResponse

Batch Import API Keys Imports up to 1000 external API keys in one request. Returns per-item results. If at least one item succeeds, response is 200 OK. If all items fail, the endpoint returns a non-200 error. “‘http POST /v2alpha1/admin/importedApiKeys:batchImport { "requests": [ "sk_live_abc", "name": "Stripe key", "actor_id": "user_1", "ghp_xyz", "name": "GitHub PAT", "actor_id": "user_2" ] } “`

Parameters:

  • batch_import_api_keys_request (BatchImportAPIKeysRequest)

    BatchImportAPIKeysRequest imports multiple external API keys in one request. The maximum batch size is 1000 keys.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/ory-client/api/api_keys_api.rb', line 27

def admin_batch_import_api_keys(batch_import_api_keys_request, opts = {})
  data, _status_code, _headers = admin_batch_import_api_keys_with_http_info(batch_import_api_keys_request, opts)
  data
end

#admin_batch_import_api_keys_with_http_info(batch_import_api_keys_request, opts = {}) ⇒ Array<(BatchImportAPIKeysResponse, Integer, Hash)>

Batch Import API Keys Imports up to 1000 external API keys in one request. Returns per-item results. If at least one item succeeds, response is 200 OK. If all items fail, the endpoint returns a non-200 error. &#x60;&#x60;&#x60;http POST /v2alpha1/admin/importedApiKeys:batchImport { &quot;requests&quot;: [ &quot;sk_live_abc&quot;, &quot;name&quot;: &quot;Stripe key&quot;, &quot;actor_id&quot;: &quot;user_1&quot;, &quot;ghp_xyz&quot;, &quot;name&quot;: &quot;GitHub PAT&quot;, &quot;actor_id&quot;: &quot;user_2&quot; ] } &#x60;&#x60;&#x60;

Parameters:

  • batch_import_api_keys_request (BatchImportAPIKeysRequest)

    BatchImportAPIKeysRequest imports multiple external API keys in one request. The maximum batch size is 1000 keys.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BatchImportAPIKeysResponse, Integer, Hash)>)

    BatchImportAPIKeysResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/ory-client/api/api_keys_api.rb', line 37

def admin_batch_import_api_keys_with_http_info(batch_import_api_keys_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_batch_import_api_keys ...'
  end
  # verify the required parameter 'batch_import_api_keys_request' is set
  if @api_client.config.client_side_validation && batch_import_api_keys_request.nil?
    fail ArgumentError, "Missing the required parameter 'batch_import_api_keys_request' when calling APIKeysApi.admin_batch_import_api_keys"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/importedApiKeys:batchImport'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_import_api_keys_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchImportAPIKeysResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_batch_import_api_keys",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_batch_import_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_batch_verify_api_keys(batch_verify_api_keys_request, opts = {}) ⇒ BatchVerifyAPIKeysResponse

Batch Verify API Keys Verifies multiple credentials in a single request. Efficiently verifies up to 100 credentials in parallel. Each credential is verified independently; partial failures are returned. Admin access only. Cache Control (HTTP Headers): - Cache-Control: no-cache - Bypasses cache read, forces fresh DB lookup - Cache-Control: no-store - Bypasses cache read AND write (never cached) - Pragma: no-cache - Same as Cache-Control: no-cache (HTTP/1.0) The cache directive applies to every credential in the batch. “‘http POST /v2alpha1/admin/apiKeys:batchVerify { "requests": [ "sk_live_abc123…", "eyJhbGciOiJFZERTQSI…" ] } “`

Parameters:

Options Hash (opts):

  • :cache_control (String)

    Cache-directive controlling the verifier cache. &#x60;no-cache&#x60; forces a fresh database lookup (cache read is bypassed). &#x60;no-store&#x60; additionally prevents the result from being written to the cache. Any other value is ignored.

  • :pragma (String)

    HTTP/1.0 alias for &#x60;Cache-Control: no-cache&#x60;. Behaves identically when set to &#x60;no-cache&#x60;; ignored otherwise.

Returns:



97
98
99
100
# File 'lib/ory-client/api/api_keys_api.rb', line 97

def admin_batch_verify_api_keys(batch_verify_api_keys_request, opts = {})
  data, _status_code, _headers = admin_batch_verify_api_keys_with_http_info(batch_verify_api_keys_request, opts)
  data
end

#admin_batch_verify_api_keys_with_http_info(batch_verify_api_keys_request, opts = {}) ⇒ Array<(BatchVerifyAPIKeysResponse, Integer, Hash)>

Batch Verify API Keys Verifies multiple credentials in a single request. Efficiently verifies up to 100 credentials in parallel. Each credential is verified independently; partial failures are returned. Admin access only. Cache Control (HTTP Headers): - Cache-Control: no-cache - Bypasses cache read, forces fresh DB lookup - Cache-Control: no-store - Bypasses cache read AND write (never cached) - Pragma: no-cache - Same as Cache-Control: no-cache (HTTP/1.0) The cache directive applies to every credential in the batch. &#x60;&#x60;&#x60;http POST /v2alpha1/admin/apiKeys:batchVerify { &quot;requests&quot;: [ &quot;sk_live_abc123…&quot;, &quot;eyJhbGciOiJFZERTQSI…&quot; ] } &#x60;&#x60;&#x60;

Parameters:

Options Hash (opts):

  • :cache_control (String)

    Cache-directive controlling the verifier cache. &#x60;no-cache&#x60; forces a fresh database lookup (cache read is bypassed). &#x60;no-store&#x60; additionally prevents the result from being written to the cache. Any other value is ignored.

  • :pragma (String)

    HTTP/1.0 alias for &#x60;Cache-Control: no-cache&#x60;. Behaves identically when set to &#x60;no-cache&#x60;; ignored otherwise.

Returns:

  • (Array<(BatchVerifyAPIKeysResponse, Integer, Hash)>)

    BatchVerifyAPIKeysResponse data, response status code and response headers



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/ory-client/api/api_keys_api.rb', line 109

def admin_batch_verify_api_keys_with_http_info(batch_verify_api_keys_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_batch_verify_api_keys ...'
  end
  # verify the required parameter 'batch_verify_api_keys_request' is set
  if @api_client.config.client_side_validation && batch_verify_api_keys_request.nil?
    fail ArgumentError, "Missing the required parameter 'batch_verify_api_keys_request' when calling APIKeysApi.admin_batch_verify_api_keys"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/apiKeys:batchVerify'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Cache-Control'] = opts[:'cache_control'] if !opts[:'cache_control'].nil?
  header_params[:'Pragma'] = opts[:'pragma'] if !opts[:'pragma'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_verify_api_keys_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchVerifyAPIKeysResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_batch_verify_api_keys",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_batch_verify_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_delete_imported_api_key(key_id, opts = {}) ⇒ Object

Delete Imported API Key Permanently deletes an imported key (hard delete). The key is removed from the database. Use RevokeAPIKey for soft deletion (recommended). “‘http DELETE /v2alpha1/admin/importedApiKeys/key_id “`

Parameters:

  • key_id (String)

    SHA512/256 hash of the imported key (REQUIRED)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


169
170
171
172
# File 'lib/ory-client/api/api_keys_api.rb', line 169

def admin_delete_imported_api_key(key_id, opts = {})
  data, _status_code, _headers = admin_delete_imported_api_key_with_http_info(key_id, opts)
  data
end

#admin_delete_imported_api_key_with_http_info(key_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete Imported API Key Permanently deletes an imported key (hard delete). The key is removed from the database. Use RevokeAPIKey for soft deletion (recommended). &#x60;&#x60;&#x60;http DELETE /v2alpha1/admin/importedApiKeys/key_id &#x60;&#x60;&#x60;

Parameters:

  • key_id (String)

    SHA512/256 hash of the imported key (REQUIRED)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/ory-client/api/api_keys_api.rb', line 179

def admin_delete_imported_api_key_with_http_info(key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_delete_imported_api_key ...'
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling APIKeysApi.admin_delete_imported_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/importedApiKeys/{key_id}'.sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_delete_imported_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_delete_imported_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_derive_token(derive_token_request, opts = {}) ⇒ DeriveTokenResponse

Derive Token Mints a short-lived JWT or Macaroon token from an API key. Works with both issued and imported keys. The derived token inherits the permissions of the parent API key. “‘http POST /v2alpha1/admin/apiKeys:derive { "credential": "eyJhbGciOiJFZERTQSI…", "ttl": "1h" } “`

Parameters:

  • derive_token_request (DeriveTokenRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



232
233
234
235
# File 'lib/ory-client/api/api_keys_api.rb', line 232

def admin_derive_token(derive_token_request, opts = {})
  data, _status_code, _headers = admin_derive_token_with_http_info(derive_token_request, opts)
  data
end

#admin_derive_token_with_http_info(derive_token_request, opts = {}) ⇒ Array<(DeriveTokenResponse, Integer, Hash)>

Derive Token Mints a short-lived JWT or Macaroon token from an API key. Works with both issued and imported keys. The derived token inherits the permissions of the parent API key. &#x60;&#x60;&#x60;http POST /v2alpha1/admin/apiKeys:derive { &quot;credential&quot;: &quot;eyJhbGciOiJFZERTQSI…&quot;, &quot;ttl&quot;: &quot;1h&quot; } &#x60;&#x60;&#x60;

Parameters:

  • derive_token_request (DeriveTokenRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeriveTokenResponse, Integer, Hash)>)

    DeriveTokenResponse data, response status code and response headers



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/ory-client/api/api_keys_api.rb', line 242

def admin_derive_token_with_http_info(derive_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_derive_token ...'
  end
  # verify the required parameter 'derive_token_request' is set
  if @api_client.config.client_side_validation && derive_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'derive_token_request' when calling APIKeysApi.admin_derive_token"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/apiKeys:derive'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(derive_token_request)

  # return_type
  return_type = opts[:debug_return_type] || 'DeriveTokenResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_derive_token",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_derive_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_get_imported_api_key(key_id, opts = {}) ⇒ ImportedAPIKey

Get Imported API Key Retrieves details about a specific imported key. Returns metadata about the imported key. The original raw key is never returned. “‘http GET /v2alpha1/admin/importedApiKeys/key_id “`

Parameters:

  • key_id (String)

    SHA512/256 hash of the imported key (REQUIRED)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



300
301
302
303
# File 'lib/ory-client/api/api_keys_api.rb', line 300

def admin_get_imported_api_key(key_id, opts = {})
  data, _status_code, _headers = admin_get_imported_api_key_with_http_info(key_id, opts)
  data
end

#admin_get_imported_api_key_with_http_info(key_id, opts = {}) ⇒ Array<(ImportedAPIKey, Integer, Hash)>

Get Imported API Key Retrieves details about a specific imported key. Returns metadata about the imported key. The original raw key is never returned. &#x60;&#x60;&#x60;http GET /v2alpha1/admin/importedApiKeys/key_id &#x60;&#x60;&#x60;

Parameters:

  • key_id (String)

    SHA512/256 hash of the imported key (REQUIRED)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ImportedAPIKey, Integer, Hash)>)

    ImportedAPIKey data, response status code and response headers



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/ory-client/api/api_keys_api.rb', line 310

def admin_get_imported_api_key_with_http_info(key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_get_imported_api_key ...'
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling APIKeysApi.admin_get_imported_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/importedApiKeys/{key_id}'.sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ImportedAPIKey'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_get_imported_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_get_imported_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_get_issued_api_key(key_id, opts = {}) ⇒ IssuedAPIKey

Get Issued API Key Retrieves details about a specific issued API key including its status, scopes, expiration, and usage statistics. The secret is never returned. “‘http GET /v2alpha1/admin/issuedApiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ “`

Parameters:

  • key_id (String)

    Identifier of the API key resource.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



363
364
365
366
# File 'lib/ory-client/api/api_keys_api.rb', line 363

def admin_get_issued_api_key(key_id, opts = {})
  data, _status_code, _headers = admin_get_issued_api_key_with_http_info(key_id, opts)
  data
end

#admin_get_issued_api_key_with_http_info(key_id, opts = {}) ⇒ Array<(IssuedAPIKey, Integer, Hash)>

Get Issued API Key Retrieves details about a specific issued API key including its status, scopes, expiration, and usage statistics. The secret is never returned. &#x60;&#x60;&#x60;http GET /v2alpha1/admin/issuedApiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ &#x60;&#x60;&#x60;

Parameters:

  • key_id (String)

    Identifier of the API key resource.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(IssuedAPIKey, Integer, Hash)>)

    IssuedAPIKey data, response status code and response headers



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/ory-client/api/api_keys_api.rb', line 373

def admin_get_issued_api_key_with_http_info(key_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_get_issued_api_key ...'
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling APIKeysApi.admin_get_issued_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/issuedApiKeys/{key_id}'.sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IssuedAPIKey'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_get_issued_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_get_issued_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_get_jwks(opts = {}) ⇒ GetJWKSResponse

Get JWKS Returns the JSON Web Key Set for token verification. Provides the public keys needed to verify JWT tokens issued by this service. Keys are loaded from configuration (file://, https://, or base64:// URIs). Follows the JWKS standard (RFC 7517). “‘http GET /v2alpha1/admin/derivedKeys/jwks.json “`

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



425
426
427
428
# File 'lib/ory-client/api/api_keys_api.rb', line 425

def admin_get_jwks(opts = {})
  data, _status_code, _headers = admin_get_jwks_with_http_info(opts)
  data
end

#admin_get_jwks_with_http_info(opts = {}) ⇒ Array<(GetJWKSResponse, Integer, Hash)>

Get JWKS Returns the JSON Web Key Set for token verification. Provides the public keys needed to verify JWT tokens issued by this service. Keys are loaded from configuration (file://, https://, or base64:// URIs). Follows the JWKS standard (RFC 7517). &#x60;&#x60;&#x60;http GET /v2alpha1/admin/derivedKeys/jwks.json &#x60;&#x60;&#x60;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetJWKSResponse, Integer, Hash)>)

    GetJWKSResponse data, response status code and response headers



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/ory-client/api/api_keys_api.rb', line 434

def admin_get_jwks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_get_jwks ...'
  end
  # resource path
  local_var_path = '/v2alpha1/admin/derivedKeys/jwks.json'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetJWKSResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_get_jwks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_get_jwks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_import_api_key(import_api_key_request, opts = {}) ⇒ ImportedAPIKey

Import API Key Imports an external API key into the system. Allows importing keys from legacy systems or external providers. The raw key is hashed and stored securely (HMAC). Imported keys support token derivation (JWT/Macaroon) like issued keys. “‘http POST /v2alpha1/admin/importedApiKeys { "raw_key": "sk_live_abc123xyz", "name": "Imported Stripe Key", "actor_id": "user_123" } “`

Parameters:

  • import_api_key_request (ImportAPIKeyRequest)

    Example: { &quot;raw_key&quot;: &quot;sk_live_abc123xyz789&quot;, &quot;name&quot;: &quot;Stripe Production Key&quot;, &quot;actor_id&quot;: &quot;payment-processor&quot;, &quot;scopes&quot;: [&quot;read&quot;, &quot;write&quot;], &quot;ttl&quot;: &quot;8760h&quot;, // 1 year (also accepts: 31536000s) &quot;metadata&quot;: &quot;stripe&quot;, &quot;environment&quot;: &quot;production&quot; }

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



483
484
485
486
# File 'lib/ory-client/api/api_keys_api.rb', line 483

def admin_import_api_key(import_api_key_request, opts = {})
  data, _status_code, _headers = admin_import_api_key_with_http_info(import_api_key_request, opts)
  data
end

#admin_import_api_key_with_http_info(import_api_key_request, opts = {}) ⇒ Array<(ImportedAPIKey, Integer, Hash)>

Import API Key Imports an external API key into the system. Allows importing keys from legacy systems or external providers. The raw key is hashed and stored securely (HMAC). Imported keys support token derivation (JWT/Macaroon) like issued keys. &#x60;&#x60;&#x60;http POST /v2alpha1/admin/importedApiKeys { &quot;raw_key&quot;: &quot;sk_live_abc123xyz&quot;, &quot;name&quot;: &quot;Imported Stripe Key&quot;, &quot;actor_id&quot;: &quot;user_123&quot; } &#x60;&#x60;&#x60;

Parameters:

  • import_api_key_request (ImportAPIKeyRequest)

    Example: { &quot;raw_key&quot;: &quot;sk_live_abc123xyz789&quot;, &quot;name&quot;: &quot;Stripe Production Key&quot;, &quot;actor_id&quot;: &quot;payment-processor&quot;, &quot;scopes&quot;: [&quot;read&quot;, &quot;write&quot;], &quot;ttl&quot;: &quot;8760h&quot;, // 1 year (also accepts: 31536000s) &quot;metadata&quot;: &quot;stripe&quot;, &quot;environment&quot;: &quot;production&quot; }

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ImportedAPIKey, Integer, Hash)>)

    ImportedAPIKey data, response status code and response headers



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
# File 'lib/ory-client/api/api_keys_api.rb', line 493

def admin_import_api_key_with_http_info(import_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_import_api_key ...'
  end
  # verify the required parameter 'import_api_key_request' is set
  if @api_client.config.client_side_validation && import_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'import_api_key_request' when calling APIKeysApi.admin_import_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/importedApiKeys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(import_api_key_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ImportedAPIKey'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_import_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_import_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_issue_api_key(issue_api_key_request, opts = {}) ⇒ IssueAPIKeyResponse

Issue API Key Creates a new API key for a given actor. The secret is returned only once in the response and cannot be retrieved later. Keys can be scoped with specific permissions and have optional expiration. “‘http POST /v2alpha1/admin/issuedApiKeys { "name": "production-service", "actor_id": "user_123", "scopes": ["read", "write"], "ttl": "8760h" } “`

Parameters:

  • issue_api_key_request (IssueAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



551
552
553
554
# File 'lib/ory-client/api/api_keys_api.rb', line 551

def admin_issue_api_key(issue_api_key_request, opts = {})
  data, _status_code, _headers = admin_issue_api_key_with_http_info(issue_api_key_request, opts)
  data
end

#admin_issue_api_key_with_http_info(issue_api_key_request, opts = {}) ⇒ Array<(IssueAPIKeyResponse, Integer, Hash)>

Issue API Key Creates a new API key for a given actor. The secret is returned only once in the response and cannot be retrieved later. Keys can be scoped with specific permissions and have optional expiration. &#x60;&#x60;&#x60;http POST /v2alpha1/admin/issuedApiKeys { &quot;name&quot;: &quot;production-service&quot;, &quot;actor_id&quot;: &quot;user_123&quot;, &quot;scopes&quot;: [&quot;read&quot;, &quot;write&quot;], &quot;ttl&quot;: &quot;8760h&quot; } &#x60;&#x60;&#x60;

Parameters:

  • issue_api_key_request (IssueAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(IssueAPIKeyResponse, Integer, Hash)>)

    IssueAPIKeyResponse data, response status code and response headers



561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
# File 'lib/ory-client/api/api_keys_api.rb', line 561

def admin_issue_api_key_with_http_info(issue_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_issue_api_key ...'
  end
  # verify the required parameter 'issue_api_key_request' is set
  if @api_client.config.client_side_validation && issue_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'issue_api_key_request' when calling APIKeysApi.admin_issue_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/issuedApiKeys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(issue_api_key_request)

  # return_type
  return_type = opts[:debug_return_type] || 'IssueAPIKeyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_issue_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_issue_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_list_imported_api_keys(opts = {}) ⇒ ListImportedAPIKeysResponse

List Imported API Keys Lists all imported keys with filtering. Returns imported keys only (not issued keys). Supports pagination and AIP-160 filter expressions. “‘http GET /v2alpha1/admin/importedApiKeys?page_size=50&filter=status%3DKEY_STATUS_ACTIVE “`

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Number of items per page (default: 50, max: 1000)

  • :page_token (String)

    Cursor token for pagination (OPTIONAL)

  • :filter (String)

    filter is an AIP-160 expression. Indexed fields (efficient at any scale): actor_id, status. Other fields are not indexed and may be rejected. Examples: actor_id&#x3D;&quot;user_123&quot; status&#x3D;KEY_STATUS_ACTIVE actor_id&#x3D;&quot;user_123&quot; AND status&#x3D;KEY_STATUS_ACTIVE

Returns:



621
622
623
624
# File 'lib/ory-client/api/api_keys_api.rb', line 621

def admin_list_imported_api_keys(opts = {})
  data, _status_code, _headers = admin_list_imported_api_keys_with_http_info(opts)
  data
end

#admin_list_imported_api_keys_with_http_info(opts = {}) ⇒ Array<(ListImportedAPIKeysResponse, Integer, Hash)>

List Imported API Keys Lists all imported keys with filtering. Returns imported keys only (not issued keys). Supports pagination and AIP-160 filter expressions. &#x60;&#x60;&#x60;http GET /v2alpha1/admin/importedApiKeys?page_size&#x3D;50&amp;filter&#x3D;status%3DKEY_STATUS_ACTIVE &#x60;&#x60;&#x60;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Number of items per page (default: 50, max: 1000)

  • :page_token (String)

    Cursor token for pagination (OPTIONAL)

  • :filter (String)

    filter is an AIP-160 expression. Indexed fields (efficient at any scale): actor_id, status. Other fields are not indexed and may be rejected. Examples: actor_id&#x3D;&quot;user_123&quot; status&#x3D;KEY_STATUS_ACTIVE actor_id&#x3D;&quot;user_123&quot; AND status&#x3D;KEY_STATUS_ACTIVE

Returns:

  • (Array<(ListImportedAPIKeysResponse, Integer, Hash)>)

    ListImportedAPIKeysResponse data, response status code and response headers



633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
# File 'lib/ory-client/api/api_keys_api.rb', line 633

def admin_list_imported_api_keys_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_list_imported_api_keys ...'
  end
  # resource path
  local_var_path = '/v2alpha1/admin/importedApiKeys'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListImportedAPIKeysResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_list_imported_api_keys",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_list_imported_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_list_issued_api_keys(opts = {}) ⇒ ListIssuedAPIKeysResponse

List Issued API Keys Lists issued API keys with optional filtering. Supports cursor-based pagination and AIP-160 filter expressions. Returns only issued (generated) API keys; use ListImportedAPIKeys for imported keys. “‘http GET /v2alpha1/admin/issuedApiKeys?page_size=50&filter=actor_id%3D%22user_123%22 “`

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Number of items per page (default: 50, max: 1000)

  • :page_token (String)

    Cursor token for pagination

  • :filter (String)

    filter is an AIP-160 expression. Indexed fields (efficient at any scale): actor_id, status. Other fields are not indexed and may be rejected. Examples: actor_id&#x3D;&quot;user_123&quot; status&#x3D;KEY_STATUS_ACTIVE actor_id&#x3D;&quot;user_123&quot; AND status&#x3D;KEY_STATUS_ACTIVE

Returns:



687
688
689
690
# File 'lib/ory-client/api/api_keys_api.rb', line 687

def admin_list_issued_api_keys(opts = {})
  data, _status_code, _headers = admin_list_issued_api_keys_with_http_info(opts)
  data
end

#admin_list_issued_api_keys_with_http_info(opts = {}) ⇒ Array<(ListIssuedAPIKeysResponse, Integer, Hash)>

List Issued API Keys Lists issued API keys with optional filtering. Supports cursor-based pagination and AIP-160 filter expressions. Returns only issued (generated) API keys; use ListImportedAPIKeys for imported keys. &#x60;&#x60;&#x60;http GET /v2alpha1/admin/issuedApiKeys?page_size&#x3D;50&amp;filter&#x3D;actor_id%3D%22user_123%22 &#x60;&#x60;&#x60;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Number of items per page (default: 50, max: 1000)

  • :page_token (String)

    Cursor token for pagination

  • :filter (String)

    filter is an AIP-160 expression. Indexed fields (efficient at any scale): actor_id, status. Other fields are not indexed and may be rejected. Examples: actor_id&#x3D;&quot;user_123&quot; status&#x3D;KEY_STATUS_ACTIVE actor_id&#x3D;&quot;user_123&quot; AND status&#x3D;KEY_STATUS_ACTIVE

Returns:

  • (Array<(ListIssuedAPIKeysResponse, Integer, Hash)>)

    ListIssuedAPIKeysResponse data, response status code and response headers



699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
# File 'lib/ory-client/api/api_keys_api.rb', line 699

def admin_list_issued_api_keys_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_list_issued_api_keys ...'
  end
  # resource path
  local_var_path = '/v2alpha1/admin/issuedApiKeys'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListIssuedAPIKeysResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_list_issued_api_keys",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_list_issued_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_revoke_api_key(key_id, admin_revoke_api_key_body, opts = {}) ⇒ Object

Revoke API Key Immediately revokes an API key (issued or imported). Once revoked, the key can no longer be used for authentication. This operation is irreversible. Revoked keys are retained for audit purposes. “‘http POST /v2alpha1/admin/apiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ:revoke { "reason": "REVOCATION_REASON_KEY_COMPROMISE" } “`

Parameters:

  • key_id (String)

    Identifier of the API key resource.

  • admin_revoke_api_key_body (AdminRevokeAPIKeyBody)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


752
753
754
755
# File 'lib/ory-client/api/api_keys_api.rb', line 752

def admin_revoke_api_key(key_id, admin_revoke_api_key_body, opts = {})
  data, _status_code, _headers = admin_revoke_api_key_with_http_info(key_id, admin_revoke_api_key_body, opts)
  data
end

#admin_revoke_api_key_with_http_info(key_id, admin_revoke_api_key_body, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Revoke API Key Immediately revokes an API key (issued or imported). Once revoked, the key can no longer be used for authentication. This operation is irreversible. Revoked keys are retained for audit purposes. &#x60;&#x60;&#x60;http POST /v2alpha1/admin/apiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ:revoke { &quot;reason&quot;: &quot;REVOCATION_REASON_KEY_COMPROMISE&quot; } &#x60;&#x60;&#x60;

Parameters:

  • key_id (String)

    Identifier of the API key resource.

  • admin_revoke_api_key_body (AdminRevokeAPIKeyBody)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/ory-client/api/api_keys_api.rb', line 763

def admin_revoke_api_key_with_http_info(key_id, admin_revoke_api_key_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_revoke_api_key ...'
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling APIKeysApi.admin_revoke_api_key"
  end
  # verify the required parameter 'admin_revoke_api_key_body' is set
  if @api_client.config.client_side_validation && admin_revoke_api_key_body.nil?
    fail ArgumentError, "Missing the required parameter 'admin_revoke_api_key_body' when calling APIKeysApi.admin_revoke_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/apiKeys/{key_id}:revoke'.sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(admin_revoke_api_key_body)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_revoke_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_revoke_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_rotate_issued_api_key(key_id, admin_rotate_issued_api_key_body, opts = {}) ⇒ RotateIssuedAPIKeyResponse

Rotate Issued API Key Generates a new secret for an issued API key. Creates a new API key with a new key_id and secret, and immediately revokes the old key. This is the recommended way to update scopes, metadata, or rotate credentials. For zero-downtime rotation, use this workflow instead: 1. IssueAPIKey with new credentials 2. Deploy new secret to all services 3. Verify new secret works everywhere 4. RevokeAPIKey to remove the old key “‘http POST /v2alpha1/admin/issuedApiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ:rotate { "scopes": ["read"] } “`

Parameters:

  • key_id (String)

    key_id is the ID of the existing API key to rotate

  • admin_rotate_issued_api_key_body (AdminRotateIssuedAPIKeyBody)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



826
827
828
829
# File 'lib/ory-client/api/api_keys_api.rb', line 826

def admin_rotate_issued_api_key(key_id, admin_rotate_issued_api_key_body, opts = {})
  data, _status_code, _headers = admin_rotate_issued_api_key_with_http_info(key_id, admin_rotate_issued_api_key_body, opts)
  data
end

#admin_rotate_issued_api_key_with_http_info(key_id, admin_rotate_issued_api_key_body, opts = {}) ⇒ Array<(RotateIssuedAPIKeyResponse, Integer, Hash)>

Rotate Issued API Key Generates a new secret for an issued API key. Creates a new API key with a new key_id and secret, and immediately revokes the old key. This is the recommended way to update scopes, metadata, or rotate credentials. For zero-downtime rotation, use this workflow instead: 1. IssueAPIKey with new credentials 2. Deploy new secret to all services 3. Verify new secret works everywhere 4. RevokeAPIKey to remove the old key &#x60;&#x60;&#x60;http POST /v2alpha1/admin/issuedApiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ:rotate { &quot;scopes&quot;: [&quot;read&quot;] } &#x60;&#x60;&#x60;

Parameters:

  • key_id (String)

    key_id is the ID of the existing API key to rotate

  • admin_rotate_issued_api_key_body (AdminRotateIssuedAPIKeyBody)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RotateIssuedAPIKeyResponse, Integer, Hash)>)

    RotateIssuedAPIKeyResponse data, response status code and response headers



837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# File 'lib/ory-client/api/api_keys_api.rb', line 837

def admin_rotate_issued_api_key_with_http_info(key_id, admin_rotate_issued_api_key_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_rotate_issued_api_key ...'
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling APIKeysApi.admin_rotate_issued_api_key"
  end
  # verify the required parameter 'admin_rotate_issued_api_key_body' is set
  if @api_client.config.client_side_validation && admin_rotate_issued_api_key_body.nil?
    fail ArgumentError, "Missing the required parameter 'admin_rotate_issued_api_key_body' when calling APIKeysApi.admin_rotate_issued_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/issuedApiKeys/{key_id}:rotate'.sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(admin_rotate_issued_api_key_body)

  # return_type
  return_type = opts[:debug_return_type] || 'RotateIssuedAPIKeyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_rotate_issued_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_rotate_issued_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_update_imported_api_key(key_id, admin_update_imported_api_key_request, opts = {}) ⇒ ImportedAPIKey

Update Imported API Key Updates metadata, scopes, or rate limits of an imported key. Supports partial updates via the update_mask query parameter (AIP-134). Omitting update_mask is equivalent to a mask of every populated field in the body. To clear a field to its zero value, list it explicitly in update_mask and leave it unset (or empty) in the body. “‘http PATCH /v2alpha1/admin/importedApiKeys/key_id?update_mask=name { "imported_api_key": { "key_id": "key_id", "name": "New name" } } “`

Parameters:

  • key_id (String)

    SHA-512/256 hash of credential

  • admin_update_imported_api_key_request (AdminUpdateImportedAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :update_mask (String)

    The list of fields to update. See AIP-134.

Returns:



901
902
903
904
# File 'lib/ory-client/api/api_keys_api.rb', line 901

def admin_update_imported_api_key(key_id, admin_update_imported_api_key_request, opts = {})
  data, _status_code, _headers = admin_update_imported_api_key_with_http_info(key_id, admin_update_imported_api_key_request, opts)
  data
end

#admin_update_imported_api_key_with_http_info(key_id, admin_update_imported_api_key_request, opts = {}) ⇒ Array<(ImportedAPIKey, Integer, Hash)>

Update Imported API Key Updates metadata, scopes, or rate limits of an imported key. Supports partial updates via the update_mask query parameter (AIP-134). Omitting update_mask is equivalent to a mask of every populated field in the body. To clear a field to its zero value, list it explicitly in update_mask and leave it unset (or empty) in the body. &#x60;&#x60;&#x60;http PATCH /v2alpha1/admin/importedApiKeys/key_id?update_mask&#x3D;name { &quot;imported_api_key&quot;: { &quot;key_id&quot;: &quot;key_id&quot;, &quot;name&quot;: &quot;New name&quot; } } &#x60;&#x60;&#x60;

Parameters:

  • key_id (String)

    SHA-512/256 hash of credential

  • admin_update_imported_api_key_request (AdminUpdateImportedAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :update_mask (String)

    The list of fields to update. See AIP-134.

Returns:

  • (Array<(ImportedAPIKey, Integer, Hash)>)

    ImportedAPIKey data, response status code and response headers



913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
# File 'lib/ory-client/api/api_keys_api.rb', line 913

def admin_update_imported_api_key_with_http_info(key_id, admin_update_imported_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_update_imported_api_key ...'
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling APIKeysApi.admin_update_imported_api_key"
  end
  # verify the required parameter 'admin_update_imported_api_key_request' is set
  if @api_client.config.client_side_validation && admin_update_imported_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'admin_update_imported_api_key_request' when calling APIKeysApi.admin_update_imported_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/importedApiKeys/{key_id}'.sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'update_mask'] = opts[:'update_mask'] if !opts[:'update_mask'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(admin_update_imported_api_key_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ImportedAPIKey'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_update_imported_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_update_imported_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_update_issued_api_key(key_id, admin_update_issued_api_key_request, opts = {}) ⇒ IssuedAPIKey

Update Issued API Key Updates metadata, scopes, or rate limits of an issued key without rotating the secret. Use RotateIssuedAPIKey to change the secret. Follows AIP-134: the request body is the IssuedAPIKey resource itself, and the update_mask query parameter names the subset of fields to apply. Omitting update_mask is equivalent to a mask of every populated field in the body. To clear a field to its zero value, list it explicitly in update_mask and leave it unset (or empty) in the body. “‘http PATCH /v2alpha1/admin/issuedApiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ?update_mask=scopes { "issued_api_key": { "key_id": "01HQZX9VYQKJB8XQZQXQZQXQXQ", "scopes": ["read"] } } “`

Parameters:

  • key_id (String)

    Identifier of the API key resource.

  • admin_update_issued_api_key_request (AdminUpdateIssuedAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :update_mask (String)

    The list of fields to update. See AIP-134.

Returns:



978
979
980
981
# File 'lib/ory-client/api/api_keys_api.rb', line 978

def admin_update_issued_api_key(key_id, admin_update_issued_api_key_request, opts = {})
  data, _status_code, _headers = admin_update_issued_api_key_with_http_info(key_id, admin_update_issued_api_key_request, opts)
  data
end

#admin_update_issued_api_key_with_http_info(key_id, admin_update_issued_api_key_request, opts = {}) ⇒ Array<(IssuedAPIKey, Integer, Hash)>

Update Issued API Key Updates metadata, scopes, or rate limits of an issued key without rotating the secret. Use RotateIssuedAPIKey to change the secret. Follows AIP-134: the request body is the IssuedAPIKey resource itself, and the update_mask query parameter names the subset of fields to apply. Omitting update_mask is equivalent to a mask of every populated field in the body. To clear a field to its zero value, list it explicitly in update_mask and leave it unset (or empty) in the body. &#x60;&#x60;&#x60;http PATCH /v2alpha1/admin/issuedApiKeys/01HQZX9VYQKJB8XQZQXQZQXQXQ?update_mask&#x3D;scopes { &quot;issued_api_key&quot;: { &quot;key_id&quot;: &quot;01HQZX9VYQKJB8XQZQXQZQXQXQ&quot;, &quot;scopes&quot;: [&quot;read&quot;] } } &#x60;&#x60;&#x60;

Parameters:

  • key_id (String)

    Identifier of the API key resource.

  • admin_update_issued_api_key_request (AdminUpdateIssuedAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :update_mask (String)

    The list of fields to update. See AIP-134.

Returns:

  • (Array<(IssuedAPIKey, Integer, Hash)>)

    IssuedAPIKey data, response status code and response headers



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
# File 'lib/ory-client/api/api_keys_api.rb', line 990

def admin_update_issued_api_key_with_http_info(key_id, admin_update_issued_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_update_issued_api_key ...'
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling APIKeysApi.admin_update_issued_api_key"
  end
  # verify the required parameter 'admin_update_issued_api_key_request' is set
  if @api_client.config.client_side_validation && admin_update_issued_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'admin_update_issued_api_key_request' when calling APIKeysApi.admin_update_issued_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/issuedApiKeys/{key_id}'.sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'update_mask'] = opts[:'update_mask'] if !opts[:'update_mask'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(admin_update_issued_api_key_request)

  # return_type
  return_type = opts[:debug_return_type] || 'IssuedAPIKey'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_update_issued_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_update_issued_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#admin_verify_api_key(verify_api_key_request, opts = {}) ⇒ VerifyAPIKeyResponse

Verify API Key Verifies a single API key or derived token. Validates the credential’s signature, expiration, and revocation status. Works with any credential type (issued keys, imported keys, JWT, macaroon). The verification result includes decoded claims and metadata — admin access only. Cache Control (HTTP Headers): - Cache-Control: no-cache - Bypasses cache read, forces fresh DB lookup - Cache-Control: no-store - Bypasses cache read AND write (never cached) - Pragma: no-cache - Same as Cache-Control: no-cache (HTTP/1.0) “‘http POST /v2alpha1/admin/apiKeys:verify { "credential": "sk_live_abc123…" } “`

Parameters:

  • verify_api_key_request (VerifyAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :cache_control (String)

    Cache-directive controlling the verifier cache. &#x60;no-cache&#x60; forces a fresh database lookup (cache read is bypassed). &#x60;no-store&#x60; additionally prevents the result from being written to the cache. Any other value is ignored.

  • :pragma (String)

    HTTP/1.0 alias for &#x60;Cache-Control: no-cache&#x60;. Behaves identically when set to &#x60;no-cache&#x60;; ignored otherwise.

Returns:



1055
1056
1057
1058
# File 'lib/ory-client/api/api_keys_api.rb', line 1055

def admin_verify_api_key(verify_api_key_request, opts = {})
  data, _status_code, _headers = admin_verify_api_key_with_http_info(verify_api_key_request, opts)
  data
end

#admin_verify_api_key_with_http_info(verify_api_key_request, opts = {}) ⇒ Array<(VerifyAPIKeyResponse, Integer, Hash)>

Verify API Key Verifies a single API key or derived token. Validates the credential&#39;s signature, expiration, and revocation status. Works with any credential type (issued keys, imported keys, JWT, macaroon). The verification result includes decoded claims and metadata — admin access only. Cache Control (HTTP Headers): - Cache-Control: no-cache - Bypasses cache read, forces fresh DB lookup - Cache-Control: no-store - Bypasses cache read AND write (never cached) - Pragma: no-cache - Same as Cache-Control: no-cache (HTTP/1.0) &#x60;&#x60;&#x60;http POST /v2alpha1/admin/apiKeys:verify { &quot;credential&quot;: &quot;sk_live_abc123…&quot; } &#x60;&#x60;&#x60;

Parameters:

  • verify_api_key_request (VerifyAPIKeyRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :cache_control (String)

    Cache-directive controlling the verifier cache. &#x60;no-cache&#x60; forces a fresh database lookup (cache read is bypassed). &#x60;no-store&#x60; additionally prevents the result from being written to the cache. Any other value is ignored.

  • :pragma (String)

    HTTP/1.0 alias for &#x60;Cache-Control: no-cache&#x60;. Behaves identically when set to &#x60;no-cache&#x60;; ignored otherwise.

Returns:

  • (Array<(VerifyAPIKeyResponse, Integer, Hash)>)

    VerifyAPIKeyResponse data, response status code and response headers



1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
# File 'lib/ory-client/api/api_keys_api.rb', line 1067

def admin_verify_api_key_with_http_info(verify_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.admin_verify_api_key ...'
  end
  # verify the required parameter 'verify_api_key_request' is set
  if @api_client.config.client_side_validation && verify_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'verify_api_key_request' when calling APIKeysApi.admin_verify_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/admin/apiKeys:verify'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Cache-Control'] = opts[:'cache_control'] if !opts[:'cache_control'].nil?
  header_params[:'Pragma'] = opts[:'pragma'] if !opts[:'pragma'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(verify_api_key_request)

  # return_type
  return_type = opts[:debug_return_type] || 'VerifyAPIKeyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oryAccessToken']

  new_options = opts.merge(
    :operation => :"APIKeysApi.admin_verify_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#admin_verify_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revoke_api_key(self_revoke_api_key_request, opts = {}) ⇒ Object

Revoke API Key (self-service) Proof-of-possession variant of revocation. Lives alongside ‘AdminRevokeAPIKey` in this service; the `Self*` prefix on the request/response messages disambiguates from the admin variant’s ‘RevokeAPIKeyRequest`. Allows an API key holder to revoke their own key. The caller must provide the full API key secret as proof of possession. Supports issued API keys and imported keys. JWT and macaroon tokens cannot be self-revoked (they are stateless). The PRIVILEGE_WITHDRAWN reason is not allowed for self-revocation (admin-only). “`http POST /v2alpha1/apiKeys:selfRevoke { "credential": "sk_live_abc123…", "reason": "REVOCATION_REASON_KEY_COMPROMISE" } “`

Parameters:

  • self_revoke_api_key_request (SelfRevokeAPIKeyRequest)

    SelfRevokeAPIKeyRequest allows an API key holder to revoke their own key by providing the full key secret as proof of possession.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


1127
1128
1129
1130
# File 'lib/ory-client/api/api_keys_api.rb', line 1127

def revoke_api_key(self_revoke_api_key_request, opts = {})
  data, _status_code, _headers = revoke_api_key_with_http_info(self_revoke_api_key_request, opts)
  data
end

#revoke_api_key_with_http_info(self_revoke_api_key_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Revoke API Key (self-service) Proof-of-possession variant of revocation. Lives alongside &#x60;AdminRevokeAPIKey&#x60; in this service; the &#x60;Self*&#x60; prefix on the request/response messages disambiguates from the admin variant&#39;s &#x60;RevokeAPIKeyRequest&#x60;. Allows an API key holder to revoke their own key. The caller must provide the full API key secret as proof of possession. Supports issued API keys and imported keys. JWT and macaroon tokens cannot be self-revoked (they are stateless). The PRIVILEGE_WITHDRAWN reason is not allowed for self-revocation (admin-only). &#x60;&#x60;&#x60;http POST /v2alpha1/apiKeys:selfRevoke { &quot;credential&quot;: &quot;sk_live_abc123…&quot;, &quot;reason&quot;: &quot;REVOCATION_REASON_KEY_COMPROMISE&quot; } &#x60;&#x60;&#x60;

Parameters:

  • self_revoke_api_key_request (SelfRevokeAPIKeyRequest)

    SelfRevokeAPIKeyRequest allows an API key holder to revoke their own key by providing the full key secret as proof of possession.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
# File 'lib/ory-client/api/api_keys_api.rb', line 1137

def revoke_api_key_with_http_info(self_revoke_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.revoke_api_key ...'
  end
  # verify the required parameter 'self_revoke_api_key_request' is set
  if @api_client.config.client_side_validation && self_revoke_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'self_revoke_api_key_request' when calling APIKeysApi.revoke_api_key"
  end
  # resource path
  local_var_path = '/v2alpha1/apiKeys:selfRevoke'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(self_revoke_api_key_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"APIKeysApi.revoke_api_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#revoke_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end