Sha256: 102af0530392c31f2f613a269f96b38e4ad374932f5c612c71eb24f354ce602d

Contents?: true

Size: 797 Bytes

Versions: 6

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true

require 'rake_factory'
require 'ruby_vault'

module RakeVault
  module Tasks
    class OidcAuth < RakeFactory::Task
      default_name :login
      default_prerequisites(RakeFactory::DynamicValue.new do |t|
        [t.ensure_task_name]
      end)
      default_description(RakeFactory::DynamicValue.new do |_t|
        'Login with oidc using vault'
      end)
      parameter :role
      parameter :address
      parameter :ensure_task_name, default: :'vault:ensure'
      parameter :no_print, default: false

      action do |task|
        auth = task.role ? ["role=#{task.role}"] : []

        RubyVault.login(
          method: 'oidc',
          auth: auth,
          address: task.address,
          no_print: task.no_print
        )
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rake_vault-0.1.0.pre.11 lib/rake_vault/tasks/oidc_auth.rb
rake_vault-0.1.0.pre.10 lib/rake_vault/tasks/oidc_auth.rb
rake_vault-0.1.0.pre.9 lib/rake_vault/tasks/oidc_auth.rb
rake_vault-0.1.0.pre.8 lib/rake_vault/tasks/oidc_auth.rb
rake_vault-0.1.0.pre.7 lib/rake_vault/tasks/oidc_auth.rb
rake_vault-0.1.0.pre.6 lib/rake_vault/tasks/oidc_auth.rb