Skip to content

Conversation

@tipusinghaw
Copy link
Contributor

@tipusinghaw tipusinghaw commented Jul 14, 2025

What

  • Implemented APIs for OID4VC and OID4VP
  • Used version 0.6.1-pr-2091-20241119140918

Summary by CodeRabbit

  • New Features

    • Introduced comprehensive OpenID4VC support, including endpoints for issuance sessions, issuers, verifiers, and holders.
    • Added new controllers and services for managing OpenID4VC entities and sessions.
    • Expanded API models and types for OpenID4VC operations and metadata.
  • Bug Fixes

    • Corrected minor syntax issues and improved import handling for dynamic modules.
  • Chores

    • Updated and added dependencies, improved ESLint configuration, and upgraded CI workflows.
    • Improved code formatting and consistency across controllers and services.

KambleSahil3 and others added 10 commits June 25, 2025 17:36
Signed-off-by: KambleSahil3 <sahil.kamble@ayanworks.com>
Signed-off-by: Sahil Kamble <sahil.kamble@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
@coderabbitai
Copy link

coderabbitai bot commented Jul 14, 2025

Walkthrough

This update introduces comprehensive OpenID4VC support by adding new controllers, services, types, and route registrations for issuance sessions, issuers, verifiers, and holders. It also updates dependencies, refactors ESLint configuration, and improves code consistency. Several patches are applied to external dependencies, and minor formatting and import adjustments are made throughout the codebase.

Changes

Files/Areas Change Summary
.eslintrc.js, eslint.config.mjs Replaces old ESLint config with a new modular config using ES module syntax, tailored for TypeScript, config, and test files.
.github/workflows/continuous-*.yml Updates CI to run on more branches, upgrades Node and Ubuntu versions, and minor workflow tweaks.
package.json Updates and adds dependencies, removes some, reformats scripts, adds resolutions, and removes Node engine requirement.
patches/@credo-ts+core+* Applies and removes patches affecting message forwarding, credential/proof protocol logic, and message type handling in @credo-ts/core.
README.md, src/authentication.ts, src/index.ts, src/securityMiddleware.ts, tsconfig.* Minor formatting, comment, or whitespace changes.
bin/afj-rest.js, src/events/WebhookEvent.ts Switches from static to dynamic imports for modules, adds error handling to CLI bootstrap.
src/utils/logger.ts, src/utils/TsyringeAdapter.ts, src/utils/tsyringeTsoaIocContainer.ts Refactors logger construction, adjusts IoC container method typings for simplicity.
src/cli.ts Refactors yargs CLI setup for clarity and conciseness, updates import paths.
src/cliAgent.ts Integrates OpenID4VC modules and routers into agent setup and inbound transport registration.
src/controllers/*Controller.ts, src/events/*Events.ts Reorders and deduplicates imports, adds trailing commas, and improves formatting in controllers and event handlers.
src/controllers/openid4vc/holder/holder.Controller.ts, holder.service.ts Adds new Holder controller and service for OpenID4VC holder operations (SD-JWT, mdoc, credential offers, proofs).
src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts, .service.ts Adds new IssuanceSessions controller/service for managing OpenID4VC issuance sessions and credential offers.
src/controllers/openid4vc/issuers/issuer.Controller.ts, issuer.service.ts Adds new Issuer controller/service for OpenID4VC issuer management.
src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts, .service.ts Adds new VerificationSessions controller/service for OpenID4VC verifier session and authorization response management.
src/controllers/openid4vc/verifiers/verifier.Controller.ts, verifier.service.ts Adds new Verifier controller/service for OpenID4VC verifier management.
src/controllers/openid4vc/types/*.ts Introduces new type definitions for OpenID4VC holder, issuer, and verifier operations.
src/controllers/types.ts, src/enums/enum.ts, src/utils/constant.ts, src/utils/oid4vc-agent.ts Adds foundational types, enums, and utility functions/constants for OpenID4VC and general data modeling.
src/dto/vCredentialIssuerMetadataDraft14.ts Adds a draft DTO class for credential issuer metadata.
src/routes/routes.ts Registers new OpenID4VC-related routes/controllers, adds corresponding models/types, and updates some existing models.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ExpressServer
    participant OpenID4VC_Controller
    participant OpenID4VC_Service
    participant Agent

    %% Example: Creating a Credential Offer (Issuance Session)
    Client->>ExpressServer: POST /openid4vc/issuance-sessions/create-credential-offer
    ExpressServer->>OpenID4VC_Controller: createCredentialOffer(request)
    OpenID4VC_Controller->>OpenID4VC_Service: createCredentialOffer(options, agent)
    OpenID4VC_Service->>Agent: createCredentialOffer(options)
    Agent-->>OpenID4VC_Service: offer/session record
    OpenID4VC_Service-->>OpenID4VC_Controller: offer/session record
    OpenID4VC_Controller-->>ExpressServer: offer/session record
    ExpressServer-->>Client: offer/session record

    %% Example: Holder requests credential
    Client->>ExpressServer: POST /openid4vc/holder/request-credential
    ExpressServer->>OpenID4VC_Controller: requestCredential(body)
    OpenID4VC_Controller->>OpenID4VC_Service: requestCredential(agent, body)
    OpenID4VC_Service->>Agent: requestAndStoreCredentials(...)
    Agent-->>OpenID4VC_Service: credential(s)
    OpenID4VC_Service-->>OpenID4VC_Controller: result
    OpenID4VC_Controller-->>ExpressServer: result
    ExpressServer-->>Client: result
Loading

Possibly related issues

Suggested labels

enhancement

Poem

A bunny hops with code anew,
OpenID4VC dreams come true!
Issuers, holders, verifiers—oh my!
Fresh routes and types now multiply.
With sessions issued, proofs in hand,
This rabbit’s code will surely stand.
🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tipusinghaw tipusinghaw self-assigned this Jul 14, 2025
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
@sonarqubecloud
Copy link

@tipusinghaw tipusinghaw marked this pull request as ready for review July 14, 2025 09:48
@tipusinghaw
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jul 14, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@credebl credebl deleted a comment from coderabbitai bot Jul 14, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 34

🔭 Outside diff range comments (6)
src/authentication.ts (1)

20-31: Function returns undefined for all failure paths – callers can’t detect 401

expressAuthentication only returns the string 'success'; on invalid or missing API keys it silently resolves undefined, leaving upstream middleware to infer failure. This breaks typical oas-tools expectations (throwing 401 or returning a rejected promise). Recommend explicit rejection:

       if (providedApiKey === dynamicApiKey) {
         return 'success'
       }
+
+      // Invalid key – trigger 401 for swagger-express-middleware / tsoa style handlers
+      throw {
+        status: 401,
+        message: 'Invalid API key',
+      }
     }
+
+    // Header not supplied – same 401
+    throw {
+      status: 401,
+      message: 'Authorization header missing',
+    }
   }

Fail-fast behaviour makes the security handler predictable and prevents accidental “pass-through” when chaining middlewares.

src/controllers/proofs/ProofController.ts (1)

275-275: Specify a concrete return type for proofFormData

Using Promise<any> bypasses TypeScript’s checks and is causing pipeline failures. Replace it with the actual type returned by this.agent.proofs.getFormatData, or at minimum use unknown as an interim, then define a proper interface.

• File: src/controllers/proofs/ProofController.ts
Line: the public async proofFormData…: Promise<any> signature

Suggested diff:

- // TODO: Add return type
- public async proofFormData(@Path('proofRecordId') proofRecordId: string): Promise<any> {
+ import type { FormatData } from '@aries-framework/core'  // adjust import to your library
+
+ // Return the actual format‐data type instead of `any`
+ public async proofFormData(@Path('proofRecordId') proofRecordId: string): Promise<FormatData> {

If the library doesn’t export a suitable type, define one based on the structure of getFormatData’s response:

interface ProofFormData {
  // …fields matching the returned data
}

public async proofFormData(...): Promise<ProofFormData> {}
src/controllers/did/DidController.ts (1)

353-353: Ensure didDocument uses the proper DidDocument type

Replace the explicit any on line 353 and import the correct type from @credo-ts/core:

• File: src/controllers/did/DidController.ts
– Add at the top with your other type imports:
diff + import type { DidDocument } from '@credo-ts/core'
– Change the declaration on line 353:
diff - let didDocument: any + let didDocument: DidDocument

This ensures strong typing for the DID document rather than using any.

patches/@credo-ts+core+0.5.15+001+message-type-for-messages.patch (2)

1-44: Consider alternative approaches to patching external dependencies.

Patching external dependencies can create maintenance challenges and potential breaking changes when updating packages. The added messageType property to PlaintextMessage is marked as required, which could break existing code that doesn't provide this property.

Consider these alternatives:

  1. Fork the dependency and maintain your own version with these changes
  2. Contribute upstream by submitting a pull request to the @credo-ts/core repository
  3. Use wrapper functions or adapters to add the message type tracking without modifying the core types

If you must keep the patch, consider making the messageType property optional to avoid breaking existing code:

-    messageType: string;
+    messageType?: string;

9-9: Potential runtime error: Direct property assignment bypasses type safety.

The code directly assigns messageType to the forwardMessage object without going through the proper constructor or type-safe mechanisms. This could lead to runtime errors or type inconsistencies.

Consider modifying the ForwardMessage constructor to accept the messageType parameter properly, or ensure the assignment is type-safe:

-            forwardMessage["messageType"] = message['@type'];
+            forwardMessage.messageType = message['@type'];
src/controllers/types.ts (1)

122-122: Replace 'any' types with specific types

Multiple locations use any type which reduces type safety. Consider using more specific types.

The ESLint pipeline is failing due to @typescript-eslint/no-explicit-any rule violations at lines 122, 128, 244, 287, and 320. Consider replacing these with more specific types or using unknown if the type is truly dynamic.

Also applies to: 128-128, 244-244, 287-287, 320-320

🧹 Nitpick comments (22)
src/authentication.ts (1)

33-39: Global mutable dynamicApiKey is process-wide – consider scoping

A module-level mutable variable will be shared across every tenant/request and can be overwritten accidentally.
If multiple clients require distinct keys, store them in a cache keyed by tenant/user, or inject via a config/service rather than a global.

This is optional, but improves safety under concurrent loads.

src/utils/constant.ts (1)

1-1: Consider grouping constants or freezing the value
A single-value file can bloat the util folder over time. Either create (or move to) a shared constants.ts barrel or export a frozen object to keep related symbols co-located.

-export const X509_CERTIFICATE_RECORD = 'X509_CERTIFICATE'
+export const CONSTANTS = Object.freeze({
+  X509_CERTIFICATE_RECORD: 'X509_CERTIFICATE',
+})
src/dto/vCredentialIssuerMetadataDraft14.ts (1)

1-4: Class name & placeholder field need refinement
Starting a class name with lowercase v breaks PascalCase convention and exampleField appears to be a stub. Recommend renaming and fleshing out actual draft-14 properties.

-export class vCredentialIssuerMetadataDraft14 {
-  exampleField?: string
-}
+/**
+ * Draft-14 issuer metadata (W3C/OID4VCI)
+ */
+export class CredentialIssuerMetadataDraft14 {
+  // TODO: populate with spec-compliant fields
+  credential_issuer?: string
+  authorization_server?: string
+  // ...
+}
src/utils/logger.ts (1)

92-99: Consider the impact of removing source attribute

The removal of the source attribute from the otelLogger.emit call reduces static source identification. This might make debugging more difficult in distributed logging scenarios.

Consider adding dynamic source identification if needed:

 otelLogger.emit({
   body: logMessage,
   severityText: LogLevel[level].toUpperCase(),
   attributes: {
     ...(data || {}),
     ...(errorDetails ? { error: errorDetails } : {}),
+    ...(this.logger.settings.name ? { source: this.logger.settings.name } : {}),
   },
 })
src/controllers/openid4vc/types/holder.types.ts (1)

22-25: Consider implementing or removing the commented selectedCredentials field.

The commented field suggests this feature might be planned but not yet implemented. If this is intended functionality, consider adding a TODO comment explaining the implementation timeline. Otherwise, remove the commented code to maintain clarity.

Would you like me to help implement the selectedCredentials functionality or create an issue to track this TODO?

src/cliAgent.ts (1)

414-428: Remove commented code block.

This large block of commented code appears to be an old implementation. Clean up the codebase by removing it.

src/utils/oid4vc-agent.ts (4)

39-41: Improve error message specificity.

The error message should specify which field is missing to help with debugging.

Apply this diff:

-    if (!issuerDid && !issuerx509certificate) {
-      throw new Error('Either issuerDid or issuerx509certificate must be provided')
-    }
+    if (!issuerDid && !issuerx509certificate) {
+      throw new Error('Either issuerDid or issuerx509certificate must be provided in issuanceMetadata')
+    }

126-126: Remove commented debug statement.


145-150: Clean up commented code in credential payload.

Multiple lines of commented code suggest incomplete refactoring. Either implement the functionality or remove these comments for clarity.

Also applies to: 157-157, 161-161, 165-165


213-217: Remove or implement the commented function.

This appears to be a placeholder for future functionality. Either implement it or remove it to avoid confusion.

src/controllers/openid4vc/issuers/issuer.service.ts (1)

13-15: Review console logging in production code.

The console.log statement with ESLint disable comment suggests this might be temporary debugging code. Consider using a proper logging framework instead.

-// eslint-disable-next-line no-console
-console.log(`\nIssuer URL: ${issuerMetadata.credentialIssuer.credential_issuer}`)
+// Consider using a proper logging framework
+logger.info(`Issuer URL: ${issuerMetadata.credentialIssuer.credential_issuer}`)
src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts (2)

45-45: Address the TODO comment for type fix

The commented TODO indicates incomplete type handling that should be addressed.

Would you like me to help fix the type issue for OpenId4VciCredentialFormatProfile or open an issue to track this?


141-141: Fix typo in documentation

-   * deletes ann issuance session by id
+   * deletes an issuance session by id
src/controllers/openid4vc/holder/holder.service.ts (1)

39-47: Fix typo in function name.

The function name contains a typo.

-function recursivelyMapAttribues(value: unknown): MappedAttributesReturnType {
+function recursivelyMapAttributes(value: unknown): MappedAttributesReturnType {
  if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') return value
  if (typeof value === 'string') return value
  if (value instanceof Map) {
-    return Object.fromEntries(Array.from(value.entries()).map(([key, value]) => [key, recursivelyMapAttribues(value)]))
+    return Object.fromEntries(Array.from(value.entries()).map(([key, value]) => [key, recursivelyMapAttributes(value)]))
  }
-  if (Array.isArray(value)) return value.map(recursivelyMapAttribues)
-  return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, recursivelyMapAttribues(value)]))
+  if (Array.isArray(value)) return value.map(recursivelyMapAttributes)
+  return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, recursivelyMapAttributes(value)]))
}
src/controllers/openid4vc/types/issuer.types.ts (1)

107-122: Consider using TypeScript utility types to reduce duplication.

UpdateIssuerRecordOptions duplicates properties from CreateIssuerOptions. Consider using Omit or Pick utility types for better maintainability.

-export interface UpdateIssuerRecordOptions {
-  display?: CredentialDisplay[]
-  dpopSigningAlgValuesSupported?: string[]
-  credentialConfigurationsSupported: Record<string, CredentialConfigurationSupportedWithFormats>
-  batchCredentialIssuance?: BatchCredentialIssuanceOptions
-}
+export interface UpdateIssuerRecordOptions extends Omit<CreateIssuerOptions, 'issuerId' | 'accessTokenSignerKeyType' | 'authorizationServerConfigs'> {}
src/controllers/openid4vc/types/verifier.types.ts (7)

1-1: Reconsider disabling explicit member accessibility rule.

The ESLint disable comment removes type safety benefits. Consider enabling explicit member accessibility to improve code clarity and maintainability.

-/* eslint-disable @typescript-eslint/explicit-member-accessibility */

20-56: Consider using more descriptive interface names.

The current naming pattern (JwtObject, LdpObject, etc.) could be more descriptive to indicate their purpose within the OpenID4VC context.

-export interface JwtObject {
+export interface JwtFormatDescriptor {
   alg: string[]
 }

-export interface LdpObject {
+export interface LdpFormatDescriptor {
   proof_type: string[]
 }

34-36: Consider using consistent naming conventions.

The property names use kebab-case within quotes, which is unconventional for TypeScript interfaces. Consider using camelCase with appropriate mapping if needed.

 export interface SdJwtObject {
-  'sd-jwt_alg_values'?: string[]
-  'kb-jwt_alg_values'?: string[]
+  sdJwtAlgValues?: string[]
+  kbJwtAlgValues?: string[]
 }

54-54: Consider consistent property naming.

The property name 'vc+sd-jwt' uses unconventional characters for TypeScript. Consider using a more standard naming approach.

-  'vc+sd-jwt'?: SdJwtObject
+  vcSdJwt?: SdJwtObject

107-107: Consider more specific typing for not property.

The not property uses Record<string, unknown> which is quite broad. Consider using a more specific type if the structure is known.

-  not?: Record<string, unknown>
+  not?: FilterV2

167-170: Consider using interfaces instead of classes for data structures.

Classes are typically used for behavior, while interfaces are better for pure data structures. These appear to be configuration objects without methods.

-export class OpenId4VcSiopVerifierClientMetadata {
-  client_name?: string
-  logo_uri?: string
-}
+export interface OpenId4VcSiopVerifierClientMetadata {
+  client_name?: string
+  logo_uri?: string
+}

172-175: Consider using interfaces for option types.

Similar to the previous comment, option types are typically better represented as interfaces unless they need constructor logic.

-export class OpenId4VcSiopCreateVerifierOptions {
-  verifierId?: string
-  clientMetadata?: OpenId4VcSiopVerifierClientMetadata
-}
+export interface OpenId4VcSiopCreateVerifierOptions {
+  verifierId?: string
+  clientMetadata?: OpenId4VcSiopVerifierClientMetadata
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f62739 and bad4d30.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (56)
  • .eslintrc.js (0 hunks)
  • .github/workflows/continuous-delivery.yml (0 hunks)
  • .github/workflows/continuous-integration.yml (1 hunks)
  • README.md (1 hunks)
  • bin/afj-rest.js (1 hunks)
  • eslint.config.mjs (1 hunks)
  • package.json (1 hunks)
  • patches/@credo-ts+core+0.5.1+001+initial.patch (0 hunks)
  • patches/@credo-ts+core+0.5.15+001+message-type-for-messages.patch (2 hunks)
  • patches/@credo-ts+core+0.5.3+002+fix-process-problem-report.patch (0 hunks)
  • patches/@credo-ts+core+0.5.3+006+w3c-issuance-without-holder-did-negotiaton.patch (0 hunks)
  • src/authentication.ts (1 hunks)
  • src/cli.ts (3 hunks)
  • src/cliAgent.ts (12 hunks)
  • src/controllers/agent/AgentController.ts (1 hunks)
  • src/controllers/basic-messages/BasicMessageController.ts (1 hunks)
  • src/controllers/connections/ConnectionController.ts (2 hunks)
  • src/controllers/credentials/CredentialController.ts (2 hunks)
  • src/controllers/credentials/CredentialDefinitionController.ts (5 hunks)
  • src/controllers/credentials/SchemaController.ts (2 hunks)
  • src/controllers/did/DidController.ts (2 hunks)
  • src/controllers/endorser-transaction/EndorserTransactionController.ts (7 hunks)
  • src/controllers/multi-tenancy/MultiTenancyController.ts (42 hunks)
  • src/controllers/openid4vc/holder/holder.Controller.ts (1 hunks)
  • src/controllers/openid4vc/holder/holder.service.ts (1 hunks)
  • src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts (1 hunks)
  • src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts (1 hunks)
  • src/controllers/openid4vc/issuers/issuer.Controller.ts (1 hunks)
  • src/controllers/openid4vc/issuers/issuer.service.ts (1 hunks)
  • src/controllers/openid4vc/types/holder.types.ts (1 hunks)
  • src/controllers/openid4vc/types/issuer.types.ts (1 hunks)
  • src/controllers/openid4vc/types/verifier.types.ts (1 hunks)
  • src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts (1 hunks)
  • src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts (1 hunks)
  • src/controllers/openid4vc/verifiers/verifier.Controller.ts (1 hunks)
  • src/controllers/openid4vc/verifiers/verifier.service.ts (1 hunks)
  • src/controllers/outofband/OutOfBandController.ts (6 hunks)
  • src/controllers/polygon/PolygonController.ts (4 hunks)
  • src/controllers/proofs/ProofController.ts (2 hunks)
  • src/controllers/question-answer/QuestionAnswerController.ts (3 hunks)
  • src/controllers/types.ts (3 hunks)
  • src/dto/vCredentialIssuerMetadataDraft14.ts (1 hunks)
  • src/enums/enum.ts (1 hunks)
  • src/events/CredentialEvents.ts (1 hunks)
  • src/events/QuestionAnswerEvents.ts (1 hunks)
  • src/events/WebhookEvent.ts (1 hunks)
  • src/index.ts (0 hunks)
  • src/routes/routes.ts (24 hunks)
  • src/securityMiddleware.ts (1 hunks)
  • src/utils/TsyringeAdapter.ts (1 hunks)
  • src/utils/constant.ts (1 hunks)
  • src/utils/logger.ts (5 hunks)
  • src/utils/oid4vc-agent.ts (1 hunks)
  • src/utils/tsyringeTsoaIocContainer.ts (1 hunks)
  • tsconfig.build.json (1 hunks)
  • tsconfig.eslint.json (1 hunks)
💤 Files with no reviewable changes (6)
  • .github/workflows/continuous-delivery.yml
  • src/index.ts
  • patches/@credo-ts+core+0.5.1+001+initial.patch
  • patches/@credo-ts+core+0.5.3+006+w3c-issuance-without-holder-did-negotiaton.patch
  • .eslintrc.js
  • patches/@credo-ts+core+0.5.3+002+fix-process-problem-report.patch
🧰 Additional context used
🧠 Learnings (8)
src/controllers/credentials/CredentialController.ts (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
package.json (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
src/controllers/multi-tenancy/MultiTenancyController.ts (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
src/controllers/did/DidController.ts (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
src/controllers/credentials/CredentialDefinitionController.ts (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
src/controllers/openid4vc/issuers/issuer.Controller.ts (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
src/controllers/openid4vc/holder/holder.Controller.ts (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
src/controllers/openid4vc/holder/holder.service.ts (1)
Learnt from: GHkrishna
PR: credebl/credo-controller#281
File: src/authentication.ts:0-0
Timestamp: 2025-07-09T11:14:49.346Z
Learning: In the credo-controller project, the team prefers JWT token cache to not expire (no TTL) for their authentication implementation in src/authentication.ts.
🧬 Code Graph Analysis (16)
src/controllers/multi-tenancy/MultiTenancyController.ts (2)
src/controllers/endorser-transaction/EndorserTransactionController.ts (1)
  • endorserTransaction (32-49)
src/controllers/types.ts (7)
  • EndorserTransaction (345-348)
  • RecipientKeyOption (373-375)
  • WriteTransaction (356-372)
  • CreateProofRequestOobOptions (126-138)
  • CustomW3cJsonLdSignCredentialOptions (438-440)
  • SignDataOptions (397-403)
  • SafeW3cJsonLdVerifyCredentialOptions (424-427)
src/controllers/endorser-transaction/EndorserTransactionController.ts (2)
src/controllers/multi-tenancy/MultiTenancyController.ts (1)
  • endorserTransaction (616-633)
src/controllers/types.ts (1)
  • WriteTransaction (356-372)
src/cli.ts (1)
src/cliAgent.ts (1)
  • Transports (67-67)
src/controllers/credentials/CredentialDefinitionController.ts (1)
src/controllers/examples.ts (1)
  • CredentialDefinitionId (35-35)
src/controllers/openid4vc/verifiers/verifier.service.ts (3)
src/cliAgent.ts (2)
  • RestMultiTenantAgentModules (120-120)
  • RestAgentModules (122-122)
src/controllers/openid4vc/types/verifier.types.ts (2)
  • OpenId4VcSiopCreateVerifierOptions (172-175)
  • OpenId4VcUpdateVerifierRecordOptions (177-180)
src/controllers/openid4vc/issuers/issuer.service.ts (1)
  • issuerService (56-56)
src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts (2)
src/cliAgent.ts (2)
  • RestMultiTenantAgentModules (120-120)
  • RestAgentModules (122-122)
src/controllers/openid4vc/types/verifier.types.ts (1)
  • CreateAuthorizationRequest (160-165)
src/controllers/openid4vc/issuance-sessions/issuance-sessions.service.ts (4)
src/controllers/openid4vc/types/issuer.types.ts (2)
  • OpenId4VcIssuanceSessionsCreateOffer (16-39)
  • X509GenericRecord (46-49)
src/cliAgent.ts (2)
  • RestMultiTenantAgentModules (120-120)
  • RestAgentModules (122-122)
src/errors/errors.ts (2)
  • BadRequestError (102-102)
  • NotFoundError (101-101)
src/utils/constant.ts (1)
  • X509_CERTIFICATE_RECORD (1-1)
src/controllers/outofband/OutOfBandController.ts (1)
src/controllers/types.ts (3)
  • CreateInvitationOptions (328-342)
  • RecipientKeyOption (373-375)
  • AcceptInvitationConfig (198-205)
src/utils/oid4vc-agent.ts (2)
src/controllers/openid4vc/types/issuer.types.ts (1)
  • OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions (6-14)
src/controllers/types.ts (1)
  • DisclosureFrame (485-487)
src/controllers/openid4vc/issuers/issuer.service.ts (2)
src/cliAgent.ts (2)
  • RestMultiTenantAgentModules (120-120)
  • RestAgentModules (122-122)
src/controllers/openid4vc/verifiers/verifier.service.ts (1)
  • issuerService (55-55)
src/controllers/openid4vc/issuers/issuer.Controller.ts (4)
src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts (1)
  • Tags (14-118)
src/controllers/openid4vc/verifiers/verifier.Controller.ts (1)
  • Tags (7-63)
src/controllers/openid4vc/issuers/issuer.service.ts (1)
  • issuerService (56-56)
src/controllers/openid4vc/types/issuer.types.ts (1)
  • UpdateIssuerRecordOptions (117-122)
src/controllers/types.ts (1)
src/controllers/examples.ts (2)
  • RecordId (20-20)
  • Did (25-25)
src/controllers/openid4vc/holder/holder.Controller.ts (2)
src/controllers/openid4vc/holder/holder.service.ts (1)
  • HolderService (49-225)
src/controllers/openid4vc/types/holder.types.ts (4)
  • ResolveCredentialOfferBody (1-3)
  • AuthorizeRequestCredentialOffer (13-16)
  • RequestCredentialBody (5-11)
  • ResolveProofRequest (18-20)
src/controllers/openid4vc/holder/holder.service.ts (1)
src/controllers/openid4vc/types/holder.types.ts (4)
  • ResolveCredentialOfferBody (1-3)
  • AuthorizeRequestCredentialOffer (13-16)
  • RequestCredentialBody (5-11)
  • ResolveProofRequest (18-20)
src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts (2)
src/controllers/openid4vc/types/verifier.types.ts (1)
  • CreateAuthorizationRequest (160-165)
src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts (1)
  • verificationSessionService (109-109)
src/controllers/openid4vc/types/issuer.types.ts (1)
src/utils/oid4vc-agent.ts (1)
  • OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions (218-272)
🪛 GitHub Actions: Continuous Integration
src/authentication.ts

[warning] 12-12: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/multi-tenancy/MultiTenancyController.ts

[warning] 1-1: ESLint: Unused eslint-disable directive (no problems were reported from 'prettier/prettier')


[warning] 384-384: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 439-439: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 474-474: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 808-808: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 809-809: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 843-843: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 878-878: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 949-949: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 1179-1179: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 1258-1258: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 1437-1437: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 1468-1468: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 1469-1469: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 1689-1689: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 1955-1955: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 2025-2025: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/proofs/ProofController.ts

[warning] 275-275: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/polygon/PolygonController.ts

[warning] 56-56: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 110-110: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 111-111: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/did/DidController.ts

[warning] 353-353: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts

[warning] 89-89: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/cliAgent.ts

[warning] 436-436: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 437-437: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/openid4vc/issuers/issuer.service.ts

[warning] 9-9: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 21-21: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/openid4vc/issuers/issuer.Controller.ts

[warning] 38-38: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/types.ts

[warning] 122-122: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 128-128: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 244-244: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 287-287: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 320-320: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/openid4vc/issuance-sessions/issuance-sessions.Controller.ts

[warning] 46-46: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/openid4vc/holder/holder.service.ts

[warning] 141-141: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 156-156: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/openid4vc/types/verifier.types.ts

[warning] 135-135: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

src/controllers/openid4vc/types/issuer.types.ts

[warning] 94-94: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

🪛 GitHub Check: Validate
src/cliAgent.ts

[warning] 437-437:
Unexpected any. Specify a different type


[warning] 436-436:
Unexpected any. Specify a different type

🪛 Gitleaks (8.26.0)
src/controllers/types.ts

490-490: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (50)
src/events/CredentialEvents.ts (1)

31-32: Trailing comma fix restores valid syntax

Adding the comma cleanly closes the callback argument list and eliminates the syntax error observed in previous builds/tests. No further action needed.

src/events/QuestionAnswerEvents.ts (1)

32-33: Comma insertion prevents parse error

Same minor syntax correction as elsewhere in the event modules—looks good.

tsconfig.build.json (1)

29-30: No functional impact

Only a trailing newline was added; nothing to review.

README.md (1)

134-135: Formatting-only tweak

The extra comma in the example keeps the argument list style consistent with codebase conventions—no issues.

src/securityMiddleware.ts (1)

26-28: Minor style correction acknowledged

The trailing comma after the predicate function is syntactically harmless and conforms to the repo’s prettier settings.

src/controllers/agent/AgentController.ts (1)

4-6: Imports correctly consolidated – good cleanup
Merging the TSOA decorators into the main import block removes the redundant secondary statement and improves readability. No functional impact observed.

tsconfig.eslint.json (1)

6-8: No remaining legacy alias references detected
Ran the following search to confirm all imports have been updated from afj-controller/* to credo-controller/*:

rg --line-number --pretty $'from ['"'"'"]afj-controller/'

No matches were found—every import now uses the new credo-controller/* alias. ESLint-driven type-checking in CI should pass without issues.

src/enums/enum.ts (1)

75-78: Enum addition looks good
SignerMethod aligns with the new OpenID4VC flow and follows the existing naming convention.

src/controllers/basic-messages/BasicMessageController.ts (1)

5-5: LGTM! Import consolidation improves code organization.

The consolidation of TSOA decorators into a single import statement follows best practices for import organization and enhances code readability.

src/controllers/credentials/CredentialController.ts (2)

17-17: LGTM! Import consolidation improves code organization.

The consolidation of TSOA decorators into a single import statement follows best practices for import organization and enhances code readability.


60-60: LGTM! Trailing comma addition improves maintainability.

The addition of a trailing comma to the last parameter follows best practices and makes future parameter additions cleaner in version control.

src/controllers/connections/ConnectionController.ts (2)

5-5: LGTM! Import reordering improves code organization.

Moving the TSOA decorator import to follow the core imports creates better logical grouping and improves code organization.


41-41: LGTM! Trailing comma addition improves maintainability.

The addition of a trailing comma to the last parameter follows best practices and makes future parameter additions cleaner in version control.

src/controllers/credentials/SchemaController.ts (2)

5-5: LGTM! Import reordering improves code organization.

Moving the TSOA decorator import to follow the core imports creates better logical grouping and improves code organization.


120-120: LGTM! Trailing comma addition improves maintainability.

The addition of a trailing comma to the function call argument follows best practices and makes future argument additions cleaner in version control.

src/events/WebhookEvent.ts (1)

5-5: LGTM! Dynamic import is necessary for node-fetch v3 compatibility.

The change from static import to dynamic import is required for node-fetch v3, which is ESM-only. The implementation correctly uses .default to access the default export from the ES module. This approach maintains compatibility while supporting the upgraded node-fetch version.

bin/afj-rest.js (1)

2-9: Good modernization to async module loading!

The change from synchronous require() to asynchronous import() is a good improvement. The error handling is properly implemented with clear error messages and appropriate exit codes.

src/controllers/proofs/ProofController.ts (2)

10-10: Import reorganization improves code structure.

Moving the TSOA imports to an earlier position improves import organization and consistency across the codebase.


227-227: Good addition of trailing comma for consistency.

The trailing comma addition aligns with the broader code style improvements in this PR.

src/controllers/did/DidController.ts (2)

14-14: Import reorganization improves consistency.

Moving the TSOA imports to an earlier position aligns with the broader code style improvements across the codebase.


128-128: Good addition of trailing commas.

The trailing comma additions improve code consistency and make future diffs cleaner.

Also applies to: 136-136

src/controllers/outofband/OutOfBandController.ts (2)

21-21: Import reorganization aligns with codebase standards.

Moving the TSOA imports to an earlier position is consistent with the broader code style improvements across the controller files.


96-96: Trailing comma additions improve code consistency.

The trailing comma additions across multiple parameter lists enhance code maintainability and align with modern JavaScript/TypeScript best practices.

Also applies to: 119-119, 153-153, 207-207, 292-292, 297-297

src/controllers/endorser-transaction/EndorserTransactionController.ts (2)

11-11: Import reorganization maintains consistency.

Moving the TSOA imports to an earlier position is consistent with the broader code style improvements across the codebase.


42-42: Trailing comma additions enhance code maintainability.

The trailing comma additions across parameter lists and function calls improve code consistency and make future diffs cleaner.

Also applies to: 73-73, 79-79, 85-85, 103-103, 135-135, 151-151, 180-180

src/controllers/question-answer/QuestionAnswerController.ts (2)

6-6: Good import consolidation.

The import statement consolidation improves readability and follows best practices for organizing imports.


39-39: Consistent trailing comma formatting.

The addition of trailing commas in parameter lists improves consistency and makes future parameter additions cleaner in diffs.

Also applies to: 69-69

src/controllers/polygon/PolygonController.ts (2)

8-8: Good import consolidation.

The import statement consolidation improves readability and follows best practices for organizing imports.


57-57: Consistent formatting improvements.

The addition of trailing commas and the missing comma fix improve code consistency and formatting.

Also applies to: 74-74, 112-112

.github/workflows/continuous-integration.yml (3)

5-7: Good infrastructure modernization

Adding the develop branch to the CI triggers is a sensible change for development workflows. This allows the team to run CI checks on both main and develop branches.


22-25: Node.js version upgrade looks good

The upgrade from Node.js 18.19.0 to 20 aligns with current LTS versions and the action update to v4 is appropriate for the newer Node.js version.


16-16: Verify Ubuntu 24.04 compatibility

We didn’t find any Ubuntu-specific configs in the repo, but upgrading the runner can still introduce subtle breaks. Please manually confirm:

  • The GitHub Actions runner label ubuntu-24.04 is officially supported.
  • All apt-get install commands (or other package managers) reference packages available in Ubuntu 24.04.
  • Any Dockerfiles or base images you use also support 24.04.
src/controllers/multi-tenancy/MultiTenancyController.ts (2)

4-9: Import organization improvements

The reorganization of imports and addition of trailing commas improves code consistency and readability.


63-63: TSOA import consolidation

Good consolidation of TSOA decorator imports into a single import statement for better organization.

package.json (3)

38-38: Lint script simplification

The simplification of the lint script from eslint --ignore-path .gitignore . to just eslint is good, assuming the ESLint configuration properly handles file patterns.


117-120: Resolutions field addition

The addition of the resolutions field ensures consistent versions of core dependencies across the dependency tree, which is good for avoiding version conflicts.


48-48: OpenID4VC Dependency Confirmed in Use

The @credo-ts/openid4vc package is actively imported and utilized across the codebase. No unused dependency concerns.

Key usage locations:

  • src/cliAgent.ts
    – Imports OpenId4VcIssuerModule, OpenId4VcVerifierModule and configures routers
  • src/utils/oid4vc-agent.ts
    – Implements getCredentialRequestToCredentialMapper with multiple OpenID4VC credential formats
  • src/routes/routes.ts
    – Exposes OpenID4VC API routes for issuance-sessions, issuers, verifiers, and holders
  • Controllers & Services
    controllers/openid4vc/issuers, verifiers, issuance-sessions, verification-sessions, and holder modules all invoke agent.modules.openId4Vc* methods
  • Type Definitions
    – Multiple interfaces (e.g. OpenId4VcIssuanceSessionsCreateOffer, OpenId4VcSiopCreateVerifierOptions) declared and used throughout

No further action required—the dependency is correctly integrated and in active use.

src/utils/logger.ts (2)

29-29: Improved constructor flexibility

The change from a fixed serviceName parameter to an optional name parameter makes the logger more flexible and reusable across different services.


34-34: Dynamic log level configuration

Using the instance's logLevel property instead of the constructor parameter for determining the minimum log level is a good improvement for consistency.

src/controllers/credentials/CredentialDefinitionController.ts (2)

6-6: TSOA import consolidation

Good consolidation of TSOA decorator imports into a single import statement, consistent with similar changes across other controllers.


36-36: Consistent formatting improvements

The addition of trailing commas and multiline formatting for async calls improves code readability and consistency across the codebase.

Also applies to: 39-40, 79-79, 108-109, 128-129, 133-133

src/cliAgent.ts (1)

435-438: Ensure Express router types on OID4VC endpoints

The current code in src/cliAgent.ts (lines 435–438) bypasses TypeScript checking by using any:

if (transport instanceof HttpInboundTransport) {
  transport.app.use('/oid4vci', modules.openId4VcIssuer.config.router as any)
  transport.app.use('/oid4vp', modules.openId4VcVerifier.config.router as any)
}

After confirming that config.router implements express.RequestHandler (or express.Router), update the casts:

- transport.app.use('/oid4vci', modules.openId4VcIssuer.config.router as any)
- transport.app.use('/oid4vp', modules.openId4VcVerifier.config.router as any)
+ transport.app.use('/oid4vci', modules.openId4VcIssuer.config.router as RequestHandler)
+ transport.app.use('/oid4vp', modules.openId4VcVerifier.config.router as RequestHandler)

Or, if it’s actually an express.Router instance:

import type { Router } from 'express'
// …
transport.app.use('/oid4vci', modules.openId4VcIssuer.config.router as Router)
transport.app.use('/oid4vp', modules.openId4VcVerifier.config.router as Router)

Please verify the exact type of config.router in @credo-ts/openid4vc and adjust the casts accordingly.

src/cli.ts (1)

1-6: Clean code refactoring looks good!

The formatting improvements enhance readability:

  • Adding .js extensions for ESM compatibility
  • Using hideBin helper as recommended by yargs
  • Simplifying validation with array.includes()
  • Consistent single-line formatting for simple options

Also applies to: 56-56, 72-75, 79-80, 107-107, 121-121, 133-133

src/controllers/openid4vc/verifiers/verifier.service.ts (1)

7-53: Well-structured service class with appropriate separation of concerns.

The service methods correctly delegate to the agent's OpenID4VC verifier module and use the dependency manager for repository operations. The type signatures are properly defined with union types for different agent module configurations.

src/controllers/openid4vc/issuers/issuer.Controller.ts (1)

27-108: Well-structured controller with consistent error handling.

The controller follows good patterns with proper dependency injection, route decorators, and consistent error handling using ErrorHandlingService.handle(). The method delegation to the service layer is appropriate.

eslint.config.mjs (1)

1-93: Successful ESLint configuration migration to ES module format.

The migration from .eslintrc.js to eslint.config.mjs is well-executed, preserving all existing rules while adopting the new configuration format. The file-specific overrides for config files and test files are properly maintained.

src/controllers/openid4vc/verifier-sessions/verification-sessions.service.ts (1)

73-98: Well-structured presentation format handling.

The logic for processing different presentation formats (JSON-LD, JWT, SD-JWT) is well-implemented with proper type checking and format-specific property extraction.

src/controllers/openid4vc/verifier-sessions/verification-sessions.Controller.ts (1)

11-14: Consider adding security decorator for consistency

Unlike IssuanceSessionsController, this controller lacks the @Security('apiKey') decorator. Verify if this is intentional.

If API key authentication is required for verification sessions, add:

@Tags('oid4vc verification sessions')
@Route('/openid4vc/verification-sessions')
+@Security('apiKey')
@injectable()
src/routes/routes.ts (1)

5658-5687: Critical Security Issue: Missing Authentication on VerifierController and HolderController

The Verifier and Holder controllers lack the @Security('apiKey') decorator at the class level, so TSOA did not inject authenticateMiddleware into their routes. All other OID4VC controllers (e.g., IssuerController) are properly secured.

Actions required:

  • Add a class-level @Security('apiKey') decorator above the @Route on each controller:
    • src/controllers/openid4vc/verifiers/verifier.Controller.ts
      @Tags('oid4vc verifiers')
      @Security('apiKey')
      @Route('openid4vc/verifier')
      export class VerifierController {  }
    • src/controllers/openid4vc/holder/holder.Controller.ts
      @Tags('oid4vc holders')
      @Security('apiKey')
      @Route('openid4vc/holder')
      export class HolderController {  }
  • Re-run TSOA to regenerate src/routes/routes.ts so that all /openid4vc/verifier/* and /openid4vc/holder/* endpoints include authenticateMiddleware([{"apiKey":[]}]).

fix_required

src/controllers/openid4vc/types/verifier.types.ts (1)

149-154: Unable to locate external type definition – please verify compatibility

We tried to find the DifPresentationExchangeDefinitionV2 declaration in node_modules/@credo-ts/core, but the package’s source isn’t present locally. Before merging, ensure that extending the external interface with these fields won’t break compatibility:

  • format?: Format
  • submission_requirements?: SubmissionRequirementModel[]
  • input_descriptors: InputDescriptorV2Model[]
  • frame?: object

• Confirm that the upstream DifPresentationExchangeDefinitionV2 allows these extensions (e.g., no required properties are overridden).
• If necessary, adjust the external package’s type or add corresponding upstream definitions.

Comment on lines 12 to 14
secMethod?: { [key: string]: any },
scopes?: string
scopes?: string,
) {
const logger = new TsLogger(LogLevel.info)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace any with a safer, lint-compliant type

CI fails on @typescript-eslint/no-explicit-any. Unless the OpenAPI generator mandates any, switch to a structural type (e.g. Record<string, unknown>) or unknown to satisfy the linter and avoid implicit-any hazards.

-  secMethod?: { [key: string]: any },
+  secMethod?: Record<string, unknown>,

If the object is expected to hold primitives only, narrow the value type accordingly (e.g. string | number | boolean).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
secMethod?: { [key: string]: any },
scopes?: string
scopes?: string,
) {
secMethod?: Record<string, unknown>,
scopes?: string,
) {
🧰 Tools
🪛 GitHub Check: Validate

[warning] 12-12:
Unexpected any. Specify a different type

🪛 GitHub Actions: Continuous Integration

[warning] 12-12: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

🤖 Prompt for AI Agents
In src/authentication.ts around lines 12 to 14, replace the type annotation for
secMethod from { [key: string]: any } to a safer type such as Record<string,
unknown> or a more specific structural type that fits the expected data. This
change will satisfy the @typescript-eslint/no-explicit-any lint rule and improve
type safety by avoiding implicit any usage.

Comment on lines +6 to +7
get: <T>(controller: any): T => {
return container.resolve<T>(controller)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Type safety degradation: Consider maintaining strict typing.

Changing the parameter type from Parameters<IocContainer['get']>[0] to any reduces type safety and could lead to runtime errors. This change might mask underlying type compatibility issues that should be addressed properly.

Consider these alternatives:

  1. Fix the root cause of the type compatibility issue instead of using any
  2. Use a more specific type that accurately represents the expected controller types
  3. Add runtime type checking if dynamic typing is necessary
-  get: <T>(controller: any): T => {
+  get: <T>(controller: new (...args: any[]) => T): T => {

Or maintain the original typing and fix the underlying issue:

-  get: <T>(controller: any): T => {
+  get: <T>(controller: Parameters<IocContainer['get']>[0]): T => {
-    return container.resolve<T>(controller)
+    return container.resolve<T>(controller as any)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
get: <T>(controller: any): T => {
return container.resolve<T>(controller)
get: <T>(controller: new (...args: any[]) => T): T => {
return container.resolve<T>(controller)
🤖 Prompt for AI Agents
In src/utils/TsyringeAdapter.ts around lines 6 to 7, the parameter type for the
get method is currently set to any, which reduces type safety. To fix this,
revert the parameter type to Parameters<IocContainer['get']>[0] or another
specific type that accurately represents the expected controller types. Avoid
using any to maintain strict typing and prevent potential runtime errors. If
dynamic typing is necessary, consider adding runtime type checks instead of
weakening the type signature.

createSchemaRequest: {
did: string
schemaName: string
schema: { [key: string]: any }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Address ESLint warning: Replace 'any' with specific type.

The schema parameter uses any type which reduces type safety. Consider defining a proper interface or using a more specific type.

-      schema: { [key: string]: any }
+      schema: Record<string, unknown>

Or better yet, define a proper schema interface:

+interface SchemaDefinition {
+  [key: string]: unknown
+}

-      schema: { [key: string]: any }
+      schema: SchemaDefinition
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
schema: { [key: string]: any }
schema: Record<string, unknown>
Suggested change
schema: { [key: string]: any }
schema: SchemaDefinition
🧰 Tools
🪛 GitHub Actions: Continuous Integration

[warning] 56-56: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

🤖 Prompt for AI Agents
In src/controllers/polygon/PolygonController.ts at line 56, the schema parameter
is typed as {[key: string]: any}, which triggers an ESLint warning due to use of
'any'. To fix this, define a specific interface or type that accurately
represents the expected structure of the schema object, then replace the 'any'
type with this more precise type to improve type safety and satisfy ESLint.

Comment on lines 110 to 111
operation: any
transaction: any
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Address ESLint warnings: Replace 'any' with specific types.

The operation and transaction parameters use any type which reduces type safety. Consider defining proper interfaces or using more specific types.

-      operation: any
-      transaction: any
+      operation: DidOperation
+      transaction: unknown

Or define proper interfaces:

+interface EstimateTransactionRequest {
+  operation: DidOperation
+  transaction: Record<string, unknown>
+}

-    estimateTransactionRequest: {
-      operation: any
-      transaction: any
-    },
+    estimateTransactionRequest: EstimateTransactionRequest,
🧰 Tools
🪛 GitHub Actions: Continuous Integration

[warning] 110-110: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)


[warning] 111-111: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

🤖 Prompt for AI Agents
In src/controllers/polygon/PolygonController.ts around lines 110 to 111, the
parameters 'operation' and 'transaction' are typed as 'any', which reduces type
safety and causes ESLint warnings. To fix this, replace 'any' with more specific
types that accurately describe the expected structure or behavior of these
parameters. If no existing types fit, define appropriate interfaces or type
aliases for 'operation' and 'transaction' and use them instead of 'any'.

Comment on lines +6 to +7
get: <T>(controller: any): T | Promise<T> => {
return container.resolve<T>(controller)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Type safety degradation: Consider maintaining strict typing.

Similar to the TsyringeAdapter.ts changes, changing the parameter type from Parameters<IocContainer['get']>[0] to any reduces type safety and could lead to runtime errors. This pattern of loosening type safety across IoC container adapters is concerning.

Consider these alternatives:

  1. Fix the root cause of the type compatibility issue instead of using any
  2. Use a more specific type that accurately represents the expected controller types
  3. Maintain consistency with proper typing across all IoC container adapters
-  get: <T>(controller: any): T | Promise<T> => {
+  get: <T>(controller: new (...args: any[]) => T): T | Promise<T> => {

Or maintain the original typing and fix the underlying issue:

-  get: <T>(controller: any): T | Promise<T> => {
+  get: <T>(controller: Parameters<IocContainer['get']>[0]): T | Promise<T> => {
-    return container.resolve<T>(controller)
+    return container.resolve<T>(controller as any)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
get: <T>(controller: any): T | Promise<T> => {
return container.resolve<T>(controller)
get: <T>(controller: new (...args: any[]) => T): T | Promise<T> => {
return container.resolve<T>(controller)
🤖 Prompt for AI Agents
In src/utils/tsyringeTsoaIocContainer.ts around lines 6 to 7, the parameter type
for the get method is currently set to any, which reduces type safety. To fix
this, replace any with the original type Parameters<IocContainer['get']>[0] or a
more specific type that accurately represents the expected controller types.
This will maintain strict typing and consistency with other IoC container
adapters, preventing potential runtime errors.

Comment on lines +6 to +14
export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions {
credentialSupportedId: string
format: string
payload: {
vct?: string
[key: string]: unknown
}
disclosureFrame?: Record<string, boolean | Record<string, boolean>>
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Improve type consistency and add documentation.

This interface duplicates the one in src/utils/oid4vc-agent.ts but with less specific types and missing documentation. Consider:

  1. Using the specific OpenId4VciCredentialFormatProfile type for format
  2. Using the DisclosureFrame type for disclosureFrame
  3. Adding JSDoc comments for clarity

🏁 Script executed:

#!/bin/bash
# Check if OpenId4VciCredentialFormatProfile and DisclosureFrame types are available
rg -A 2 "OpenId4VciCredentialFormatProfile|DisclosureFrame" --type ts

Length of output: 2330


Align SdJwt credential options with existing types and add JSDoc

Use the existing OpenId4VciCredentialFormatProfile and DisclosureFrame types to narrow format and disclosureFrame, and mirror the JSDoc from src/utils/oid4vc-agent.ts.

• File: src/controllers/openid4vc/types/issuer.types.ts
– Import OpenId4VciCredentialFormatProfile from @credo-ts/openid4vc
– Import DisclosureFrame from ../../types
– Change
ts format: string … disclosureFrame?: Record<string, boolean | Record<string, boolean>>
to
```ts
/**
* @example {@link OpenId4VciCredentialFormatProfile.SdJwtVc}
*/
format: OpenId4VciCredentialFormatProfile

/**
 * Specifies which attributes to disclose.
 */
disclosureFrame?: DisclosureFrame
```  

– Add a top-level JSDoc block for the interface and field-level comments for credentialSupportedId, payload, etc., consistent with oid4vc-agent.ts

Suggested diff:

--- a/src/controllers/openid4vc/types/issuer.types.ts
+++ b/src/controllers/openid4vc/types/issuer.types.ts
@@ -1,5 +1,7 @@
+import type { DisclosureFrame } from '../../types'
+import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc'
 
- export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions {
+/**
+ * Options for creating an OpenID4VC issuance session offer with SD-JWT.
+ */
+export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions {
   /**
    * The identifier of the supported credential.
    */
@@ -6,7 +10,12 @@ export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions {
   credentialSupportedId: string
-  format: string
+  /**
+   * The credential format.
+   * @example {@link OpenId4VciCredentialFormatProfile.SdJwtVc}
+   */
+  format: OpenId4VciCredentialFormatProfile
 
   /**
    * Custom payload for the credential.
@@ -13,7 +22,10 @@ export interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions {
     [key: string]: unknown
   }
-  disclosureFrame?: Record<string, boolean | Record<string, boolean>>
+  /**
+   * A disclosure frame specifying which attributes to reveal.
+   */
+  disclosureFrame?: DisclosureFrame
 }
🤖 Prompt for AI Agents
In src/controllers/openid4vc/types/issuer.types.ts lines 6 to 14, update the
interface OpenId4VcIssuanceSessionCreateOfferSdJwtCredentialOptions by importing
OpenId4VciCredentialFormatProfile from @credo-ts/openid4vc and DisclosureFrame
from ../../types. Replace the format field's type from string to
OpenId4VciCredentialFormatProfile with a JSDoc example referencing
OpenId4VciCredentialFormatProfile.SdJwtVc. Change disclosureFrame's type from
Record<string, boolean | Record<string, boolean>> to DisclosureFrame with a
JSDoc comment explaining it specifies which attributes to disclose. Add a
top-level JSDoc comment for the interface and field-level comments for
credentialSupportedId, payload, and other fields consistent with the style in
src/utils/oid4vc-agent.ts.


export enum ResponseModeEnum {
DIRECT_POST = 'direct_post',
DIRECT_POSJWT = 'direct_post.jwt',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix typo in enum value.

There's a typo in the enum value - "POSJWT" should be "POST_JWT".

-  DIRECT_POSJWT = 'direct_post.jwt',
+  DIRECT_POST_JWT = 'direct_post.jwt',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DIRECT_POSJWT = 'direct_post.jwt',
DIRECT_POST_JWT = 'direct_post.jwt',
🤖 Prompt for AI Agents
In src/controllers/openid4vc/types/verifier.types.ts at line 7, correct the typo
in the enum value by changing "DIRECT_POSJWT" to "DIRECT_POST_JWT" to accurately
reflect the intended naming.

Comment on lines +63 to +65
export interface SubmissionRequirementModel extends SubmissionRequirement {
from_nested?: SubmissionRequirementModel[]
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify recursive type definition.

The recursive from_nested property in SubmissionRequirementModel should be carefully validated to prevent infinite recursion in runtime usage.


🏁 Script executed:

#!/bin/bash
# Description: Check for proper handling of recursive SubmissionRequirementModel usage
# Expected: Find validation or depth limiting logic in service files

rg -A 10 -B 5 "SubmissionRequirementModel|from_nested" --type ts

Length of output: 2500


Ensure safe recursion handling for SubmissionRequirementModel.from_nested

I didn’t find any runtime logic that guards against infinite nesting when processing SubmissionRequirementModel (lines 63–65 in src/controllers/openid4vc/types/verifier.types.ts). If you traverse or validate submission_requirements (e.g., in DifPresentationExchangeDefinitionV2Model), please:

  • Introduce a maximum‐depth parameter or iterative guard when walking from_nested.
  • Validate incoming payloads to enforce a sane nesting limit.
  • Update the service or utility that processes SubmissionRequirementModel to abort or error out once the depth limit is exceeded.

Locations to address:

  • src/controllers/openid4vc/types/verifier.types.ts:63–65 (recursive definition)
  • Any service/function that traverses submission_requirements (e.g., your verifier implementation)
🤖 Prompt for AI Agents
In src/controllers/openid4vc/types/verifier.types.ts at lines 63 to 65, the
SubmissionRequirementModel interface allows recursive nesting via from_nested
without any depth limit, which risks infinite recursion. To fix this, add a
maximum depth parameter or guard in any function that traverses from_nested,
such as in the verifier implementation, to prevent exceeding a sane nesting
limit. Also, validate incoming submission_requirements payloads to enforce this
maximum depth and update traversal logic to abort or throw an error if the depth
limit is surpassed.

Comment on lines +177 to +180
export class OpenId4VcUpdateVerifierRecordOptions {
verifierId!: string
clientMetadata?: OpenId4VcSiopVerifierClientMetadata
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider removing definite assignment assertion.

The ! assertion on verifierId bypasses TypeScript's type checking. Consider making it required in the interface definition instead.

-export class OpenId4VcUpdateVerifierRecordOptions {
-  verifierId!: string
-  clientMetadata?: OpenId4VcSiopVerifierClientMetadata
-}
+export interface OpenId4VcUpdateVerifierRecordOptions {
+  verifierId: string
+  clientMetadata?: OpenId4VcSiopVerifierClientMetadata
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export class OpenId4VcUpdateVerifierRecordOptions {
verifierId!: string
clientMetadata?: OpenId4VcSiopVerifierClientMetadata
}
export interface OpenId4VcUpdateVerifierRecordOptions {
verifierId: string
clientMetadata?: OpenId4VcSiopVerifierClientMetadata
}
🤖 Prompt for AI Agents
In src/controllers/openid4vc/types/verifier.types.ts around lines 177 to 180,
the definite assignment assertion (!) on the verifierId property bypasses
TypeScript's type checking. To fix this, remove the exclamation mark and make
verifierId a required property by defining it without the assertion, ensuring it
is properly initialized or passed when creating instances of
OpenId4VcUpdateVerifierRecordOptions.

Comment on lines +134 to +137
export interface Issuance {
[key: string]: any
manifest?: string
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace any type with more specific typing.

The pipeline failure correctly identifies the use of any type. This reduces type safety and should be replaced with a more specific type.

 export interface Issuance {
-  [key: string]: any
+  [key: string]: unknown
   manifest?: string
 }

Or better yet, define the specific properties:

 export interface Issuance {
-  [key: string]: any
   manifest?: string
+  [key: string]: string | number | boolean | object | null
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export interface Issuance {
[key: string]: any
manifest?: string
}
export interface Issuance {
[key: string]: unknown
manifest?: string
}
🧰 Tools
🪛 GitHub Actions: Continuous Integration

[warning] 135-135: ESLint: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)

🤖 Prompt for AI Agents
In src/controllers/openid4vc/types/verifier.types.ts at lines 134 to 137, the
use of the `any` type in the Issuance interface reduces type safety and causes
pipeline failures. Replace the `[key: string]: any` index signature with a more
specific type that accurately reflects the expected properties and their types,
or explicitly define the known properties of the Issuance interface to improve
type safety and clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants