awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
917 stars 265 forks source link

fix(aws-appsync-subscription-link): graphql header refactor to fix IA… #679

Closed david-mcafee closed 2 years ago

david-mcafee commented 2 years ago

fix(aws-appsync-subscription-link): graphql header refactor to fix IAM-based auth

Issue #, if available:

619

Description of changes: IAM-based auth is currently broken as we are passing the wrong headers to the IAM header handler. This PR updates the subscription link so that we no longer pass those headers to the IAM header handler, but maintain the headers for all other auth types in the event that the customer is supplying custom headers.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

david-mcafee commented 2 years ago

Merging this PR as it was previously approved. Added one minor update to keep in line with the previously merged PR for Apollo V3 packages (https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/671).

This change was tested with the following samples:

[ X ] node-apollo-V2-API-Key

[ X ] node-apollo-V2-Cognito

[ X ] node-apollo-V2-IAM

[ X ] react-apollo-V2-API-Key

[ X ] react-apollo-V2-Cognito

[ X ] react-apollo-V2-IAM

[ X ] react-native-apollo-V2-API-Key

[ X ] react-native-apollo-V2-Cognito

[ X ] react-native-apollo-V2-IAM