Sha256: ffbd4991f2fd3dd1ab3a58fae2c142a4758510c1ebb1dc2cafb6dd17da72e860

Contents?: true

Size: 1.21 KB

Versions: 14

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

require 'rake_factory'
require 'ruby_easy_rsa'

require_relative '../../mixins/global_parameters'
require_relative '../../mixins/ssl_parameters'
require_relative '../../mixins/algorithm_parameters'
require_relative '../../mixins/encrypt_key_parameters'
require_relative '../../mixins/easy_rsa_ensure_prerequisite'

module RakeEasyRSA
  module Tasks
    module Client
      class Create < RakeFactory::Task
        include Mixins::GlobalParameters
        include Mixins::SSLParameters
        include Mixins::AlgorithmParameters
        include Mixins::EncryptKeyParameters
        include Mixins::EasyRSAEnsurePrerequisite

        parameter :default_argument_names, default: [:filename_base]

        default_name :create
        default_description 'Create a client certificate for the PKI'

        def argument_names
          @argument_names + default_argument_names
        end

        action do |t, args|
          puts "Creating client certificate '#{args.filename_base}'... "
          RubyEasyRSA.build_client_full(
            t.parameter_values.merge(
              filename_base: args.filename_base
            )
          )
          puts 'Done.'
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rake_easy_rsa-0.16.0.pre.2 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.16.0.pre.1 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.15.0 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.14.0.pre.7 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.14.0.pre.6 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.14.0.pre.5 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.14.0.pre.4 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.14.0.pre.3 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.14.0.pre.2 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.14.0.pre.1 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.13.0 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.12.0.pre.4 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.12.0.pre.3 lib/rake_easy_rsa/tasks/client/create.rb
rake_easy_rsa-0.12.0.pre.2 lib/rake_easy_rsa/tasks/client/create.rb