ProcessCredentialsProvider

class ProcessCredentialsProvider(credentialProcess: String, platformProvider: PlatformProvider = PlatformProvider.System, maxOutputLengthBytes: Long = 64 * 1024, timeoutMillis: Long) : CredentialsProvider

CredentialsProvider that invokes a command to retrieve Credentials from stdout. If the exit code is non-zero, log and throw an exception including the stderr from the command.

WARNING: This CredentialsProvider sources credentials from an external process. This can potentially be dangerous, so proceed with caution. Other credential providers should be preferred if possible. If using this option, secure the config file and any process/script files using security best practices for your operating system. Additionally, make sure to follow command-line conventions such as surrounding filenames / paths with quotes if they contain spaces. See the public documentation for a full list of expected conventions.

Parameters

credentialProcess

the command to invoke to retrieve credentials

platformProvider

the platform provider

maxOutputLengthBytes

the maximum output of the process in bytes

timeoutMillis

the timeout of the process

See also

Throws

if the process returns larger than maxOutputLengthBytes or takes longer than timeoutMillis to return Credentials

Constructors

Link copied to clipboard
constructor(credentialProcess: String, platformProvider: PlatformProvider = PlatformProvider.System, maxOutputLengthBytes: Long = 64 * 1024, timeoutMillis: Long)

Functions

Link copied to clipboard
open suspend override fun resolve(attributes: Attributes): Credentials