Skip to content

Commit

Permalink
Implement the common validate_credentials API
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Aug 8, 2019
1 parent a75dfbd commit 1f38b78
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/models/manageiq/providers/amazon/manager_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ module ClassMethods
# Connections
#

# Validate Credentials
# args:
# {
# "region" => "",
# "endpoints" => {
# "ec2" => {
# "access_key" => "",
# "secret_access_key" => "",
# }
# }
# }
def validate_credentials(args)
region = args["region"]
ec2_endpoint = args.dig("endpoints", "ec2")
raw_connect(ec2_endpoint["access_key"], ec2_endpoint["secret_access_key"], "ec2", region)
end

def raw_connect(access_key_id, secret_access_key, service, region,
proxy_uri = nil, validate = false, uri = nil, assume_role: nil)

Expand Down

0 comments on commit 1f38b78

Please sign in to comment.