-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/credential selection #423
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?
Conversation
- Refactor ProofController.acceptRequest to support simplified proof formats - Add hydration logic to convert simplified formats to full Credo-TS formats - Add validation for simplified formats (400 Bad Request) - Add error handling for missing credentials (404 Not Found) - Export ProofFormats type in types.ts - Update unit tests to verify new logic and remove any casts - Add documentation for explicit credential selection - Update README with link to new docs - Update maker script to support credential selection
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 explicit credential selection for proof requests, allowing API clients to specify which credentials should be used when responding to proof requests rather than relying on automatic selection. The implementation adds a simplified API format that gets hydrated into the complex Credo TS proof format, reducing client-side complexity.
Key Changes
- New API capability: POST
/v1/proofs/{proofRecordId}/accept-requestnow accepts optional simplifiedproofFormatswith justcredentialIdandrevealedfields - Hydration logic: Controller automatically enriches simplified format with full credential metadata from Credo TS wallet
- Script enhancement:
maker-accept-proof-from-oem.tsupdated to support credential selection via CLI argument
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/controllers/v1/proofs/ProofController.ts | Implements three-path logic (auto-select/hydrate/pass-through) with hydration loops for attributes and predicates, plus type guard for format detection |
| src/controllers/types.ts | Adds SimpleProofFormats interface and exports ProofFormats type, extends AcceptProofRequestOptions with new proofFormats field |
| tests/unit/proof.test.ts | Adds single happy-path test for simplified credential selection, validates hydration output structure |
| scripts/maker-accept-proof-from-oem.ts | Adds --credential-id CLI parameter, constructs simplified proofFormats from proof request message |
| docs/explicit-credential-selection.md | Comprehensive new documentation explaining the feature, API usage, three-path logic, and example scenario |
| README.md | Minor formatting fixes (code blocks, links), adds reference to new documentation, fixes typo |
| docker-compose-integration-tests.yml | Updates comments with NODE_EXTRA_CA_CERTS setup instructions, adds environment variable to test service |
| package.json, package-lock.json | Version bump from 0.16.13 to 0.16.14 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@rmlearney-digicatapult I've opened a new pull request, #424, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Fix TypeScript errors in ProofController hydration logic - Downgrade sensitive credential logging to debug level - Add extensive unit tests for ProofController edge cases and security checks
- Redact sensitive credential data from ProofController logs - Remove temporary /credentials endpoint - Improve type safety in redaction logic (remove any)
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
Copilot reviewed 8 out of 9 changed files in this pull request and generated 9 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: David Blane <32327139+dblane-digicatapult@users.noreply.github.com>
|
@copilot re-review. ignore maker-accept-proof-from-oem.ts and redactProofFormats method redacts credentialInfo and value fields for logging, but the credentialId itself is not redacted |
|
@rmlearney-digicatapult I've opened a new pull request, #428, to work on those changes. Once the pull request is ready, I'll request review from you. |
- Add GET /:proofRecordId/content to return proof format data - Remove legacy getProposalMessage endpoint - Update unit tests
… dependency updates
- Refactor ProofController to use strict types and helper methods - Update ProofController tests to cover new logic and remove 'any' types - Add tests for proof content simplification and includeContent - Filter out redundant proof state change events in ProofEvents - Add tests for webhook noise reduction
…plicit credential selection
- Fix 500 error in ProofController by adding null check for availableAnonCreds - Update e2e test to filter credentials by connectionId to avoid stale data - Update e2e test to use correct credentialRecordId from nested structure - Configure Bob agent to never auto-accept credentials to enable manual acceptance testing
…automation - Update `register-schema.ts` to default to `makeAuthorisation.json`. - Update `issue-credential.ts` to auto-lookup the latest credential definition. - Update `maker-connect-to-oem.ts` to auto-lookup the latest holder credential. - Update `oem-accept-connection.ts` to auto-accept pending connections. - Update `maker-propose-proof-to-oem.ts` to disable auto-accept proof, enabling manual response flow. - Add `maker-accept-credential.ts` for credential acceptance. - Replace `maker-accept-proof-from-oem.ts` with `maker-respond-proof-request.ts` for robust proof handling.
Pull Request
Checklist
PR Type
Please delete options that are irrelevant.
Linked tickets
High level description
Updated
ProofControllerto accept credential selection when presenting a proof rather than trusting the agent to pick the one from the top of the listUpdated the
ProofControllerwith an endpoint to retrieve the proof contentDetailed description
AI-assisted PR.
New API Capability: The
POST /proofs/{proofRecordId}/accept-requestendpoint now accepts a simplifiedproofFormatsobject in the body. This allows callers to specify exactly which credentialId should satisfy each attribute or predicate in a proof requestNew proposalMessage endpoint: added
GET /proofs/:proofRecordId/contentto retrieve the formatted proof content for a specific proofRecordHydration Logic: Implemented logic in the
ProofControllerto "hydrate" these simplified selection requests into the complex protocol-specific formats required by Credo-TS (e.g. anoncreds proof structures)Validation: Added strict validation to ensure requested credentials exist and match the proof requirements, returning
400 Bad Requestfor malformed requests and404 Not Foundfor missing credentialsType Safety: Refactored the
ProofControllerand associated tests to remove any casts, significantly improving type safety and maintainabilityTests: Unit test coverage for all new functionality
Documentation:
Added comprehensive documentation in explicit-credential-selection.md detailing the new workflow and payload structures
Describe alternatives you've considered
No changes, allowing the agent to just automatically choose which credentials to use for proofs from the 'top of the pile'
Operational impacte
Allowing the verifying agent to select which fields they want to be proven
Allowing the proving agent to select which credentials to use for proof, selecting from multiple credentials and composing multiple credentials to generate proofs
Additional context