-
Notifications
You must be signed in to change notification settings - Fork 1
Allow creation of empty tokens with authenticated user internally #960
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
base: main
Are you sure you want to change the base?
Allow creation of empty tokens with authenticated user internally #960
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces the ability to create empty tokens with an authenticated user internally, laying groundwork for the openid4vc branch where the Token ID will be used as a nonce for presentations. The empty token can be created first to obtain its ID, then filled with content that references that ID. Additionally, the PR includes a critical type annotation fix, a defensive programming improvement, MongoDB action downgrade to address a known issue, and backbone service version updates.
Changes:
- Added
sendEmptyTokenmethod toTokenControllerallowing authenticated users to create empty tokens with auto-generated passwords - Fixed type decorator in
UpdateTokenContentParametersfrom incorrect "SendTokenParameters" to correct "UpdateTokenContentParameters" - Updated backbone services from 7.1.2 to 7.1.3 and downgraded MongoDB GitHub action to 1.12.1 to resolve CI failures
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/transport/src/modules/tokens/TokenController.ts | Added sendEmptyToken method for creating empty tokens with authenticated users |
| packages/transport/src/modules/tokens/local/SendEmptyTokenParameters.ts | New parameter class for sendEmptyToken operations |
| packages/transport/src/modules/tokens/backbone/TokenClient.ts | Added createEmptyToken method to support backend communication |
| packages/transport/src/modules/tokens/local/UpdateTokenContentParameters.ts | Fixed type decorator to match class name |
| packages/runtime/src/dataViews/DataViewExpander.ts | Added optional chaining for safer null handling |
| packages/transport/test/modules/tokens/TokenController.test.ts | Added basic test for sendEmptyToken functionality |
| .github/workflows/test.yml | Downgraded MongoDB action to 1.12.1 to fix CI failures |
| .dev/compose.backbone.yml | Updated all backbone services to version 7.1.3 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Readiness checklist
This PR serves as the basis for a following change in the openid4vc branch. There we want to use the Token ID as nonce for the presentation during the proactive sharing flow. But since we have to write the nonce (=> Token ID) into the Token content, but we only have the Token ID after creation, we have to create an empty token first, and fill the content afterwards.
Regarding 293e1cc: I had to downgrade the action because of this error. See supercharge/mongodb-github-action#74 (comment) for a GitHub issue where our error and the "fix" are mentioned.