Commit Graph

1033 Commits

Author SHA1 Message Date
dswbx
2d56b54e0c Enhance Guard and Form components with improved error handling and debugging
- Added debug logging in the `Guard` class to track policy evaluations and conditions.
- Updated error logging in the `Form` component to provide more context on invalid submissions.
- Introduced state management for form errors in the `AuthRolesEdit` component, displaying alerts for invalid data submissions.
2025-10-24 09:40:02 +02:00
dswbx
5d4a77fb10 Update permission context handling and improve JSON field component
- Enhanced `MediaController` to include context in the `entityCreate` permission for better access control.
- Refactored permission checks in `useBkndAuth` to ensure correct validation of role permissions.
- Modified `JsonField` component to directly use `formData` in `JsonEditor`, simplifying data handling and improving user experience.
2025-10-24 09:20:59 +02:00
dswbx
eb0822bbff Enhance authentication and authorization components
- Refactored `AppAuth` to introduce `getGuardContextSchema` for improved user context handling.
- Updated `Authenticator` to utilize `pickKeys` for user data extraction in JWT generation.
- Enhanced `Guard` class to improve permission checks and error handling.
- Modified `SystemController` to return context schema alongside permissions in API responses.
- Added new `permissions` method in `SystemApi` for fetching permissions.
- Improved UI components with additional props and tooltip support for better user experience.
2025-10-24 09:14:31 +02:00
dswbx
38902ebcba Update permissions handling and enhance Guard functionality
- Bump `jsonv-ts` dependency to 0.8.6.
- Refactor permission checks in the `Guard` class to improve context validation and error handling.
- Update tests to reflect changes in permission handling, ensuring robust coverage for new scenarios.
- Introduce new test cases for data permissions, enhancing overall test coverage and reliability.
2025-10-21 16:44:08 +02:00
dswbx
22e43c2523 feat: introduce new modes helpers 2025-10-18 16:58:54 +02:00
dswbx
e68e5792be set raw state to ClientProviders auth state 2025-10-17 08:47:00 +02:00
dswbx
511c6539fb fix: update authentication verification logic in Api tests
- Adjusted test cases in Api.spec.ts to reflect the correct authentication verification state.
- Updated expectations to ensure that the `isAuthVerified` method returns true when no claims are provided, aligning with the intended behavior of the API.
2025-10-15 18:46:21 +02:00
dswbx
9070f96571 feat: enhance API and AuthApi with credentials support and async storage handling
- Added `credentials` option to `ApiOptions` and `BaseModuleApiOptions` for better request handling.
- Updated `AuthApi` to pass `verified` status during token updates.
- Refactored storage handling in `Api` to support async operations using a Proxy.
- Improved `Authenticator` to handle cookie domain configuration and JSON request detection.
- Adjusted `useAuth` to ensure logout and verify methods return promises for better async handling.
- Fixed navigation URL construction in `useNavigate` and updated context menu actions in `_data.root.tsx`.
2025-10-15 18:41:04 +02:00
dswbx
0347efa592 fix Role creation method and permission checks in tests 2025-10-14 16:49:42 +02:00
dswbx
1b8ce41837 role and permission handling in auth module
- Updated the `Role` class to change the `create` method signature for improved clarity and flexibility.
- Refactored the `guardRoleSchema` to utilize the new `roleSchema` for better consistency.
- Introduced a new `TPermission` type to enhance type safety in permission handling across the application.
- Updated various components and forms to accommodate the new permission structure, ensuring backward compatibility.
- Enhanced the `AuthRolesEdit` and `AuthRolesList` components to improve role management and permissions display.
- Added new API endpoints for fetching permissions, improving the overall functionality of the auth module.
2025-10-14 16:36:42 +02:00
dswbx
6624927286 enhance form field components and add JsonEditor support
- Updated `ObjectField`, `ArrayField`, and `FieldWrapper` components to improve flexibility and integration options by supporting additional props like `wrapperProps`.
- Added `JsonEditor` for enhanced object editing capabilities with state management and safety checks.
- Refactored utility functions and error handling for improved stability and developer experience.
- Introduced new test cases to validate `JsonEditor` functionality and schema-based forms handling.
2025-10-14 16:36:16 +02:00
dswbx
803f42a72b Merge remote-tracking branch 'origin/main' into feat/advanced-permissions 2025-10-14 10:16:43 +02:00
dswbx
7e5c28d621 enhance Guard and permission handling with new test cases
- Updated the `Guard` class to improve context validation and permission checks, ensuring clearer error messages for unmet conditions.
- Refactored the `Policy` and `RolePermission` classes to support default effects and better handle conditions and filters.
- Enhanced tests in `authorize.spec.ts` and `permissions.spec.ts` to cover new permission scenarios, including guest and member role behaviors.
- Added new tests for context validation in permission middleware, ensuring robust error handling for invalid contexts.
- Improved utility functions for better integration with the updated permission structure.
2025-10-13 21:03:49 +02:00
dswbx
2f88c2216c refactor: restructure permission handling and enhance Guard functionality
- Introduced a new `createGuard` function to streamline the creation of Guard instances with permissions and roles.
- Updated tests in `authorize.spec.ts` to reflect changes in permission checks, ensuring they now return undefined for denied permissions.
- Added new `Permission` and `Policy` classes to improve type safety and flexibility in permission management.
- Refactored middleware and controller files to utilize the updated permission structure, including context handling for permissions.
- Created a new `SystemController.spec.ts` file to test the integration of the new permission system within the SystemController.
- Removed legacy permission handling from core security files, consolidating permission logic within the new structure.
2025-10-13 18:20:46 +02:00
dswbx
b89c090f87 Merge pull request #281 from stormbyte/main
Update docker image
2025-10-13 11:11:10 +02:00
dswbx
f4a7cde487 chore: bump version to 0.18.1 and update jsonv-ts dependency to 0.8.5 2025-10-13 10:58:33 +02:00
dswbx
a2d83d01a4 Merge pull request #283 from bknd-io/docs/cloudflare-images-hint
docs: add note about Cloudflare Image Optimization plugin requirement
2025-10-13 10:54:02 +02:00
dswbx
66392d094d Merge pull request #282 from bknd-io/fix/paginate-without-totals
fix pagination if endpoint's total is not available
2025-10-13 10:52:15 +02:00
dswbx
0352c72fb6 docs: add note about Cloudflare Image Optimization plugin requirement
Included a callout in the documentation for the Cloudflare Image Optimization plugin, clarifying that it does not function on the development server or with `workers.dev` subdomains, and requires enabling Cloudflare Image transformations.
2025-10-13 10:51:47 +02:00
dswbx
3f9be3a418 fix: refine FetchPromise execution in useApiInfiniteQuery
Updated the FetchPromise execution in the useApiInfiniteQuery function to include a refine parameter, enhancing the request handling process.
2025-10-13 10:46:04 +02:00
dswbx
fd3dd310a5 refactor: enhance MediaApi typing and improve vite example config handling for d1
Updated `MediaApi` to include improved generic typing for upload methods, ensuring type safety and consistency. Refactored example configuration logic in development environment setup for better modularity and maintainability.
2025-10-13 10:41:15 +02:00
dswbx
e6ff5c3f0b fix pagination if endpoint's total is not available
when using a connection that has softscans disabled (e.g. D1) pagination failed. Fixing it by overfetching and slicing
2025-10-11 20:37:14 +02:00
Your Name
5377ac1a41 Update docker builder 2025-10-08 22:41:43 +02:00
Your Name
0e870cda81 Bump version 2025-10-08 22:09:03 +02:00
dswbx
b784e1c1c4 Merge remote-tracking branch 'origin/release/0.19' into feat/advanced-permissions 2025-10-03 20:27:07 +02:00
dswbx
90f93caff4 refactor: enhance permission handling and introduce new Permission and Policy classes
- Updated the `Guard` class to improve permission checking by utilizing the new `Permission` class.
- Refactored tests in `authorize.spec.ts` to use `Permission` instances instead of strings for better type safety.
- Introduced a new `permissions.spec.ts` file to test the functionality of the `Permission` and `Policy` classes.
- Enhanced the `recursivelyReplacePlaceholders` utility function to support various object structures and types.
- Updated middleware and controller files to align with the new permission handling structure.
2025-10-03 20:22:42 +02:00
dswbx
d6dcfe3acc feat: implement file acceptance validation in utils and integrate with Dropzone component 2025-10-01 09:46:16 +02:00
dswbx
b974fe7ec7 Merge pull request #270 from bknd-io/feat/cli-user-role
feat: add role selection and auth checks in user create command
2025-10-01 09:40:20 +02:00
dswbx
6483ff74bb Merge pull request #271 from bknd-io/feat/auth-helper-cookie
feat: add helper methods for auth cookie headers
2025-10-01 09:40:03 +02:00
dswbx
27e2064f0c Merge pull request #272 from bknd-io/feat/media-add-body-max
feat: add media option to module to restrict body max size
2025-10-01 09:39:38 +02:00
dswbx
5cf91bb35a Merge pull request #273 from bknd-io/feat/schema-batch-statements
feat: batch schema manager statements
2025-10-01 09:39:19 +02:00
dswbx
81533d855a Merge pull request #277 from bknd-io/feat/timestamps-plugin
feat: timestamps plugin
2025-10-01 09:39:10 +02:00
dswbx
db58911df3 Merge pull request #250 from bknd-io/release/0.18
Release 0.18
2025-10-01 09:07:18 +02:00
dswbx
2540c83382 chore: bump version to 0.18.0 in package.json 2025-10-01 09:06:04 +02:00
dswbx
569d021316 fix: update OneToOneRelation and PolymorphicRelation configurations
Enhanced OneToOneRelation to allow source to create target with a mapping field and added a limit. Updated PolymorphicRelation to return a TextField for entity_id instead of NumberField, improving type consistency.
2025-10-01 09:00:44 +02:00
dswbx
ba9713587c chore: update Cloudflare proxy build target to ESNext and adjust package import handling
Set the build target for the Cloudflare adapter to ESNext to keep json import attribute.
2025-10-01 09:00:11 +02:00
dswbx
eecaeb7c06 chore: bump version to 0.18.0-rc.11 and add cloudflare makeConfig export
Updated package version to 0.18.0-rc.11 and included `makeConfig` in Cloudflare adapter exports to extend configuration capabilities.
2025-09-30 13:32:57 +02:00
dswbx
610e263477 fix: handle correct type conversion for relation fields
Updated `RelationField` to dynamically determine the type based on `target_field_type`. Added a test for proper TypeScript generation with text primary fields in system entities.
2025-09-30 13:32:22 +02:00
dswbx
0f54e8267f fix: exclude internal sqlite indices from introspection
Added a condition to filter out internal SQLite indices named 'sqlite_%' during introspection, ensuring cleaner and more relevant metadata retrieval.
2025-09-30 13:31:49 +02:00
dswbx
1fdee8435d feat: add timestamps plugin to manage created_at and updated_at fields
Introduced a new timestamps plugin that allows the addition of `created_at` and `updated_at` fields to specified entities. Included tests to verify functionality, ensuring timestamps are correctly set on entity creation and updates. Updated the plugin index to export the new timestamps functionality.
2025-09-29 22:12:23 +02:00
dswbx
1eeb23232a chore: bump version to 0.18.0-rc.10 in package.json and update EntityMediaFormField logic for single item handling 2025-09-29 22:10:07 +02:00
dswbx
6102759da8 chore: bump version to 0.18.0-rc.9 in package.json 2025-09-29 17:30:18 +02:00
dswbx
6cea581e42 fix: update database sync warning to clarify behavior in code mode
Revised the warning message for database sync requests to indicate that sync requests are ignored in code mode, as system tables may not be fully represented in the provided configuration.
2025-09-29 17:28:43 +02:00
dswbx
5e553a7fce Merge pull request #276 from bknd-io/feat/media-field-improvements
feat: improve media handling
2025-09-29 17:19:57 +02:00
dswbx
5e71fc8947 feat: implement media cleanup on entity deletion and enhance Dropzone logging
Added functionality to clean up media files associated with entities upon deletion, ensuring proper resource management. Enhanced logging in the Dropzone component to provide better feedback on file type validation and user interactions, improving overall user experience.
2025-09-29 16:47:44 +02:00
dswbx
d1ba638cd5 fix: refine mime type checks and improve MediaInfoModal layout
Updated tests to check for mime types using `toStartWith` for better validation. Adjusted mime type patterns in DropzoneInner for XML handling. Modified MediaInfoModal to enhance layout responsiveness and broaden text format support for previews, ensuring better file handling and user experience.
2025-09-29 16:07:40 +02:00
dswbx
d31416f85d feat: enhance mime type handling and improve file metadata management
Updated mime types to include additional formats for text and application categories. Improved file metadata handling in the Storage class to accurately reflect file properties during uploads. Enhanced the DropzoneInner component with new icons for various file types and refined the MediaInfoModal to support a broader range of text formats for previews.
2025-09-29 15:55:25 +02:00
dswbx
55082e9d0e feat: improve media handling
added local range requests, fix mime type detection, improve uploading using FormData, correctly use mime type allow list, added previews for audio, pdf and text
2025-09-29 14:55:19 +02:00
dswbx
0d74625270 feat: fix PDF mime type detection and enhance filename handling tests
Updated the mime types to include "pdf" in the application category. Enhanced the test suite for media mime types to validate filename handling for PDF files, ensuring correct extensions are maintained based on file type and name. This improves the robustness of the file handling logic in the application.
2025-09-29 09:55:02 +02:00
dswbx
800f14ede2 fix: fix wrangler platform proxy handling
Modified the external dependencies in the build configuration to include "bknd" and its submodules. Added a new asynchronous function to handle platform proxy options, improving error handling for the "wrangler" import and providing clearer logging for version resolution. Additionally, ensured that the schema manager skips processing for tables without names.
2025-09-29 09:28:37 +02:00