-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dynamic token refresh and authentication error handling (#911)
This commit replaces static authentication tokens with a dynamic token injection interface, improving auth lifecycle management. Key features include: 1. Dynamic Token Management - New authTokenInjector function replaces static token configuration - Automatic token refresh on 401 (Unauthorized) responses - Proper error handling for 403 (Forbidden) responses 2. Authentication Error Handling - Added auth-error event subscription for monitoring - Automatic retry for syncLoop and watchLoop operations - Manual retry for activate/deactivate/attach/detach operations Example usage: const client = new yorkie.Client(YorkieAPIAddr, { apiKey, authTokenInjector: async (reason) => { if (reason === 'token expired') { return await refreshAccessToken(); } return accessToken; }, }); Related to yorkie-team/yorkie#1037 --------- Co-authored-by: Youngteac Hong <[email protected]>
- Loading branch information
1 parent
924ba4c
commit cdde945
Showing
17 changed files
with
3,538 additions
and
6,757 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ services: | |
ports: | ||
- '8080:8080' | ||
- '8081:8081' | ||
extra_hosts: | ||
- 'host.docker.internal:host-gateway' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.