Sha256: c1c8395363e799ae926419c07f504c1bbce5fb98e63af962da0cd218d48a28ba

Contents?: true

Size: 991 Bytes

Versions: 12

Compression:

Stored size: 991 Bytes

Contents

require 'rake_factory'
require 'ruby_easy_rsa'

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

module RakeEasyRSA
  module Tasks
    module Certificate
      class Revoke < RakeFactory::Task
        include Mixins::GlobalParameters
        include Mixins::SSLParameters
        include Mixins::EasyRSAEnsurePrerequisite

        default_name :revoke
        default_argument_names [:filename_base, :reason]
        default_description 'Revoke a certificate of the PKI'

        parameter :reason, default: 'unspecified'

        action do |t, args|
          puts "Revoking certificate '#{args.filename_base}'... "
          reason = args.reason || t.reason
          RubyEasyRSA.revoke(
              t.parameter_values.merge(
                  reason: reason,
                  filename_base: args.filename_base))
          puts 'Done.'
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rake_easy_rsa-0.10.0.pre.3 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.10.0.pre.2 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.10.0.pre.1 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.9.0 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.8.0.pre.1 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.7.0 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.6.0.pre.2 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.6.0.pre.1 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.5.0 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.4.0.pre.1 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.3.0 lib/rake_easy_rsa/tasks/certificate/revoke.rb
rake_easy_rsa-0.2.0.pre.11 lib/rake_easy_rsa/tasks/certificate/revoke.rb