Class: ChefVault

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-vault/user.rb,
lib/chef-vault.rb,
lib/chef-vault/item.rb,
lib/chef-vault/actor.rb,
lib/chef-vault/mixins.rb,
lib/chef-vault/version.rb,
lib/chef-vault/chef_api.rb,
lib/chef-vault/item_keys.rb,
lib/chef-vault/exceptions.rb,
lib/chef-vault/certificate.rb,
lib/chef/knife/mixin/helper.rb

Overview

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.

Defined Under Namespace

Modules: Mixin, Mixins Classes: Actor, Certificate, ChefApi, Exceptions, Item, ItemKeys, Log, User

Constant Summary collapse

VERSION =
"3.4.0"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vault, chef_config_file = nil) ⇒ ChefVault

Returns a new instance of ChefVault


40
41
42
43
# File 'lib/chef-vault.rb', line 40

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

Instance Attribute Details

#vaultObject

Returns the value of attribute vault


38
39
40
# File 'lib/chef-vault.rb', line 38

def vault
  @vault
end

Class Method Details

.load_config(chef_config_file) ⇒ Object


57
58
59
# File 'lib/chef-vault.rb', line 57

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

Instance Method Details

#certificate(name) ⇒ Object


53
54
55
# File 'lib/chef-vault.rb', line 53

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

#user(username) ⇒ Object


49
50
51
# File 'lib/chef-vault.rb', line 49

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

#versionObject


45
46
47
# File 'lib/chef-vault.rb', line 45

def version
  VERSION
end