Commit graph

16 commits

Author SHA1 Message Date
Max
87f80b0ccc Refactor OAuth token refresh handling to improve concurrency management
- Introduce a refresh gate mechanism to prevent duplicate refresh attempts for the same token, allowing concurrent requests to safely handle expired tokens.
- Update the guard and refresh token logic to utilize the new error handling for in-progress refresh operations, enhancing the reliability of the authentication flow.
- Remove the previous caching mechanism for refresh status, streamlining the code and improving clarity in the refresh process.
2026-03-02 14:12:22 +08:00
Max
a6d91c866d Implement refresh token rotation handling to prevent duplicate refresh attempts
- Enhance the OAuth authentication flow to allow concurrent requests to safely handle expired tokens without triggering multiple refresh attempts.
- Introduce a mechanism to mark refresh tokens as being rotated, ensuring that only one request processes the refresh while others can proceed with valid claims.
- Update the guard logic to reflect these changes, improving the overall efficiency and reliability of token management.
2026-03-02 11:01:45 +08:00
Max
b68660b3cd Enhance OAuth token handling and refresh logic
- Update the `Authenticate` method in the OAuth guard to allow for token refresh when an access token is expired but still valid.
- Introduce `TryRefreshToken` method to handle the refresh token logic, including token rotation and cookie management.
- Implement `VerifyTokenAllowExpired` and `VerifyRefreshToken` methods to improve token verification processes.
- Adjust error handling to provide clearer responses for token refresh failures.
- Refactor token expiration strategies in the login process to ensure consistent handling of access and refresh tokens.
2026-02-21 18:06:27 +08:00
Max
621290d578 Enhance guard handling and template configuration merging
- Update the OAuth guard to prevent automatic response writing on failure, allowing for custom error handling.
- Introduce a mechanism to register default guard redirects from template configurations, improving guard management.
- Refactor the page configuration merging process to prioritize page-specific settings while allowing inheritance from templates.
- Ensure guards can be explicitly disabled in page configurations, enhancing flexibility in guard application.
2026-02-15 16:34:31 +08:00
Max
a37bb5cdba Enhance API Guards and Documentation
- Added a new guard option for OAuth 2.1 authentication, with ACL checks performed in the Run function for API calls.
- Updated the API routing to include the new guard and clarified the OAuth guard's functionality in the code comments.
- Enhanced documentation to reflect the new guard options and their descriptions, improving clarity for developers on available authentication methods.
2026-01-04 16:40:23 +08:00
Max
097fb73416 Refactor SUI Command Arguments and Enhance Default Template Handling
- Updated the `build` and `watch` commands to accept a single argument for `<sui>` and made the `<template>` argument optional, improving usability.
- Introduced a default template assignment for the `agent` SUI, ensuring a more intuitive setup for users.
- Enhanced error messages for command usage to provide clearer guidance on expected input format.
- Added new OpenAPI file to the bindata, improving the framework's capabilities for API integration.
2026-01-01 10:28:45 +08:00
Max
80779bb0fc [feat] add SUI template.render process 2024-08-10 16:58:38 +08:00
Max
9977b62a09 [feat] SUI $backend function call supports custom Guard 2024-08-05 08:32:59 +08:00
yflau
1ac37b048f return 401 for invalid token 2024-08-04 12:54:05 +08:00
Max
2effd3c360 Update authorization error messages 2024-02-20 20:07:26 +08:00
Max
5104dab56b Add cookie-trace and cookie-jwt guards 2024-02-10 17:02:44 +08:00
Max
524a63d7af Refactor code to add context object and cookie function 2024-01-17 21:56:39 +08:00
Max
bf31ad4bf1 Add SetCookie function in guards.go 2024-01-17 21:39:04 +08:00
Max
a3862c1289 Add scriptGuardExec function to process script guards 2024-01-17 21:24:29 +08:00
Max
5ba6bfe749 Update Guards to accept Request object instead of gin.Context 2024-01-03 18:31:58 +08:00
Max
76d9811048 Add guard functionality and export page config 2024-01-03 18:03:27 +08:00