@sphereon/ssi-sdk-ext.identifier-resolution 0.25.0 → 0.25.1-feature.OIDF.69.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/IdentifierResolution.d.ts +1 -0
- package/dist/agent/IdentifierResolution.d.ts.map +1 -1
- package/dist/agent/IdentifierResolution.js +6 -0
- package/dist/agent/IdentifierResolution.js.map +1 -1
- package/dist/functions/LegacySupport.js +4 -4
- package/dist/functions/LegacySupport.js.map +1 -1
- package/dist/functions/externalIdentifierFunctions.d.ts.map +1 -1
- package/dist/functions/externalIdentifierFunctions.js +4 -0
- package/dist/functions/externalIdentifierFunctions.js.map +1 -1
- package/dist/functions/externalOIDFIdentifier.d.ts +19 -0
- package/dist/functions/externalOIDFIdentifier.d.ts.map +1 -0
- package/dist/functions/externalOIDFIdentifier.js +79 -0
- package/dist/functions/externalOIDFIdentifier.js.map +1 -0
- package/dist/functions/index.d.ts +1 -0
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +1 -0
- package/dist/functions/index.js.map +1 -1
- package/dist/types/IIdentifierResolution.d.ts +3 -2
- package/dist/types/IIdentifierResolution.d.ts.map +1 -1
- package/dist/types/IIdentifierResolution.js +1 -0
- package/dist/types/IIdentifierResolution.js.map +1 -1
- package/dist/types/common.d.ts +1 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +4 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/externalIdentifierTypes.d.ts +18 -3
- package/dist/types/externalIdentifierTypes.d.ts.map +1 -1
- package/dist/types/externalIdentifierTypes.js +5 -0
- package/dist/types/externalIdentifierTypes.js.map +1 -1
- package/package.json +13 -12
- package/plugin.schema.json +130 -1
- package/src/agent/IdentifierResolution.ts +9 -1
- package/src/functions/LegacySupport.ts +1 -1
- package/src/functions/externalIdentifierFunctions.ts +6 -1
- package/src/functions/externalOIDFIdentifier.ts +93 -0
- package/src/functions/index.ts +1 -0
- package/src/types/IIdentifierResolution.ts +7 -2
- package/src/types/IJwtService.d.ts +225 -0
- package/src/types/common.ts +4 -0
- package/src/types/externalIdentifierTypes.ts +26 -3
|
@@ -5,7 +5,7 @@ import { IParsedDID } from '@sphereon/ssi-types'
|
|
|
5
5
|
import { DIDDocument, DIDDocumentSection, DIDResolutionResult } from '@veramo/core'
|
|
6
6
|
import {
|
|
7
7
|
isCoseKeyIdentifier,
|
|
8
|
-
isDidIdentifier,
|
|
8
|
+
isDidIdentifier, isOIDFEntityIdIdentifier,
|
|
9
9
|
isJwkIdentifier,
|
|
10
10
|
isJwksUrlIdentifier,
|
|
11
11
|
isKidIdentifier,
|
|
@@ -47,6 +47,7 @@ export type ExternalIdentifierOpts = (
|
|
|
47
47
|
| ExternalIdentifierDidOpts
|
|
48
48
|
| ExternalIdentifierKidOpts
|
|
49
49
|
| ExternalIdentifierCoseKeyOpts
|
|
50
|
+
| ExternalIdentifierOIDFEntityIdOpts
|
|
50
51
|
) &
|
|
51
52
|
ExternalIdentifierOptsBase
|
|
52
53
|
|
|
@@ -101,6 +102,17 @@ export function isExternalIdentifierJwksUrlOpts(opts: ExternalIdentifierOptsBase
|
|
|
101
102
|
return ('method' in opts && opts.method === 'oidc-discovery') || isJwksUrlIdentifier(identifier)
|
|
102
103
|
}
|
|
103
104
|
|
|
105
|
+
export type ExternalIdentifierOIDFEntityIdOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
106
|
+
method?: 'entity_id'
|
|
107
|
+
identifier: string
|
|
108
|
+
trustAnchors?: Array<string>
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function isExternalIdentifierOIDFEntityIdOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierOIDFEntityIdOpts {
|
|
112
|
+
const { identifier } = opts
|
|
113
|
+
return ('method' in opts && opts.method === 'entity_id' || 'trustAnchors' in opts) && isOIDFEntityIdIdentifier(identifier)
|
|
114
|
+
}
|
|
115
|
+
|
|
104
116
|
export type ExternalIdentifierX5cOpts = Omit<ExternalIdentifierOptsBase, 'method'> &
|
|
105
117
|
X509CertificateChainValidationOpts & {
|
|
106
118
|
method?: 'x5c'
|
|
@@ -115,10 +127,10 @@ export function isExternalIdentifierX5cOpts(opts: ExternalIdentifierOptsBase): o
|
|
|
115
127
|
return ('method' in opts && opts.method === 'x5c') || isX5cIdentifier(identifier)
|
|
116
128
|
}
|
|
117
129
|
|
|
118
|
-
export type ExternalIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'cose_key' | 'oidc-discovery' | 'jwks-url' | 'oid4vci-issuer'
|
|
130
|
+
export type ExternalIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'cose_key' | 'oidc-discovery' | 'jwks-url' | 'oid4vci-issuer' | 'entity_id'
|
|
119
131
|
|
|
120
132
|
export type ExternalIdentifierResult = IExternalIdentifierResultBase &
|
|
121
|
-
(ExternalIdentifierDidResult | ExternalIdentifierX5cResult | ExternalIdentifierJwkResult | ExternalIdentifierCoseKeyResult)
|
|
133
|
+
(ExternalIdentifierDidResult | ExternalIdentifierX5cResult | ExternalIdentifierJwkResult | ExternalIdentifierOIDFEntityIdResult | ExternalIdentifierCoseKeyResult )
|
|
122
134
|
|
|
123
135
|
export interface IExternalIdentifierResultBase {
|
|
124
136
|
method: ExternalIdentifierMethod
|
|
@@ -145,6 +157,17 @@ export interface ExternalIdentifierX5cResult extends IExternalIdentifierResultBa
|
|
|
145
157
|
certificates: any[] // for now since our schema generator trips on pkijs Certificate(Json) object //fixme
|
|
146
158
|
}
|
|
147
159
|
|
|
160
|
+
export type TrustedAnchor = string
|
|
161
|
+
export type PublicKeyHex = string
|
|
162
|
+
export type ErrorMessage = string
|
|
163
|
+
|
|
164
|
+
export interface ExternalIdentifierOIDFEntityIdResult extends IExternalIdentifierResultBase {
|
|
165
|
+
method: 'entity_id'
|
|
166
|
+
trustedAnchors: Array<TrustedAnchor>
|
|
167
|
+
errorList?: Record<TrustedAnchor, ErrorMessage>
|
|
168
|
+
trustEstablished: boolean
|
|
169
|
+
}
|
|
170
|
+
|
|
148
171
|
export interface ExternalJwkInfo extends JwkInfo {
|
|
149
172
|
kid?: string
|
|
150
173
|
publicKeyHex: string
|