Module: InspecPlugins::Compliance::API::Login
- Included in:
- InspecPlugins::Compliance::API
- Defined in:
- lib/plugins/inspec-compliance/lib/inspec-compliance/api/login.rb
Defined Under Namespace
Modules: Automate2Server, AutomateServer, ComplianceServer Classes: CannotDetermineServerType
Instance Method Summary collapse
Instance Method Details
#login(options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/plugins/inspec-compliance/lib/inspec-compliance/api/login.rb', line 9 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'] = InspecPlugins::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 |