Commit graph

3141 commits

Author SHA1 Message Date
Max
59c32bd1f6 Update file tests to handle content type variations
- Modified assertions in file upload, retrieval, and content tests to account for content type variations that may include charset.
- Enhanced test robustness by checking that the content type starts with the expected value, improving validation accuracy.
2025-11-06 11:57:38 +08:00
Max
4f17105cd1
Merge pull request #1270 from trheyi/main
Enhance attachment upload functionality with image compression and me…
2025-11-06 11:54:02 +08:00
Max
2f6cf1a08c Enhance attachment upload functionality with image compression and metadata caching
- Introduced new fields for image compression options in the UploadChunk struct, allowing for better handling of image uploads.
- Updated the upload process to utilize cached compression settings from the first chunk, improving efficiency and consistency.
- Implemented a fallback mechanism for image compression, logging errors and using original files when compression fails.
- Refactored the compressStoredImage function to return the compressed size, enhancing the upload process and error handling.
2025-11-06 11:53:24 +08:00
Max
1e0d85acdf
Merge pull request #1269 from trheyi/main
Refactor file permission checks to enhance access control logic
2025-11-06 11:32:23 +08:00
Max
e435c03e0e Enhance attachment upload process and content type handling
- Updated the upload process to cache metadata from the first chunk, ensuring consistency in content type, filename, and user path across chunked uploads.
- Modified content type validation in tests to allow for charset variations, improving robustness in file type checks.
- Refactored database save logic to differentiate between new records and updates for chunked uploads, enhancing data integrity and performance.
2025-11-06 11:31:24 +08:00
Max
80d0b80a6d Refactor file permission checks to enhance access control logic
- Combined team and owner permission validation to streamline access checks for files.
- Implemented distinct validation paths for owner-only and team-only permissions, improving clarity and maintainability.
- Updated existing permission checks to ensure proper handling based on file sharing settings, enhancing security and user access management.
2025-11-06 09:44:36 +08:00
Max
6f44168b18
Merge pull request #1268 from trheyi/main
Enhance attachment management with public and share fields
2025-11-05 18:12:13 +08:00
Max
5d18e76acd Enhance attachment management with public and share fields
- Introduced new fields in the attachment model for public access control and sharing options, allowing attachments to be marked as public or shared with specific teams.
- Updated the upload process to handle new permission fields, ensuring proper handling of public and share options during file uploads.
- Implemented permission checks in the file retrieval and deletion processes to enforce access control based on user roles and attachment settings.
- Added comprehensive tests for the new permission fields to validate functionality and ensure correct behavior in various scenarios.
2025-11-05 18:11:36 +08:00
Max
94933cdb81
Merge pull request #1267 from trheyi/main
Remove unnecessary blank line in HasJobAccess function for cleaner code.
2025-11-05 14:23:02 +08:00
Max
27d8378511 Remove unnecessary blank line in HasJobAccess function for cleaner code. 2025-11-05 14:22:40 +08:00
Max
362fe21974
Merge pull request #1266 from trheyi/main
Enhance job and execution access control with authorization checks
2025-11-05 14:15:24 +08:00
Max
7feb3e7c7a Enhance job and execution access control with authorization checks
- Added authorization checks in ListExecutions, GetExecution, StopExecution, and GetExecutionProgress functions to ensure users have access to the respective jobs and executions.
- Implemented similar checks in ListJobs, GetJob, StopJob, and GetJobProgress functions to validate user permissions before performing actions.
- Introduced handling for unauthorized access attempts, returning appropriate error responses for better security and user feedback.
- Updated ListLogs and ListExecutionLogs functions to include access validation for job and execution logs.
2025-11-05 14:14:57 +08:00
Max
79cffc5cd4
Merge pull request #1265 from trheyi/main
Add Yao custom fields and enhance permission checks
2025-11-05 11:32:47 +08:00
Max
4f8f011da7 Add Yao custom fields and enhance permission checks
- Introduced new fields in the Job struct for Yao integration, including YaoCreatedBy, YaoUpdatedBy, YaoTeamID, and YaoTenantID.
- Updated the makeJob function to utilize YaoCreatedBy for setting the CreatedBy field.
- Enhanced permission checks in various functions to validate user access to collections, ensuring proper authorization handling.
- Implemented permission validation in document handling functions to restrict access based on user roles and collection settings.
2025-11-05 11:32:07 +08:00
Max
0bee90307d
Merge pull request #1264 from trheyi/main
Add permission checks for updating collection
2025-11-05 10:02:19 +08:00
Max
5c2f323e64 Add permission checks for collection removal
- Implemented authorization checks in the RemoveCollection function to ensure users have the necessary permissions before removing a collection.
- Introduced error handling for unauthorized access attempts, returning appropriate responses for permission denials.
- Enhanced security by validating user access based on their authorization information.
2025-11-05 10:01:07 +08:00
Max
d6713ecddb Add permission checks for updating collection metadata
- Implemented authorization checks in the UpdateCollectionMetadata function to ensure users have the necessary permissions before making updates.
- Introduced a new checkCollectionPermission function to validate user access based on team and owner constraints.
- Enhanced error handling to return appropriate responses for unauthorized access attempts.
2025-11-05 09:48:21 +08:00
Max
ce2c301278
Merge pull request #1263 from trheyi/main
Improve document search, seed duplicate handling, update token scopes, add user endpoints, and load scopes dynamically
2025-11-04 18:16:58 +08:00
Max
f6aead62bb Refactor scope loading to dynamically retrieve first-level subdirectories
- Introduced a new function to get first-level subdirectories in the scopes directory, enhancing the flexibility of scope definition loading.
- Updated the loadScopeDefinitions method to utilize this new function, replacing hardcoded subdirectory names with a dynamic approach.
- Improved the description of the invite verification scope in the user scope initialization for clarity.
2025-11-04 18:07:22 +08:00
Max
e1405a5fa2 Update user endpoint definitions to include profile and teams retrieval
- Added new endpoints for retrieving user profile and teams in the user scope initialization.
- Ensured the existing endpoint for team selection remains included for continued functionality.
2025-11-04 17:31:33 +08:00
Max
007cf0adb9 Update token scope references in user entry and login processes
- Changed token scope from `ScopeInviteVerification` to `ScopeEntryVerification` in both `GinVerifyInvite` and `LoginByUserID` functions to align with updated authorization requirements.
- Updated error messages to reflect the new expected scope for improved clarity in responses.
2025-11-04 16:52:03 +08:00
Max
30ed90d908 Enhance document search functionality and improve duplicate handling in seed process
- Enabled debug mode in the document search function to aid in troubleshooting.
- Updated duplicate handling logic to check for existing records before creating or updating, ensuring proper handling in reset scenarios where primary keys are present but the database is empty.
2025-11-04 16:26:31 +08:00
Max
b6df16e0a4
Merge pull request #1262 from trheyi/main
Add api_key mapping in VectorStoreConfig conversion
2025-11-03 15:40:17 +08:00
Max
72fe081a28 Add api_key mapping in VectorStoreConfig conversion
- Introduced mapping for the api_key field in the toVectorStoreConfig method to enhance configuration handling.
- This addition allows for the inclusion of the api_key in the extraParams, improving the flexibility of the configuration process.
2025-11-03 15:38:42 +08:00
Max
6440a6487d
Merge pull request #1261 from trheyi/main
Enhance environment variable processing in EntryConfig
2025-11-03 08:17:05 +08:00
Max
3b26873d56 Enhance environment variable processing in EntryConfig
- Added functionality to process SuccessURL, FailureURL, and LogoutRedirect fields in EntryConfig for environment variable substitution.
- Implemented checks to ensure that referenced environment variables exist, collecting any missing variables for further handling.
- Improved overall configuration handling by ensuring URLs are properly replaced with their corresponding environment variable values.
2025-11-03 08:16:41 +08:00
Max
a226bf6d7c
Merge pull request #1260 from trheyi/main
Refactor EndpointInfo struct initialization for improved readability
2025-10-31 20:56:01 +08:00
Max
7bbd0d08ca Refactor EndpointInfo struct initialization for improved readability
- Reformatted the initialization of the EndpointInfo struct in the ScopeManager to enhance code clarity and maintainability.
- Ensured consistent alignment of struct fields for better visual organization.
2025-10-31 20:55:23 +08:00
Max
5617821bd9
Merge pull request #1259 from trheyi/main
Enhance scope management with deep copy functionality
2025-10-31 20:32:52 +08:00
Max
6751136e6b Enhance scope management with deep copy functionality
- Implemented deep copy mechanisms for extra constraints and endpoint information to prevent shared state issues.
- Updated the `addEndpointRule` and `matchEndpoint` methods to utilize deep copies, ensuring data integrity during scope management.
- Added utility functions for deep copying maps and values, enhancing the robustness of the ACL system.
2025-10-31 20:32:22 +08:00
Max
4409133837
Merge pull request #1258 from trheyi/main
Add authorization checks and filtering in collection and document lis…
2025-10-31 19:51:14 +08:00
Max
6b38b76558 Add authorization checks and filtering in collection and document listing
- Integrated authorization information retrieval in `ListCollections` and `ListDocuments` functions to enhance security.
- Implemented permission-based filtering to ensure users can only access collections and documents they are authorized to view.
- Refactored query parameter construction for improved readability and maintainability.
2025-10-31 19:50:21 +08:00
Max
eb295f4410
Merge pull request #1257 from trheyi/main
Update asset modification times and refactor import statements
2025-10-31 11:14:17 +08:00
Max
0eff0091a0 Update asset modification times and refactor import statements
- Updated the modification times for various assets in `bindata.go` to reflect recent changes.
- Refactored import statements in `team_invitation.go` to maintain consistency and improve code organization by moving the `utils` import to the correct position.
2025-10-31 11:13:57 +08:00
Max
9cfac75472
Merge pull request #1256 from trheyi/main
Update asset metadata and enhance collection features in the API
2025-10-31 11:06:16 +08:00
Max
d17832c016 Update asset metadata and enhance collection features in the API
- Updated the modification times for various assets in `bindata.go` to reflect recent changes.
- Enhanced the collection management in the API by adding new fields for `preset`, `public`, and `share` in the collection and document models, allowing for better control over collection visibility and sharing options.
- Updated the `CreateCollection` function to incorporate the new `share` field, improving the handling of collection data based on user permissions.
- Refactored utility functions to streamline type conversions, ensuring consistent data handling across the user and team management functionalities.
2025-10-31 11:05:46 +08:00
Max
b139f6fc2e
Merge pull request #1255 from trheyi/main
Implement attachment wrapper parsing and Base64 conversion in attachm…
2025-10-30 09:59:39 +08:00
Max
0ee38a1cb3 Implement attachment wrapper parsing and Base64 conversion in attachment manager
- Added `Parse` function to handle attachment wrapper strings, extracting uploader name and file ID.
- Introduced `Base64` function to convert attachment wrappers to Base64 format, with optional data URI support.
- Enhanced `readFilePathAsBase64` to read files from the filesystem and return Base64 encoded content.
- Updated `teamInvitationGetPublic` to process team logos and inviter pictures as Base64 for direct display in the response.
2025-10-30 09:59:09 +08:00
Max
e1e089bb41
Merge pull request #1254 from trheyi/main
Add features query endpoint to user API
2025-10-29 15:33:16 +08:00
Max
538f76e317 Add features query endpoint to user API
- Introduced a new endpoint `GET /features` to allow authenticated users to query available features.
- This addition enhances the user experience by providing access to feature-related information directly through the API.
2025-10-29 15:32:36 +08:00
Max
04f70ce444
Merge pull request #1253 from trheyi/main
Add feature manager support in ACL initialization
2025-10-29 12:08:00 +08:00
Max
47934f87a7 Add feature manager support in ACL initialization
- Enhanced the ACL structure to include a new FeatureManager field, allowing for better management of feature-related permissions.
- Updated the New function to load the feature manager during ACL initialization, improving the overall functionality and logging success messages for better traceability.
2025-10-29 12:07:27 +08:00
Max
c2fdbc4235
Merge pull request #1252 from trheyi/main
Fix error handling in invitation resend test
2025-10-29 10:22:21 +08:00
Max
d7dc5dfd3f Fix error handling in invitation resend test
- Updated the `TestInvitationResend` function to properly handle errors when sending the invitation request, ensuring that any failures are reported during the test execution.
- This change improves the reliability of the test by providing clearer feedback on issues encountered during the invitation process.
2025-10-29 09:52:57 +08:00
Max
2d95ad6e94
Merge pull request #1251 from trheyi/main
Enhance team invitation functionality with locale support
2025-10-29 09:29:19 +08:00
Max
481a6edbd5 Enhance team invitation functionality with locale support
- Updated the invitation resend process to accept a locale parameter, allowing for locale-specific email formatting and invitation link generation.
- Modified the `teamInvitationResend` function to include locale handling, ensuring proper configuration based on the user's locale.
- Enhanced the `toString` utility function to support time formatting based on locale, improving date presentation in emails.
- Added new utility functions for locale-specific time formatting, ensuring consistent user experience across different regions.
- Expanded tests to validate the new locale handling in invitation processes, ensuring comprehensive coverage for various scenarios.
2025-10-29 09:28:55 +08:00
Max
b1958ee788
Merge pull request #1250 from trheyi/main
Refactor team configuration tests to remove uploader and avatar agent…
2025-10-28 17:24:21 +08:00
Max
7549a890e5 Refactor team configuration tests to remove uploader and avatar agent assertions
- Removed assertions for the uploader and avatar agent fields in the team configuration tests, as these fields are no longer preserved in the public configuration.
- Updated the GetTeamConfigPublic function to reflect the changes in the TeamConfig structure, ensuring only relevant fields are included in the public configuration.
- Adjusted test cases to maintain coverage while aligning with the updated configuration structure.
2025-10-28 17:22:44 +08:00
Max
5e438cde94
Merge pull request #1249 from trheyi/main
Add Yao member profile support in OIDC user info
2025-10-28 16:57:06 +08:00
Max
376befc21b Add Yao member profile support in OIDC user info
- Enhanced the OIDC user info structure to include Yao member profile information, such as member ID, display name, bio, avatar, and email.
- Updated the SignIDToken and MakeOIDCUserInfo functions to incorporate member details if available, improving team context handling.
- Refactored the issueTokens function to accept a new IssueTokensParams structure, streamlining token issuance with team and member context.
- Adjusted login functions to retrieve and pass member profile data during token issuance, ensuring comprehensive user context in authentication flows.
2025-10-28 16:55:06 +08:00