Class: VagrantCloud::Auth::HCPConfig

Inherits:
Struct
  • Object
show all
Defined in:
lib/vagrant_cloud/auth.rb

Overview

HCP configuration for generating authentication tokens

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_pathObject

Returns the value of attribute auth_path

Returns:

  • (Object)

    the current value of auth_path



22
23
24
# File 'lib/vagrant_cloud/auth.rb', line 22

def auth_path
  @auth_path
end

#auth_urlObject

Returns the value of attribute auth_url

Returns:

  • (Object)

    the current value of auth_url



22
23
24
# File 'lib/vagrant_cloud/auth.rb', line 22

def auth_url
  @auth_url
end

#client_idObject

Returns the value of attribute client_id

Returns:

  • (Object)

    the current value of client_id



22
23
24
# File 'lib/vagrant_cloud/auth.rb', line 22

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret

Returns:

  • (Object)

    the current value of client_secret



22
23
24
# File 'lib/vagrant_cloud/auth.rb', line 22

def client_secret
  @client_secret
end

#token_pathObject

Returns the value of attribute token_path

Returns:

  • (Object)

    the current value of token_path



22
23
24
# File 'lib/vagrant_cloud/auth.rb', line 22

def token_path
  @token_path
end

Instance Method Details

#validate!Object

Raise exception if any values are missing



24
25
26
27
28
29
# File 'lib/vagrant_cloud/auth.rb', line 24

def validate!
  [:client_id, :client_secret, :auth_url, :auth_path, :token_path].each do |name|
    raise ArgumentError,
      "Missing required HCP authentication configuration value: HCP_#{name.to_s.upcase}" if self.send(name).to_s.empty?
  end
end