-
Notifications
You must be signed in to change notification settings - Fork 29
New library for backend adaption #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
btspoony
wants to merge
59
commits into
main
Choose a base branch
from
backend-adaption
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduced the @burnt-labs/abstraxion-backend package, including essential files such as package.json, tsconfig.json, and ESLint configuration. - Set up Jest for testing with a basic configuration. - Updated pnpm-lock.yaml to reflect new dependencies and versions. - Added README and CHANGELOG for documentation and version tracking.
… and encryption - Implemented core functionality for session key management, including storing, retrieving, and revoking session keys. - Added encryption services using AES-256-GCM for secure session key storage. - Created a modular architecture with database adapter interfaces for extensibility. - Introduced comprehensive test coverage for encryption and session key management functionalities. - Updated README and documentation to reflect new features and usage examples.
- Added validation for configuration parameters in the AbstraxionBackend constructor to ensure required fields are provided. - Implemented input validation for userId and other parameters in various methods to improve error handling. - Introduced new error types: UserIdRequiredError and UnknownError for better clarity in error reporting. - Updated error handling to throw specific errors instead of generic ones, enhancing debugging and user feedback.
- Removed the encryptionService property and its instantiation from the AbstraxionBackend class as it is no longer needed. - This change simplifies the class structure and improves maintainability.
- Changed Jest test environment from jsdom to node for better compatibility with backend testing. - Simplified session key generation by directly creating a wallet with a default HD path, removing the previous mnemonic generation method and related code. - Updated the session key object to reference the wallet's mnemonic directly.
- Reformatted code across multiple files for consistent style, including spacing and line breaks. - Updated comments to enhance clarity and maintainability. - Ensured consistent use of double quotes for strings throughout the codebase. - Improved the structure of import statements for better organization. - Enhanced readability of function parameters and object properties by aligning them properly.
🦋 Changeset detectedLatest commit: 9e09707 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
… handling improvements - Integrated node-cache for improved state management with automatic cleanup. - Added comprehensive error handling with custom error classes for better clarity in error reporting. - Updated session key management to utilize the new error handling structure. - Enhanced configuration validation to ensure required fields are provided. - Introduced new error types for session key operations to improve debugging and user feedback.
- Introduced EncryptionService for AES-256-GCM encryption and decryption of session keys. - Added SessionKeyManager to manage session key lifecycle, including storage, retrieval, and revocation. - Updated AbstraxionBackend to utilize the new SessionKeyManager and adjusted import paths accordingly. - Enhanced test coverage for EncryptionService and SessionKeyManager functionalities.
- Changed import statements for crypto and util modules to use the node: prefix for better clarity and consistency across the codebase.
- Added patch version for @burnt-labs/tailwind-config. - Updated main and types fields in tailwind-config package.json to point to tailwind.config.ts. - Removed obsolete .env.example file from abstraxion-backend package.
- Added indexes for username and email in User model for improved query performance. - Changed sessionKeyExpiry type from Int to DateTime in SessionKey model for better date handling. - Updated AuditLog model to use DateTime for timestamp and added index for userId and timestamp. - Modified seed script to use Date objects for timestamps and added sessionKeyAddress in upsert conditions. - Introduced new methods in database adapter for revoking session keys and managing session key states. - Enhanced SessionKeyManager to handle session key creation, updates, and revocations more effectively. - Added comprehensive tests for wallet API and session key management functionalities.
- Introduced new methods for retrieving the last session key and active session keys in the database adapter. - Updated the session key management logic to utilize the new retrieval methods. - Refactored session key update and revocation methods to improve clarity and maintainability. - Adjusted session key info structure to allow optional createdAt and updatedAt fields. - Improved validation logic for session key info to reflect the updated structure.
- Introduced a comprehensive API middleware system for consistent error handling, rate limiting, and request validation across all API routes. - Added utility functions for standardized API responses, including success and error formats. - Created specific wrappers for health check and wallet operations to streamline API handler creation. - Enhanced type safety and maintainability with TypeScript support and structured context management. - Updated existing API routes to utilize the new middleware and wrapper functions for improved clarity and functionality.
…thods - Changed time handling in tests to use Date objects for better clarity and consistency. - Updated session key revocation method to accept session key address as a parameter. - Enhanced TestDatabaseAdapter with new methods for retrieving last and active session keys. - Refactored session key storage and update methods to support multiple session keys per user. - Improved audit log retrieval to handle Date objects correctly.
- Modified the test description to clarify that it initiates wallet connection for an existing user. - Added user creation step within the test to ensure the user exists before testing the wallet connection. - Removed the verification step for user creation as it is now handled within the test setup.
- Updated wallet test to utilize the public sessionKeyManager for better access and clarity. - Refactored session key management logic to streamline the retrieval of the sessionKeyManager instance. - Enhanced code readability by removing unnecessary import statements and simplifying the test setup.
- Changed sessionPermissions from an array to an object in multiple test cases for consistency and accuracy in session key management.
- Removed unnecessary imports from SessionKeyManager tests for improved clarity. - Changed sessionPermissions from an array to an object in TestDatabaseAdapter for consistency in session key management.
- Modified callbackSchema to include 'granted' and 'granter' fields for improved authorization handling. - Updated AbstraxionBackend to enforce required redirectUrl and treasury parameters. - Enhanced session key management by storing permissions and granter address during callback processing. - Refactored error handling to include new errors for missing redirectUrl and granter address. - Adjusted README to reflect changes in functionality and integration with frontend SDK.
- Added XION_REDIRECT_URL and XION_TREASURY to env.example for improved configuration. - Updated callbackSchema to include 'state' for better validation. - Enhanced AbstraxionBackend to validate presence of redirectUrl and treasury during initialization. - Refactored error handling to utilize centralized error types for consistency. - Improved session key management by incorporating new parameters in callback processing.
- Changed XION_RPC_URL to point to the new testnet endpoint in env.example, README, and wallet.test.ts. - Removed XION_DASHBOARD_URL references from the codebase to simplify configuration. - Cleaned up jest.setup.js by removing unnecessary comments and imports. - Updated implementation documentation to reflect the new RPC URL.
- Removed the storeSessionKey method from PrismaDatabaseAdapter and updated the addNewPendingSessionKey method to addNewSessionKey, allowing for both pending and active session key creation. - Enhanced the DatabaseAdapter interface to include revokeSessionKey and revokeActiveSessionKeys methods for better session key management. - Implemented getSessionKey method in SessionKeyManager for retrieving and decrypting active session keys. - Updated TestDatabaseAdapter to reflect changes in session key handling and added support for active state in session key creation. - Adjusted related methods and audit logging to ensure consistency with new session key management logic.
- Refactored session key management in SessionKeyManager to improve retrieval and storage processes. - Introduced new methods for handling session key states, including `storeGrantedSessionKey` and `getSessionKey`. - Updated error handling to include `SessionKeyInvalidError` and `InvalidStorageKeyError` for better clarity. - Enhanced DatabaseStorageStrategy and AbstraxionBackend to utilize new session key management methods. - Adjusted tests to reflect changes in session key handling and ensure comprehensive coverage.
- Removed unnecessary index from KVStore model in Prisma schema for cleaner structure. - Updated wallet tests to use the new session key management methods, including `storeGrantedSessionKey` and `getSessionKey`. - Adjusted test setup to ensure proper cleanup of audit logs and session keys before and after tests. - Renamed session key management methods for clarity and consistency in handling session states.
- Eliminated the KVStore model from the Prisma schema to streamline the database structure. - This change simplifies the User model by removing unnecessary relations and indexes.
- Updated DatabaseStorageStrategy to improve session key validation and error handling. - Refactored DatabaseRedirectStrategy to rename method parameters for clarity and adjusted cleanUrlParameters to do nothing. - Renamed createAbstraxionBackendAuth to startAbstraxionBackendAuth for better clarity in the authentication process. - Added extensive unit tests for DatabaseStorageStrategy and DatabaseRedirectStrategy to ensure robust functionality and error handling.
- Deleted the KeyRotationManager class to simplify session key management. - Removed the test script for the backend session API as it is no longer needed.
- Updated session key expiry duration in env.example for better session handling. - Changed development server port in package.json for consistency. - Refactored session key model in Prisma schema for improved clarity. - Enhanced wallet connection logic in API routes to support redirect URLs. - Implemented a new helper function for handling redirect responses. - Updated validation schemas to include optional redirect URL handling. - Improved error handling and response structure in the Abstraxion backend.
- Added a new health check endpoint documentation to verify service status and database connectivity. - Updated session key expiry duration in the README for clarity. - Revised setup instructions to include a script for environment setup and clarified manual setup steps. - Removed outdated information regarding the development server port and Prisma Studio access.
…rvices - Updated import paths to use the new xion module for security and database management. - Refactored wallet API routes to align with the new xion structure. - Added new xion-specific files for abstraxion backend and database handling. - Improved organization of security-related functionalities within the xion module.
- Removed the wallet callback route as it is no longer needed. - Updated the validation schema for session grant callbacks to improve clarity and maintainability. - Revised README.md to reflect changes in wallet connection management.
- Added new dependencies for @cosmjs/amino, @cosmjs/cosmwasm-stargate, @cosmjs/crypto, and cosmjs-types with specified versions. - Updated ts-jest dependency to include esbuild for improved performance.
- Updated the `getItem` method to decrypt session keys for "xion-authz-temp-account". - Modified error handling to skip setting granter accounts when session keys are not in PENDING state. - Added tests for various userId formats, edge cases, and concurrent operations in `AbstraxionStrategies.test.ts`. - Improved handling of invalid keys and session key states in both `getItem` and `setItem` methods.
- Removed success property from login and registration responses for cleaner API output. - Added new API routes for wallet account retrieval and transaction sending. - Implemented validation schema for transaction requests to ensure proper input. - Created TransferComponent and WalletComponent for managing token transfers and displaying wallet information. - Updated ProfilePage to integrate wallet components and display user wallet status.
- Updated transaction sending logic to ensure correct meta account address usage. - Added error handling for meta account address mismatches during transactions. - Implemented detailed permissions rendering in ProfilePage to display user wallet permissions clearly. - Enhanced WalletStatus type to support detailed contract permissions with spending limits.
- Added Notification and NotificationContainer components to manage user notifications. - Integrated notification system into TransferComponent to provide success and error messages upon transaction completion. - Updated Providers to include NotificationProvider for global access to notifications. - Enhanced ProfilePage and WalletComponent to improve user experience with notifications.
… authentication flow - Introduced InMemoryDummyRedirectStrategy for handling redirects in the absence of a request. - Updated AbstraxionBackend to utilize InMemoryDummyRedirectStrategy when no request is provided. - Enhanced authentication flow with additional checks for keypair and grants. - Added comprehensive tests for AbstraxionBackend to ensure proper functionality and error handling.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.