class Aws::RDS::AuthTokenGenerator
a presigned url
* {#auth_token} - Computes a login token which is similar to
It provides a method:
The utility class helps generate an auth token that supports database login
def auth_token(params)
-
(String)
-
def auth_token(params) region = params.fetch(:region) endpoint = params.fetch(:endpoint) user_name = params.fetch(:user_name) param_list = Aws::Query::ParamList.new param_list.set('Action', 'connect') param_list.set('DBUser', user_name) signer = Aws::Sigv4::Signer.new( service: 'rds-db', region: region, credentials_provider: @credentials ) url = "https://" + endpoint + "/?#{param_list.to_s}" presigned_url = signer.presign_url( http_method: 'GET', url: url, body: '', expires_in: 900 ).to_s # Remove extra scheme for token presigned_url[8..-1] end
def initialize(options = {})
(**options)
-
:credentials
(required, Credentials
) --
def initialize(options = {}) @credentials = options.fetch(:credentials) end