From 081a81ae01777f9a4b350b302733cf8c53df54b4 Mon Sep 17 00:00:00 2001 From: DianthuDia Date: Sun, 5 Jul 2015 02:47:43 +0900 Subject: [PATCH] Support unsigned_request for cognito-identity Find 'public API' in http://docs.aws.amazon.com/sdkforruby/api/Aws/CognitoIdentity/Client.html --- .../lib/aws-sdk-core/plugins/request_signer.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws-sdk-core/lib/aws-sdk-core/plugins/request_signer.rb b/aws-sdk-core/lib/aws-sdk-core/plugins/request_signer.rb index 730576a9f69..e8250d63a78 100644 --- a/aws-sdk-core/lib/aws-sdk-core/plugins/request_signer.rb +++ b/aws-sdk-core/lib/aws-sdk-core/plugins/request_signer.rb @@ -73,6 +73,15 @@ class Handler < Seahorse::Client::Handler AssumeRoleWithWebIdentity )) + COGNITO_IDENTITY_UNSIGNED_REQUESTS = Set.new(%w( + GetCredentialsForIdentity + GetId + GetOpenIdToken + ListIdentityPools + UnlinkDeveloperIdentity + UnlinkIdentity + )) + def call(context) sign_authenticated_requests(context) unless unsigned_request?(context) @handler.call(context) @@ -105,6 +114,8 @@ def unsigned_request?(context) STS_UNSIGNED_REQUESTS.include?(context.operation.name) elsif context.config.api.metadata['endpointPrefix'] == 'cloudsearchdomain' context.config.credentials.nil? || !context.config.credentials.set? + elsif context.config.api.metadata['endpointPrefix'] == 'cognito-identity' + COGNITO_IDENTITY_UNSIGNED_REQUESTS.include?(context.operation.name) else false end