Closed pengwon closed 2 months ago
This pull request adds WeChat OAuth provider support to the Flet runtime authentication system. The implementation includes modifications to existing authentication classes and the addition of a new WeChat-specific OAuth provider class.
Change | Details | Files |
---|---|---|
Add WeChat OAuth provider implementation |
|
sdk/python/packages/flet-runtime/src/flet_runtime/auth/providers/wechat_oauth_provider.py |
Modify Authorization class to support WeChat OAuth flow |
|
sdk/python/packages/flet-runtime/src/flet_runtime/auth/authorization.py |
Update User class to be more flexible |
|
sdk/python/packages/flet-runtime/src/flet_runtime/auth/user.py |
Extend OAuthToken to include WeChat-specific fields |
|
sdk/python/packages/flet-runtime/src/flet_runtime/auth/oauth_token.py |
sequenceDiagram
participant C as Client
participant A as Authorization
participant W as WeChatOAuthProvider
participant WA as WeChat API
C->>A: get_authorization_data()
A->>W: Generate authorization URL
W-->>A: Return URL and state
A-->>C: Return authorization URL and state
C->>A: request_token(code)
A->>W: Prepare token request
W->>WA: Request access token
WA-->>W: Return access token and user info
W-->>A: Return token and user data
A-->>C: Return authenticated user
Description
Add WeChat OAuth Provider
Test Code
Type of change
Checklist:
Screenshots (if applicable):
Additional details
Summary by Sourcery
Add a WeChat OAuth provider to the authentication module, allowing users to authenticate using WeChat credentials. This includes handling specific WeChat OAuth token fields and fetching user details. Unit tests are included to ensure the functionality works as expected.
New Features:
Enhancements:
Tests: