Overview
TheConfiguration class defines all client-level options for the Zitadel SDK, including timeouts, logging, SSL behavior, and validation controls. It allows you to customize how API calls are made and handled internally.
Constructor
initialize
Create a new Configuration instance with optional block-style configuration.The authentication strategy used to authorize requests. Typically an instance implementing
#authenticate(request).Configuration - The configuration instance for customization
Returns: Configuration - Initialized configuration object
Example:
Instance Methods
configure
Allows modifying the current configuration instance using a block.Configuration - The configuration instance for modification
Example:
Configuration Options
Authentication
The authentication strategy used to authorize requests. This is typically an instance of a class implementing an interface like
#authenticate(request), such as NoAuthAuthenticator or a custom implementation.Note: This is read-only and set during initialization.Debugging and Logging
Enables or disables debug logging. When enabled, HTTP request and response details are logged via the configured
logger instance.The logger used to output debugging information. Defaults to
Rails.logger if Rails is defined; otherwise, logs to STDOUT.Timeouts
Request timeout duration in seconds. If set to
0, requests will never time out.SSL/TLS Configuration
Controls whether SSL certificates are verified when making HTTPS requests. Set to
false to bypass certificate verification.Warning: This should always be true in production environments.Controls whether SSL hostnames are verified during HTTPS communication. Set to
false to skip hostname verification.Warning: Disabling this weakens transport security.Path to the certificate file used to verify the peer. This is used in place of system-level certificate stores.
Path to the client certificate file for mutual TLS (mTLS). This is optional and only required when the server expects client-side certificates.
Path to the private key file for the client certificate. Used with
cert_file during mutual TLS authentication.Validation
Enables or disables client-side request validation. When disabled, validation of input parameters is skipped.
HTTP Configuration
The User-Agent header to be sent with HTTP requests. Set this to identify your client or library when making requests.Default format:
zitadel-client/{VERSION} (lang=ruby; lang_version={RUBY_VERSION}; os={RUBY_PLATFORM}; arch={host_cpu})Custom encoding strategy for query parameters that are arrays. Set this if your server expects a specific collection format (e.g.,
multi, csv, etc.).File Operations
Directory path used to temporarily store files returned by API responses (e.g., when downloading files).
Complete Configuration Example
Usage with Client
Configuration is typically done through the client initialization methods:With Access Token
With Client Credentials
With Private Key
Environment-Specific Configuration
Security Best Practices
- SSL Verification: Always keep
verify_sslandverify_ssl_hostset totruein production - Timeouts: Set reasonable timeout values to prevent hanging requests
- Logging: Be careful not to log sensitive information when debugging is enabled
- Client-Side Validation: Keep validation enabled unless you have a specific reason to disable it
- User Agent: Use a descriptive user agent to help identify your application in logs