Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
670 changes: 670 additions & 0 deletions lib/zitadel/client/api/action_service_api.rb

Large diffs are not rendered by default.

273 changes: 273 additions & 0 deletions lib/zitadel/client/api/web_key_service_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
=begin
#Zitadel SDK

#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform.

The version of the OpenAPI document: 1.0.0

Generated by: https://openapi-generator.tech
Generator version: 7.12.0

=end

require 'cgi'

module Zitadel::Client::Api
class WebKeyServiceApi
attr_accessor :api_client

def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Activate Web Key
# Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key`
# @param id [String]
# @param [Hash] opts the optional parameters
# @return [WebKeyServiceBetaActivateWebKeyResponse]
def web_key_service_activate_web_key(id, opts = {})
data, _status_code, _headers = web_key_service_activate_web_key_with_http_info(id, opts)
data
end

# Activate Web Key
# Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` Required feature flag: - `web_key`
# @param id [String]
# @param [Hash] opts the optional parameters
# @return [Array<(WebKeyServiceBetaActivateWebKeyResponse, Integer, Hash)>] WebKeyServiceBetaActivateWebKeyResponse data, response status code and response headers
def web_key_service_activate_web_key_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_activate_web_key ...' # MODIFIED
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling Api::WebKeyServiceApi.web_key_service_activate_web_key" # MODIFIED
end
# resource path
local_var_path = '/v2beta/web_keys/{id}/activate'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebKeyServiceBetaActivateWebKeyResponse'

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

new_options = opts.merge(
:operation => :"Api::WebKeyServiceApi.web_key_service_activate_web_key", # MODIFIED
: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: Api::WebKeyServiceApi#web_key_service_activate_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED
end
return data, status_code, headers
end

# Create Web Key
# Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` Required feature flag: - `web_key`
# @param web_key_service_create_web_key_request [WebKeyServiceCreateWebKeyRequest]
# @param [Hash] opts the optional parameters
# @return [WebKeyServiceBetaCreateWebKeyResponse]
def web_key_service_create_web_key(web_key_service_create_web_key_request, opts = {})
data, _status_code, _headers = web_key_service_create_web_key_with_http_info(web_key_service_create_web_key_request, opts)
data
end

# Create Web Key
# Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state &#x60;STATE_INITIAL&#x60; and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - &#x60;iam.web_key.write&#x60; Required feature flag: - &#x60;web_key&#x60;
# @param web_key_service_create_web_key_request [WebKeyServiceCreateWebKeyRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(WebKeyServiceBetaCreateWebKeyResponse, Integer, Hash)>] WebKeyServiceBetaCreateWebKeyResponse data, response status code and response headers
def web_key_service_create_web_key_with_http_info(web_key_service_create_web_key_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_create_web_key ...' # MODIFIED
end
# verify the required parameter 'web_key_service_create_web_key_request' is set
if @api_client.config.client_side_validation && web_key_service_create_web_key_request.nil?
fail ArgumentError, "Missing the required parameter 'web_key_service_create_web_key_request' when calling Api::WebKeyServiceApi.web_key_service_create_web_key" # MODIFIED
end
# resource path
local_var_path = '/v2beta/web_keys'

# 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(web_key_service_create_web_key_request)

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

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

new_options = opts.merge(
:operation => :"Api::WebKeyServiceApi.web_key_service_create_web_key", # MODIFIED
: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: Api::WebKeyServiceApi#web_key_service_create_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED
end
return data, status_code, headers
end

# Delete Web Key
# Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` Required feature flag: - `web_key`
# @param id [String]
# @param [Hash] opts the optional parameters
# @return [WebKeyServiceBetaDeleteWebKeyResponse]
def web_key_service_delete_web_key(id, opts = {})
data, _status_code, _headers = web_key_service_delete_web_key_with_http_info(id, opts)
data
end

# Delete Web Key
# Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - &#x60;iam.web_key.delete&#x60; Required feature flag: - &#x60;web_key&#x60;
# @param id [String]
# @param [Hash] opts the optional parameters
# @return [Array<(WebKeyServiceBetaDeleteWebKeyResponse, Integer, Hash)>] WebKeyServiceBetaDeleteWebKeyResponse data, response status code and response headers
def web_key_service_delete_web_key_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_delete_web_key ...' # MODIFIED
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling Api::WebKeyServiceApi.web_key_service_delete_web_key" # MODIFIED
end
# resource path
local_var_path = '/v2beta/web_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebKeyServiceBetaDeleteWebKeyResponse'

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

new_options = opts.merge(
:operation => :"Api::WebKeyServiceApi.web_key_service_delete_web_key", # MODIFIED
: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: Api::WebKeyServiceApi#web_key_service_delete_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED
end
return data, status_code, headers
end

# List Web Keys
# List all web keys and their states. Required permission: - `iam.web_key.read` Required feature flag: - `web_key`
# @param [Hash] opts the optional parameters
# @return [WebKeyServiceBetaListWebKeysResponse]
def web_key_service_list_web_keys(opts = {})
data, _status_code, _headers = web_key_service_list_web_keys_with_http_info(opts)
data
end

# List Web Keys
# List all web keys and their states. Required permission: - &#x60;iam.web_key.read&#x60; Required feature flag: - &#x60;web_key&#x60;
# @param [Hash] opts the optional parameters
# @return [Array<(WebKeyServiceBetaListWebKeysResponse, Integer, Hash)>] WebKeyServiceBetaListWebKeysResponse data, response status code and response headers
def web_key_service_list_web_keys_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.web_key_service_list_web_keys ...' # MODIFIED
end
# resource path
local_var_path = '/v2beta/web_keys'

# 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] || 'WebKeyServiceBetaListWebKeysResponse'

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

new_options = opts.merge(
:operation => :"Api::WebKeyServiceApi.web_key_service_list_web_keys", # MODIFIED
: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: Api::WebKeyServiceApi#web_key_service_list_web_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED
end
return data, status_code, headers
end
end
end
Loading
Loading