feat: implement device exchange and signer token management#19
Merged
Conversation
- Added new functionality for device token exchange and signer session management in the `src/signer` module. - Introduced `device-exchange.ts` for handling device token exchanges and minting signer tokens. - Implemented `forward.ts` for forwarding requests with JWT identity headers. - Created `token-manager.ts` to manage cached signer tokens efficiently. - Updated `server.ts` to handle direct signer proxy requests and responses. - Added comprehensive tests for the new features in `test/signer` to ensure reliability and correctness. - Updated `package.json` and `tsup.config.ts` to include new entry points for the signer module.
…dule - Introduced utility functions for JSON response parsing and field validation in `fetch-json.ts` and `json-fields.ts`. - Replaced inline error handling with the new utilities in `device-exchange.ts`, `mint-token.ts`, and `server.ts` for improved readability and maintainability. - Removed redundant error response functions to consolidate error handling logic in `handler-errors.ts`. - Updated related files to utilize the new error handling structure, enhancing consistency across the signer module.
- Refactored `resolveMint` in `device-exchange.ts` to directly use the config object, improving clarity and reducing redundancy. - Introduced a new utility function `oauthFailureDescription` in `fetch-json.ts` for consistent error message generation during OAuth failures. - Updated error handling in `readJsonObjectFromResponse` to utilize the new utility function, enhancing maintainability. - Consolidated type definitions in `proxy.ts` by exporting multiple types together for better organization. - Added helper functions in `proxy.ts` for URL joining and body string aliasing to streamline request handling. - Improved test coverage in `device-exchange.test.ts` with new utility functions for better input handling and response validation.
Expose plan-pricing helpers, signed-ticket ingest, PmtHouseClient billing methods, and optional pymthouse_hosted metering on the signer proxy so integrators can use OpenMeter-aligned plans without pymthouse-local copies. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace ReDoS-prone retail rate regex with linear trim, fix negated conditions in proxy alias pickers, and use typed fetch URL helpers in tests. Co-authored-by: Cursor <cursoragent@cursor.com>
- Added new files for handling lv2v sessions, orchestrator communication, and payment sessions. - Introduced functions for starting lv2v sessions, managing payment headers, and publishing trickle segments. - Implemented session storage and management for gateway sessions. - Created API key exchange functionality for signer sessions. - Added tests for gateway authentication and capabilities. - Updated build configuration to include new gateway server and client entry points.
- Added support for exchanging long-lived API keys for short-lived signer sessions in the PmtHouseClient. - Introduced new gateway client and server modules for handling live video streaming and session management. - Implemented discovery and orchestrator interaction features in the gateway server. - Updated README with new usage examples for API key integration and gateway functionalities. - Added new scripts for checking gRPC peer dependencies and smoke testing gateway sessions. - Enhanced package.json with new peer dependencies and entry points for the gateway module.
- Updated ESLint configuration to ignore additional directories. - Introduced a new function `isSafePathSegment` for validating session IDs in the gateway session smoke test. - Refactored bearer token extraction to handle case insensitivity and whitespace. - Added utility functions for stripping OIDC path suffixes and improved session management in the gateway server. - Enhanced error handling and response parsing in the gateway session handler. - Updated tests to cover new functionality and ensure robustness.
- Simplified address extraction logic in `parseDiscoveryList` for better readability and efficiency. - Enhanced `pickCertAuthority` to handle both string and array types for certificate common names, ensuring robust return values.
- Introduced `sonar-project.properties` for SonarQube integration, specifying project key, source directories, and exclusions. - Refactored gateway session handling in `gateway-session-smoke.mjs` and `stream-with-api-key.mjs` to utilize `parseHttpOrigin` for improved URL parsing. - Updated logging to provide clearer session status messages. - Enhanced utility functions in `string-utils.ts` for validating session IDs and parsing HTTP origins. - Improved error handling in session management and discovery processes. - Updated tests to cover new functionality and ensure robustness.
|
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
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.



src/signermodule.device-exchange.tsfor handling device token exchanges and minting signer tokens.forward.tsfor forwarding requests with JWT identity headers.token-manager.tsto manage cached signer tokens efficiently.server.tsto handle direct signer proxy requests and responses.test/signerto ensure reliability and correctness.package.jsonandtsup.config.tsto include new entry points for the signer module.