Sha256: c82cac508d9407ed0023f60452aabc174056022d759056a07f6de37884a33b5e

Contents?: true

Size: 1.97 KB

Versions: 95

Compression:

Stored size: 1.97 KB

Contents

#
# Author:: Tyler Cloke (<tyler@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

class Chef
  class Knife
    # Extendable module that class_eval's common options into UserKeyCreate and ClientKeyCreate
    #
    # @author Tyler Cloke
    module KeyCreateBase
      def self.included(includer)
        includer.class_eval do
          option :public_key,
            short: "-p FILENAME",
            long: "--public-key FILENAME",
            description: "Public key for newly created key. If not passed, the server will create a key pair for you, but you must pass --key-name NAME in that case."

          option :file,
            short: "-f FILE",
            long: "--file FILE",
            description: "Write the private key to a file, if you requested the server to create one."

          option :key_name,
            short: "-k NAME",
            long: "--key-name NAME",
            description: "The name for your key. If you do not pass a name, you must pass --public-key, and the name will default to the fingerprint of the public key passed."

          option :expiration_date,
            short: "-e DATE",
            long: "--expiration-date DATE",
            description: "Optionally pass the expiration date for the key in ISO 8601 formatted string: YYYY-MM-DDTHH:MM:SSZ e.g. 2013-12-24T21:00:00Z. Defaults to infinity if not passed. UTC timezone assumed."
        end
      end
    end
  end
end

Version data entries

95 entries across 95 versions & 2 rubygems

Version Path
knife-18.5.0 lib/chef/knife/key_create_base.rb
knife-18.4.2 lib/chef/knife/key_create_base.rb
knife-17.10.95 lib/chef/knife/key_create_base.rb
knife-18.3.0 lib/chef/knife/key_create_base.rb
chef-16.18.30-universal-mingw32 lib/chef/knife/key_create_base.rb
chef-16.18.30 lib/chef/knife/key_create_base.rb
knife-18.1.0 lib/chef/knife/key_create_base.rb
knife-17.10.0 lib/chef/knife/key_create_base.rb
chef-16.18.0-universal-mingw32 lib/chef/knife/key_create_base.rb
chef-16.18.0 lib/chef/knife/key_create_base.rb
chef-16.17.51-universal-mingw32 lib/chef/knife/key_create_base.rb
chef-16.17.51 lib/chef/knife/key_create_base.rb
chef-16.17.39-universal-mingw32 lib/chef/knife/key_create_base.rb
chef-16.17.39 lib/chef/knife/key_create_base.rb
knife-17.9.26 lib/chef/knife/key_create_base.rb
knife-17.9.9 lib/chef/knife/key_create_base.rb
chef-16.17.18-universal-mingw32 lib/chef/knife/key_create_base.rb
chef-16.17.18 lib/chef/knife/key_create_base.rb
chef-16.17.4-universal-mingw32 lib/chef/knife/key_create_base.rb
chef-16.17.4 lib/chef/knife/key_create_base.rb