Sha256: f472158a6effccf721f205b80908404767a5eb7a814fc91372135e1162c561cf

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module RubyEasyRSA
  module Commands
    module Mixins
      module ExtraExtensionsConfig
        # rubocop:disable Style/RedundantAssignment
        def configure_command(builder, opts)
          builder = super(builder, opts)
          builder = with_extra_extensions(builder, opts[:extra_extensions])
          builder = with_subject_alternative_name(
            builder, opts[:subject_alternative_name]
          )
          builder
        end
        # rubocop:enable Style/RedundantAssignment

        private

        def with_extra_extensions(builder, extra_extensions)
          return builder unless extra_extensions

          builder.with_environment_variable(
            'EASYRSA_EXTRA_EXT', extra_extensions
          )
        end

        def with_subject_alternative_name(builder, subject_alternative_name)
          return builder unless subject_alternative_name

          builder.with_option(
            '--subject-alt-name', subject_alternative_name, quoting: '"'
          )
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ruby_easy_rsa-0.12.0.pre.4 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb
ruby_easy_rsa-0.12.0.pre.3 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb
ruby_easy_rsa-0.12.0.pre.2 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb
ruby_easy_rsa-0.12.0.pre.1 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb
ruby_easy_rsa-0.11.0 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb
ruby_easy_rsa-0.10.0.pre.10 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb
ruby_easy_rsa-0.10.0.pre.9 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb
ruby_easy_rsa-0.10.0.pre.8 lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb