Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit x-amz- headers from custom interceptor #3491

Closed
gevartosky opened this issue Feb 1, 2024 · 7 comments
Closed

Edit x-amz- headers from custom interceptor #3491

gevartosky opened this issue Feb 1, 2024 · 7 comments
Labels
api Issues related to the API category question General question

Comments

@gevartosky
Copy link

Is your feature request related to a problem? Please describe.

While trying to apply my custom V4 signature to an AWSAPIPlugin request, I keep getting a CRT 6148 error that comes from the Signer.swift when the postludeInterceptors are applied.

I use a custom V4 signature and I haven't found anywhere in the documentation indicating how to add a custom signature.

Describe the solution you'd like

Being able to customize V4 signatures from custom URLInterceptors

Describe alternatives you've considered

I haven't found any alternative in the documentation

Is the feature request related to any of the existing Amplify categories?

API

Additional context

No response

@thisisabhash thisisabhash added api Issues related to the API category feature-request Request a new feature labels Feb 1, 2024
Copy link
Contributor

github-actions bot commented Feb 1, 2024

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@gevartosky
Copy link
Author

Is there any alternative to achieve this using a different approach or escape hatch?
I'm migrating my client's entire app to Amplify V2 in one go (since it can't coexist with AppSync) so unfortunately time is of the essence.

@lawmicha
Copy link
Member

lawmicha commented Feb 2, 2024

Hi @gevartosky, how are you applying the custom logic onto the request? For some context, we introduced the new interceptors pattern in #3190 that has the postludeInterceptors you are referring to.

@thisisabhash thisisabhash added the pending-community-response Issue is pending response from the issue requestor label Feb 2, 2024
@lawmicha
Copy link
Member

lawmicha commented Feb 2, 2024

postludeInterceptors are only added according to the configuration, you can set the configuration's authorizationType to NONE https://docs.amplify.aws/swift/build-a-backend/graphqlapi/customize-authz-modes/#none and define a custom interceptor

@github-actions github-actions bot removed the pending-community-response Issue is pending response from the issue requestor label Feb 2, 2024
@gevartosky
Copy link
Author

Thank you @lawmicha I was able to overwrite the headers by setting the auth type to "NONE".

When I was first looking at this I went straight to Advanced Workflows > Adding Headers to Outgoing Requests
https://docs.amplify.aws/swift/build-a-backend/graphqlapi/advanced-workflows/#adding-headers-to-outgoing-requests

It does mention By default, the API plugin includes appropriate authorization headers on your outgoing requests, but I think it would be beneficial to make a connection with that other page (Customize Auth Modes) in case devs are looking to overwrite authorization headers and fall in the same situation.

@thisisabhash
Copy link
Member

Hello @gevartosky, We have merged the update to the docs site which includes a call out to NONE authorization.
aws-amplify/docs#6886

Copy link
Contributor

github-actions bot commented Feb 6, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API category question General question
Projects
None yet
Development

No branches or pull requests

3 participants