Sha256: 4aae0fce47960d60b7fdd21dcf82d59e460be29ebcb3397dc45f420f17fca749

Contents?: true

Size: 1.35 KB

Versions: 11

Compression:

Stored size: 1.35 KB

Contents

#
# Author:: Kevin Moser (<kevin.moser@nordstrom.com>)
#
# Copyright:: 2013, Nordstrom, Inc.
#
# 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.
#

require 'chef'
require 'chef/user'
require 'chef-vault/version'
require 'chef-vault/exceptions'
require 'chef-vault/item'
require 'chef-vault/item_keys'
require 'chef-vault/user'
require 'chef-vault/certificate'
require 'chef-vault/chef_patch/api_client'
require 'chef-vault/chef_patch/user'

class ChefVault

  attr_accessor :vault

  def initialize(vault, chef_config_file=nil)
    @vault = vault
    ChefVault.load_config(chef_config_file) if chef_config_file
  end

  def version
    VERSION
  end

  def user(username)
    ChefVault::User.new(vault, username)
  end

  def certificate(name)
    ChefVault::Certificate.new(vault, name)
  end

  def self.load_config(chef_config_file)
    Chef::Config.from_file(chef_config_file)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
chef-vault-2.4.0 lib/chef-vault.rb
chef-vault-2.3.0 lib/chef-vault.rb
chef-vault-2.2.4 lib/chef-vault.rb
chef-vault-2.2.3 lib/chef-vault.rb
chef-vault-2.2.2 lib/chef-vault.rb
chef-vault-2.2.1 lib/chef-vault.rb
chef-vault-2.2.0 lib/chef-vault.rb
chef-vault-2.1.0 lib/chef-vault.rb
chef-vault-2.0.2 lib/chef-vault.rb
chef-vault-2.0.1 lib/chef-vault.rb
chef-vault-2.0.1.pre lib/chef-vault.rb