Module: Compliance::API::Login
- Included in:
- Compliance::API
- Defined in:
- lib/bundles/inspec-compliance/api/login.rb
Defined Under Namespace
Modules: Automate2Server, AutomateServer, ComplianceServer Classes: CannotDetermineServerType
Instance Method Summary collapse
Instance Method Details
#login(options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bundles/inspec-compliance/api/login.rb', line 11 def login() raise ArgumentError, 'Please specify a server using `inspec compliance login https://SERVER`' unless ['server'] ['server'] = URI("https://#{['server']}").to_s if URI(['server']).scheme.nil? ['server_type'] = Compliance::API.determine_server_type(['server'], ['insecure']) case ['server_type'] when :automate2 Login::Automate2Server.login() when :automate Login::AutomateServer.login() when :compliance Login::ComplianceServer.login() else raise CannotDetermineServerType, "Unable to determine if #{['server']} is a Chef Automate or Chef Compliance server" end end |