Sha256: e0408ad0b6ef898e8b7969c2f3fe5abd13c1e2f40f36ee910cf1cc053123068f

Contents?: true

Size: 1.74 KB

Versions: 14

Compression:

Stored size: 1.74 KB

Contents

# frozen_string_literal: true

module RubyVault
  module Options
    HTTP_DEFINITIONS = [
      # key-value repeatable options
      %w[-header].map do |o|
        definition(
          name: o, option_type: :standard, value_type: :string,
          repeatable: true,
          override_keys: { singular: false, plural: :headers }
        )
      end,

      # string options
      %w[
        -address
        -agent-address
        -ca-cert
        -ca-path
        -client-cert
        -client-key
        -mfa
        -namespace
        -tls-server-name
        -unlock-key
        -wrap-ttl
      ].map do |o|
        definition(name: o, option_type: :standard,
                   value_type: :string)
      end,

      # flag options
      %w[
        -non-interactive
        -output-curl-string
        -output-policy
        -policy-override
        -tls-skip-verify
      ].map do |o|
        definition(name: o, option_type: :flag,
                   value_type: :boolean)
      end
    ].flatten.freeze

    OUTPUT_DEFINITIONS = [
      # string options
      %w[
        -field
        -format
      ].map do |o|
        definition(name: o, option_type: :standard, value_type: :string)
      end
    ].flatten.freeze

    OTHER_DEFINITIONS = [
      # string options
      %w[
        -method
        -path
      ].map do |o|
        definition(name: o, option_type: :standard, value_type: :string)
      end,

      # flag options
      %w[
        -force
        -no-print
        -no-store
        -token-only
      ].map do |o|
        definition(name: o, option_type: :flag, value_type: :boolean)
      end
    ].flatten.freeze

    DEFINITIONS = (
      HTTP_DEFINITIONS +
        OUTPUT_DEFINITIONS +
        OTHER_DEFINITIONS
    ).flatten.freeze
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ruby_vault-0.3.0.pre.2 lib/ruby_vault/options/definitions.rb
ruby_vault-0.3.0.pre.1 lib/ruby_vault/options/definitions.rb
ruby_vault-0.2.0 lib/ruby_vault/options/definitions.rb
ruby_vault-0.2.0.pre.6 lib/ruby_vault/options/definitions.rb
ruby_vault-0.2.0.pre.5 lib/ruby_vault/options/definitions.rb
ruby_vault-0.2.0.pre.4 lib/ruby_vault/options/definitions.rb
ruby_vault-0.2.0.pre.3 lib/ruby_vault/options/definitions.rb
ruby_vault-0.2.0.pre.2 lib/ruby_vault/options/definitions.rb
ruby_vault-0.2.0.pre.1 lib/ruby_vault/options/definitions.rb
ruby_vault-0.1.0 lib/ruby_vault/options/definitions.rb
ruby_vault-0.1.0.pre.18 lib/ruby_vault/options/definitions.rb
ruby_vault-0.1.0.pre.17 lib/ruby_vault/options/definitions.rb
ruby_vault-0.1.0.pre.16 lib/ruby_vault/options/definitions.rb
ruby_vault-0.1.0.pre.15 lib/ruby_vault/options/definitions.rb