Commit graph

108 commits

Author SHA1 Message Date
Max
efc84fbb97 feat(doc): add yao doc CLI commands and YAML documentation for all packages
Implement yao doc process list/inspect/validate and yao doc runtime
list/inspect/validate commands. Validate uses engine addressing logic
(process.Of) and checks dynamic-ID group registries (model, store, fs,
task, schedule) to verify resources actually exist.

- cmd/doc/: CLI command tree with process and runtime subcommands
- cmd/root.go: wire docCmd into rootCmd
- 27 process doc.yml + doc.go pairs across yao packages
- cmd/doc/doc_test.go: integration tests

Made-with: Cursor
2026-04-23 21:37:43 +08:00
Max
413fd71841 feat(middleware): add support for markdown content negotiation and rendering
- Implemented content negotiation for markdown files based on URL suffix and Accept header.
- Introduced a new RenderRaw method to serve raw markdown content, bypassing HTML rendering.
- Updated PageConfig to include a handler for markdown output, enhancing flexibility in content delivery.
2026-04-02 18:55:36 +08:00
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
19c2d6b547 Implement dynamic route resolution using rewrite rules
- Introduce a new `RewriteRule` type and associated functions for managing URL rewrite rules in `service/static.go`.
- Add `GetRewriteRules` and `ResolveRoute` functions to facilitate the retrieval and application of rewrite rules.
- Update the `sui/api/run.go` to utilize the new route resolver for handling dynamic routes when the config file is not found.
- Define `RouteResolver` in `sui/core/interfaces.go` to allow for dynamic route resolution across the application.
2026-02-13 23:44:28 +08:00
Max
f7b8e970b2 Refactor Logging in Request Render Method
- Removed the dependency on the color package for logging warnings about uncached pages.
- Simplified the logging statement to directly use the log package, improving code clarity and reducing unnecessary imports.
2026-01-12 11:02:15 +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
8485dd420e Refactor API Routing and Update Content-Type Header
- Added new root-level endpoints for team management, including listing and creating teams, while maintaining OAuth protection.
- Streamlined user-related endpoints by removing unnecessary groupings, enhancing clarity and accessibility.
- Updated the Content-Type header in the API response to application/json for better consistency with API standards.
2026-01-04 16:15:44 +08:00
Max
787954f0af Enhance OpenAPI Integration and API Routing
- Introduced support for OpenAPI mode, allowing dynamic routing and OAuth guards for API endpoints.
- Updated API root path handling to accommodate OpenAPI configurations, ensuring consistent URL structures.
- Added well-known routes for Yao metadata and OAuth discovery, improving API discoverability.
- Refactored middleware and guards to streamline OpenAPI integration, enhancing overall service functionality.
- Removed deprecated agent TypeScript file, simplifying the codebase and improving maintainability.
2026-01-04 15:46:09 +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
c425b74383 Refactor error handling in various components to improve logging and message formatting
- Updated error messages to use fmt.Errorf with %s for better clarity and consistency.
- Enhanced logging statements to utilize formatted strings for improved readability.
- Refactored multiple Load functions across different modules to standardize error handling practices.
2025-09-28 10:24:17 +08:00
Max
77efc03582 feat: Enhance global build context and component handling
- Update NewGlobalBuildContext to accept a template parameter for improved context management.
- Refactor component handling in Compile method to include JIT components, enhancing dynamic component loading.
- Modify TemplateRender to utilize the updated global context, improving template processing.
- Adjust component attribute parsing to use "s:route" for better clarity in component identification.
2025-04-23 16:08:10 +08:00
Max
e59dacefa2 Improve error handling in request value execution
- Modify request value execution to log errors when method calls fail
- Prevent propagation of errors during value resolution
- Update error message in data merging to be more descriptive
2025-03-06 10:48:27 +08:00
Max
896e52a52a Fix PublicRoot bug and get Sid from request 2024-09-25 08:25:37 +08:00
Max
ddb337847e Refactor request guard to include page backend script execution 2024-09-24 08:00:05 +08:00
Max
0a21780473 Refactor component attribute handling to support spread operator and real-time rendering mode 2024-09-10 09:23:10 +08:00
Max
219f71b00e chore: Refactor TemplateRender to handle optional request parameters 2024-08-23 12:20:33 +08:00
Max
02651085d7 Improve SUI TemplateRender 2024-08-10 19:34:36 +08:00
Max
ce96d89c31 Improve SUI TemplateRender 2024-08-10 18:12:32 +08:00
Max
0f6bc06172 fix render public root bug 2024-08-10 17:18:35 +08:00
Max
80779bb0fc [feat] add SUI template.render process 2024-08-10 16:58:38 +08:00
Max
3bacc297cf chore: Fix error handling in Run function and improve page config loading 2024-08-06 16:31:56 +08:00
Max
9977b62a09 [feat] SUI $backend function call supports custom Guard 2024-08-05 08:32:59 +08:00
yflau
c35d623fc8 Merge branch 'main' of https://github.com/yflau/yao 2024-08-04 14:32:18 +08:00
yflau
1ac37b048f return 401 for invalid token 2024-08-04 12:54:05 +08:00
Max
d170ab6e53 Optimize $backend function call 2024-08-04 11:40:15 +08:00
Max
8e47849e93 [feat] Add $Backend function call to directly invoke backend functions from frontend scripts. 2024-08-03 20:31:02 +08:00
Max
259b707ca8 Refactor utils.ts for improved code readability and maintainability 2024-08-03 18:57:29 +08:00
Max
a07c1ece51 Add s:render feature for data update rendering (dev) 2024-08-02 21:18:02 +08:00
Max
fc1f80e0f5 feat: Add sourceRoots to Static struct in types.go 2024-08-01 18:16:59 +08:00
Max
6bcede11d9 Refactor SUI core to handle backend script errors during page execution 2024-07-26 16:02:35 +08:00
Max
7706439f8f Refactor SUI core to copy the script pointer to the request for page backend script execution 2024-07-25 19:07:50 +08:00
Max
276f29d777 [feat] SUI support BeforeRender hook for dataset processing, and deprecating the s:set method. 2024-07-25 17:56:40 +08:00
Max
58ca39a32b [feat] Sharing the Constants variable between frontend and backend scripts 2024-07-25 15:37:23 +08:00
Max
41495a2de0 fix sui test cases 2024-07-17 16:44:42 +08:00
Max
08f3fbc1e4 fix sui page locale and theme data caching bug 2024-07-16 04:53:01 +08:00
Max
b85e5eecd8 Fix the bug in the SUI language pack path 2024-07-15 16:57:28 +08:00
Max
ef8b8027cf [add] sui.trans.all and sui.trans.page to support automatic translation 2024-07-15 09:24:44 +08:00
Max
8dd5f02a7b feat: output warning messages during sui page build 2024-07-09 05:56:29 +08:00
Max
6542c6e46b refactor: optimize the SUI page compiler 2024-07-06 21:24:36 +08:00
Max
a4f28368d4 refactor: Update build process to include SUI CompileAsComponent support (dev) 2024-07-05 19:54:26 +08:00
Max
a435b1ad6e [chore] Update sui test cases 2024-07-04 17:06:42 +08:00
Max
28537e2163 [add] Support for JIT mode in SUI component imports ( dev ) 2024-07-02 20:40:35 +08:00
Max
671bba4aa4 [add] SUI language pack support (dev) 2024-06-28 11:25:22 +08:00
Max
c3644380ba refactor: Update Request struct to include data caching functionality 2024-06-27 21:11:38 +08:00
Max
6dcd704ea4 [add] Configuring SUI page caching to optimize static page loading speed 2024-06-27 20:02:03 +08:00
Max
a52f0ed1a4 refactor: Update Request struct to use NewData method for setting data 2024-06-26 18:19:51 +08:00
Max
0a5105b9d0 refactor: Update TemplateParser to support debug mode and DisableCache 2024-06-26 17:09:41 +08:00