Skip to content

Commit

Permalink
added authentication
Browse files Browse the repository at this point in the history
fixed cred_type for authentication
  • Loading branch information
nimrodshn committed Aug 28, 2017
1 parent c8eea3a commit d263025
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ def set_ems_record_vars(ems, mode = nil)
hawkular_endpoint.merge!(endpoint_security_options(hawkular_security_protocol, hawkular_tls_ca_certs))
end
if params[:alerts_selection] == 'prometheus'
params[:cred_type] = "prometheus_alerts"
prometheus_alerts_endpoint = {:role => :prometheus_alerts, :hostname => prometheus_alerts_hostname, :port => prometheus_alerts_api_port}
prometheus_alerts_endpoint.merge!(endpoint_security_options(prometheus_alerts_security_protocol, prometheus_alerts_tls_ca_certs))
end
Expand Down Expand Up @@ -567,6 +568,9 @@ def build_credentials(ems, mode)
if ems.kind_of?(ManageIQ::Providers::ContainerManager)
default_key = params[:default_password] ? params[:default_password] : ems.authentication_key
creds[:hawkular] = {:auth_key => default_key, :save => (mode != :validate)}
if params[:alerts_selection] == 'prometheus'
creds[:prometheus_alerts] = {:auth_key => default_key, :save => (mode != :validate)}
end
creds[:bearer] = {:auth_key => default_key, :save => (mode != :validate)}
creds.delete(:default)
end
Expand Down

0 comments on commit d263025

Please sign in to comment.