Feature/credential selection#423
Closed
rmlearney-digicatapult wants to merge 67 commits into
Closed
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.
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)
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>
- 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.
rmlearney-digicatapult
marked this pull request as draft
January 12, 2026 11:48
Contributor
Author
|
PR superseded by split PR approach |
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.
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 API Capability: The
GET /proofs/{proofRecordId}/credentialsendpoint allows retrieval of only those credentials which match the proof request from the agent, using native methods withincredo-ts, simplifying the need to get all credentials and filterNew 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