@sphereon/ssi-sdk.oidf-client 0.30.2-fix.368 → 0.30.2-fix.395
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/OIDFClient.d.ts.map +1 -1
- package/dist/agent/OIDFClient.js +3 -3
- package/dist/agent/OIDFClient.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/IOIDFClient.d.ts +1 -1
- package/dist/types/IOIDFClient.d.ts.map +1 -1
- package/package.json +49 -49
- package/src/agent/OIDFClient.ts +13 -18
- package/src/index.ts +1 -1
- package/src/types/IOIDFClient.ts +9 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OIDFClient.d.ts","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"OIDFClient.d.ts","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAAE,WAAW,EAAE,cAAc,EAA2C,MAAM,sBAAsB,CAAA;AAE3G,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAyB,CAAA;AAErE,qBAAa,UAAW,YAAW,YAAY;IAC7C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAe;IACrD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAgB;IACvD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAE5B;IACD,QAAQ,CAAC,MAAM,MAAqB;gBAExB,IAAI,CAAC,EAAE,cAAc;IAOjC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,aAAa;YAOP,iBAAiB;CAOhC"}
|
package/dist/agent/OIDFClient.js
CHANGED
|
@@ -29,7 +29,7 @@ class OIDFClient {
|
|
|
29
29
|
verify: (jwt, key) => __awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
const verification = yield context.agent.jwtVerifyJwsSignature({ jws: jwt, jwk: key });
|
|
31
31
|
return !verification.error;
|
|
32
|
-
})
|
|
32
|
+
}),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
defaultFetchJSImpl(context) {
|
|
@@ -37,7 +37,7 @@ class OIDFClient {
|
|
|
37
37
|
fetchStatement(endpoint) {
|
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
39
|
const requestInfo = new cross_fetch_1.Request(endpoint, {
|
|
40
|
-
method: 'GET'
|
|
40
|
+
method: 'GET',
|
|
41
41
|
});
|
|
42
42
|
const response = yield context.agent.resourceResolve({
|
|
43
43
|
input: requestInfo,
|
|
@@ -48,7 +48,7 @@ class OIDFClient {
|
|
|
48
48
|
}
|
|
49
49
|
return yield response.text();
|
|
50
50
|
});
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
getOIDFClient(context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OIDFClient.js","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"OIDFClient.js","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iFAA+H;AAG/H,6CAAqC;AACrC,2BAA4B;AAGf,QAAA,iBAAiB,GAAkB,CAAC,mBAAmB,CAAC,CAAA;AAErE,MAAa,UAAU;IAQrB,YAAY,IAAqB;QALxB,YAAO,GAAgB;YAC9B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;SACrD,CAAA;QACQ,WAAM,GAAG,UAAM,CAAC,WAAW,CAAA;QAGlC,MAAM,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAQ,IAAI,CAAE,CAAA;QAEnE,IAAI,CAAC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,YAAY,EAAE,GAAG,IAAI,CAAA;YAE/C,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;YAE9C,OAAO,MAAM,UAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,YAAY,EAAE,EAAE,CAAC,CAAA;QAC/E,CAAC;KAAA;CACF;AA3DD,gCA2DC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAA6C;AAE7C;;GAEG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM;AAEF,QAAA,MAAM,GAAG,mBAAO,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;AAEjE,iDAAkE;AAAzD,wGAAA,UAAU,OAAA;AAAE,+GAAA,iBAAiB,OAAA;AAEtC,sDAAmC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResourceResolver } from
|
|
1
|
+
import { IResourceResolver } from '@sphereon/ssi-sdk.resource-resolver';
|
|
2
2
|
import { IAgentContext, IPluginMethodMap } from '@veramo/core';
|
|
3
3
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
4
4
|
import { ICryptoService, IFetchService, TrustChainResolveResponse } from '@sphereon/openid-federation-client';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOIDFClient.d.ts","sourceRoot":"","sources":["../../src/types/IOIDFClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IOIDFClient.d.ts","sourceRoot":"","sources":["../../src/types/IOIDFClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAA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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
"name": "@sphereon/ssi-sdk.oidf-client",
|
|
3
|
+
"version": "0.30.2-fix.395+c1e7ae67",
|
|
4
|
+
"source": "src/index.ts",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"veramo": {
|
|
8
|
+
"pluginInterfaces": {
|
|
9
|
+
"IOIDFClient": "./src/types/IOIDFClient.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"build:clean": "tsc --build --clean && tsc --build",
|
|
15
|
+
"generate-plugin-schema": "ts-node ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@sphereon/openid-federation-client": "0.1.1-unstable.0647eb6",
|
|
19
|
+
"@sphereon/openid-federation-common": "0.1.1-unstable.0647eb6",
|
|
20
|
+
"@sphereon/openid-federation-open-api": "0.1.1-unstable.0647eb6",
|
|
21
|
+
"@sphereon/ssi-sdk-ext.jwt-service": "0.26.0",
|
|
22
|
+
"@sphereon/ssi-sdk.resource-resolver": "0.30.2-fix.395+c1e7ae67",
|
|
23
|
+
"@sphereon/ssi-types": "0.30.2-fix.395+c1e7ae67"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@sphereon/ssi-sdk.agent-config": "0.30.2-fix.395+c1e7ae67",
|
|
27
|
+
"@veramo/remote-client": "4.2.0",
|
|
28
|
+
"@veramo/remote-server": "4.2.0"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/**/*",
|
|
32
|
+
"src/**/*",
|
|
33
|
+
"README.md",
|
|
34
|
+
"plugin.schema.json",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"private": false,
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"repository": "git@github.com:Sphereon-Opensource/SSI-SDK.git",
|
|
42
|
+
"author": "Sphereon <dev@sphereon.com>",
|
|
43
|
+
"license": "Apache-2.0",
|
|
44
|
+
"keywords": [
|
|
45
|
+
"Sphereon",
|
|
46
|
+
"SSI",
|
|
47
|
+
"Veramo",
|
|
48
|
+
"OpenID Federation"
|
|
49
|
+
],
|
|
50
|
+
"gitHead": "c1e7ae67eeb24c55535e023028bda50f3d5213a0"
|
|
51
51
|
}
|
package/src/agent/OIDFClient.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {FederationClient, ICryptoService, IFetchService, TrustChainResolveResponse} from '@sphereon/openid-federation-client'
|
|
2
|
-
import {JWK} from
|
|
3
|
-
import {IAgentPlugin} from '@veramo/core'
|
|
4
|
-
import {Request} from
|
|
5
|
-
import {schema} from '../'
|
|
6
|
-
import {
|
|
7
|
-
IOIDFClient,
|
|
8
|
-
OIDFClientArgs,
|
|
9
|
-
IRequiredContext,
|
|
10
|
-
ResolveTrustChainArgs
|
|
11
|
-
} from '../types/IOIDFClient'
|
|
1
|
+
import { FederationClient, ICryptoService, IFetchService, TrustChainResolveResponse } from '@sphereon/openid-federation-client'
|
|
2
|
+
import { JWK } from '@sphereon/ssi-types'
|
|
3
|
+
import { IAgentPlugin } from '@veramo/core'
|
|
4
|
+
import { Request } from 'cross-fetch'
|
|
5
|
+
import { schema } from '../'
|
|
6
|
+
import { IOIDFClient, OIDFClientArgs, IRequiredContext, ResolveTrustChainArgs } from '../types/IOIDFClient'
|
|
12
7
|
|
|
13
8
|
export const oidfClientMethods: Array<string> = ['resolveTrustChain']
|
|
14
9
|
|
|
@@ -21,7 +16,7 @@ export class OIDFClient implements IAgentPlugin {
|
|
|
21
16
|
readonly schema = schema.IOIDFClient
|
|
22
17
|
|
|
23
18
|
constructor(args?: OIDFClientArgs) {
|
|
24
|
-
const {fetchServiceCallback, cryptoServiceCallback} = {...args}
|
|
19
|
+
const { fetchServiceCallback, cryptoServiceCallback } = { ...args }
|
|
25
20
|
|
|
26
21
|
this.fetchServiceCallback = fetchServiceCallback
|
|
27
22
|
this.cryptoServiceCallback = cryptoServiceCallback
|
|
@@ -30,9 +25,9 @@ export class OIDFClient implements IAgentPlugin {
|
|
|
30
25
|
private defaultCryptoJSImpl(context: IRequiredContext): ICryptoService {
|
|
31
26
|
return {
|
|
32
27
|
verify: async (jwt: string, key: JWK): Promise<boolean> => {
|
|
33
|
-
const verification = await context.agent.jwtVerifyJwsSignature({jws: jwt, jwk: key})
|
|
28
|
+
const verification = await context.agent.jwtVerifyJwsSignature({ jws: jwt, jwk: key })
|
|
34
29
|
return !verification.error
|
|
35
|
-
}
|
|
30
|
+
},
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
|
|
@@ -40,7 +35,7 @@ export class OIDFClient implements IAgentPlugin {
|
|
|
40
35
|
return {
|
|
41
36
|
async fetchStatement(endpoint: string): Promise<string> {
|
|
42
37
|
const requestInfo = new Request(endpoint, {
|
|
43
|
-
method: 'GET'
|
|
38
|
+
method: 'GET',
|
|
44
39
|
})
|
|
45
40
|
|
|
46
41
|
const response = await context.agent.resourceResolve({
|
|
@@ -49,18 +44,18 @@ export class OIDFClient implements IAgentPlugin {
|
|
|
49
44
|
})
|
|
50
45
|
|
|
51
46
|
if (response.status != 200) {
|
|
52
|
-
|
|
47
|
+
throw new Error(`Failed to fetch statement from ${endpoint}`)
|
|
53
48
|
}
|
|
54
49
|
|
|
55
50
|
return await response.text()
|
|
56
|
-
}
|
|
51
|
+
},
|
|
57
52
|
}
|
|
58
53
|
}
|
|
59
54
|
|
|
60
55
|
private getOIDFClient(context: IRequiredContext): FederationClient {
|
|
61
56
|
return new FederationClient(
|
|
62
57
|
this.fetchServiceCallback || this.defaultFetchJSImpl(context),
|
|
63
|
-
this.cryptoServiceCallback || this.defaultCryptoJSImpl(context)
|
|
58
|
+
this.cryptoServiceCallback || this.defaultCryptoJSImpl(context),
|
|
64
59
|
)
|
|
65
60
|
}
|
|
66
61
|
|
package/src/index.ts
CHANGED
package/src/types/IOIDFClient.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {IResourceResolver} from
|
|
2
|
-
import {IAgentContext, IPluginMethodMap} from '@veramo/core'
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
} from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
6
|
-
import {ICryptoService, IFetchService, TrustChainResolveResponse} from '@sphereon/openid-federation-client'
|
|
1
|
+
import { IResourceResolver } from '@sphereon/ssi-sdk.resource-resolver'
|
|
2
|
+
import { IAgentContext, IPluginMethodMap } from '@veramo/core'
|
|
3
|
+
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service'
|
|
4
|
+
import { ICryptoService, IFetchService, TrustChainResolveResponse } from '@sphereon/openid-federation-client'
|
|
7
5
|
|
|
8
6
|
export type IRequiredPlugins = IJwtService & IResourceResolver
|
|
9
7
|
export type IRequiredContext = IAgentContext<IRequiredPlugins>
|
|
10
8
|
|
|
11
9
|
export interface IOIDFClient extends IPluginMethodMap {
|
|
12
|
-
|
|
10
|
+
resolveTrustChain(args: ResolveTrustChainArgs, context: IRequiredContext): Promise<TrustChainResolveResponse>
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
export type ResolveTrustChainArgs = {
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
entityIdentifier: string
|
|
15
|
+
trustAnchors: Array<string>
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
export type OIDFClientArgs = {
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
fetchServiceCallback?: IFetchService
|
|
20
|
+
cryptoServiceCallback?: ICryptoService
|
|
23
21
|
}
|