Skip to content

Commit 3a81cf0

Browse files
committed
fix: Add default registry
Signed-off-by: DaevMithran <daevmithran1999@gmail.com>
1 parent 8d12eb0 commit 3a81cf0

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

packages/core/src/modules/sd-jwt-vc/SdJwtVcModuleConfig.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { TokenStatusListRegistry } from './credential-status/token-status-list/TokenStatusListRegistry'
1+
import { TokenStatusListRegistry } from './credential-status'
2+
import { HttpTokenStatusListRegistry } from './credential-status/token-status-list/http/HttpTokenStatusListRegistry'
23

34
/**
45
* SdJwtVcModuleConfigOptions defines the interface for the options of the SdJwtVcModuleConfig class.
@@ -30,7 +31,7 @@ export class SdJwtVcModuleConfig {
3031
// This prevents creating new instances every time this property is accessed
3132
if (this._registries) return this._registries
3233

33-
this._registries = this.options.registries ?? []
34+
this._registries = [...(this.options.registries || []), new HttpTokenStatusListRegistry()]
3435

3536
return this._registries
3637
}

packages/core/src/modules/sd-jwt-vc/credential-status/token-status-list/TokenStatusList.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { StatusList, getListFromStatusListJWT } from '@sd-jwt/jwt-status-list'
2-
import { isDid } from 'packages/core/src/utils'
32
import { injectable } from 'tsyringe'
43
import { AgentContext } from '../../../../agent'
54
import { JwsService, Jwt, JwtPayload } from '../../../../crypto'
65
import { CredoError } from '../../../../error'
6+
import { isDid } from '../../../../utils'
77
import { DidsApi, getPublicJwkFromVerificationMethod, parseDid } from '../../../dids'
88
import { SdJwtVcModuleConfig } from '../../SdJwtVcModuleConfig'
99
import { SdJwtVcIssuer } from '../../SdJwtVcOptions'
@@ -204,7 +204,7 @@ export class TokenStatusListService {
204204
if (issuer.method === 'did') {
205205
method = parseDid(issuer.didUrl).method
206206
} else {
207-
method = 'http' // TODO: implement x5c handler
207+
method = 'http'
208208
}
209209

210210
return this.sdJwtVcModuleConfig.registries.find((r) => r.supportedMethods.includes(method)) ?? null

0 commit comments

Comments
 (0)