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

feat(api): Add async protocol implementation for token request interceptors #2870

Merged
merged 3 commits into from
Apr 19, 2023

Conversation

royjit
Copy link
Contributor

@royjit royjit commented Apr 17, 2023

Issue #

Description

  • Adds async version of protocol AmplifyAuthTokenProvider
  • Adds async version of protocol AuthTokenProvider
  • Depends on AppSyncRealTimeClient >= 3.1.0
  • All changes are backward compatible and should not break existing behavior

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@royjit royjit changed the title feat: Add async protocol method for request interceptors feat: Add async protocol implementation for token request interceptors Apr 17, 2023
@royjit royjit marked this pull request as ready for review April 17, 2023 22:52
@royjit royjit requested a review from a team as a code owner April 17, 2023 22:52
@royjit royjit changed the title feat: Add async protocol implementation for token request interceptors feat(api): Add async protocol implementation for token request interceptors Apr 18, 2023
@royjit royjit force-pushed the royjit.asynctokeninterceptor branch from 9d28cc2 to 97794e5 Compare April 18, 2023 20:35
Copy link
Member

@5d 5d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tokenResult: Result<String, Error>) -> AppSyncMessage {

guard let authToken = try? tokenResult.get() else {
log.warn("Missing authentication token for subscription")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consider log the error if it's failure case.

@royjit royjit changed the base branch from v1 to royjit.feat.asyncinterceptor April 19, 2023 19:44
@royjit royjit merged commit 6d33bd2 into royjit.feat.asyncinterceptor Apr 19, 2023
@royjit royjit deleted the royjit.asynctokeninterceptor branch April 19, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants