amplify-js
amplify-js copied to clipboard
Add support for Custom IAM credentials in API for Rest API
Is this related to a new or existing framework?
React
Is this related to a new or existing API?
REST API
Is this related to another service?
API Gateway
Describe the feature you'd like to request
Amplify API js library does not provide a way to pass custom IAM credentials. The only way it works right now is through the IAM credentials fetched through Identity Pool. It is deeply coupled with Auth.
Provide a way to supply Credentials in the init object that is passed while using API.get, or any other method.
Describe the solution you'd like
const myCredentials: Credentials = {
secretAccessKey: apiCredentials.SecretAccessKey,
accessKeyId: apiCredentials.AccessKeyId,
sessionToken: apiCredentials.SessionToken,
};
const myInit = {
credentials: myCredentials,
};
API.get(
apiName,
apiPath,
myInit
)
Describe alternatives you've considered
I tried to create headers with the AWSv4 signature and passed it through the init object while using API.get
The problem with that is I cannot configure Amplify using aws-exports file and have to maintain the mapping of all the content of the aws exports file.
Additional context
No response
Is this something that you'd be interested in working on?
- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change