Skip to content

Commit

Permalink
feat: upgrade oidf client package
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmelati committed Nov 13, 2024
1 parent c1fc0a7 commit 3cfbcdf
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 199 deletions.
20 changes: 0 additions & 20 deletions packages/oidf-client/__tests__/shared/CryptoDefaultCallback.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ export const mockResponses = [
"https://spid.wbss.it/Spid/oidc/sa/fetch?sub=https://spid.wbss.it/Spid/oidc/rp/ipasv_lt",
"eyJraWQiOiJNWGFvTUtvcWIyME1QME1WYkRUZGxIYmlFME9JakNyYmhHTnkxWVlzeXJNIiwidHlwIjoiZW50aXR5LXN0YXRlbWVudCtqd3QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJodHRwczovL3NwaWQud2Jzcy5pdC9TcGlkL29pZGMvcnAvaXBhc3ZfbHQiLCJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IlJTQSIsImUiOiJBUUFCIiwiYWxnIjoiUlMyNTYiLCJ1c2UiOiJzaWciLCJuIjoid3ZISHBtckZraTI3R1ZkYXYtNW41S0hZT08tZ21sT3MxOWxBUG1xeDZGU2VSUTVSeWsxbVUxTFVPNFF4UmJYVUlUNEhFczRUc2EzRG94SlRCSEE5clR1VXJTZUpieFEwcGVBbUI4akZFbmowYjJOdzVwSDBaRFVmMVdoUWw1dlJQblRUcmpWUXotUlE1VzNtMHRjVTh4OEd6MXlNczF6RHZ2YTNmZzVjajQyV1lnMEtYN2d1ODNrQ2puQmpEX2NlT2YzWHJhN1Q2V193LXNJY1h4TGJFWXYzVDFSdFp2cE9IZHp1WTJjMEx1NTlPNFE5d01udk5VT0hjTVJFT3ROM3RpcEc0dU1jOHAxajVUQ0lXMUVTeXNxWUYycF9kYmJlSVFwVXhrRzJZMHNPWnJWWWtTTHAwdjB4RnJKd1N3NVl2Z0VhZ2ZIaERXTXNmcGpPNHFuUXBRIiwia2l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2DDSbO87LGkiNkDIJ4ANo-fwBRLkXkdKVtf2QfKKzX7fsTihETekIBP9XA1RfFRDMYUKyHI5b-4cQIQxWHTnnjdm-9byT8FK8Pw8eC3QNc38KbJvR1CcdCVFVBQ1GFumTe1DOhkARbFg3rT_w8RjH_PhuRmUDUQyTBQwDHdFydb_TZpgzvSmHUjjvB2qJT109DGV4s-aFwj5bUn9YRazWlNDo78PFS0lJk16bLGEP5YRrXL_lGSxSEUta-BQEoJ2CR9QsBCW8L1HJoRywx61nWSC1wsCAxJlR4eg"
Expand Down
66 changes: 25 additions & 41 deletions packages/oidf-client/__tests__/shared/oidfClientAgentLogic.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,31 @@
import 'cross-fetch/polyfill'
import { ResourceResolver } from "@sphereon/ssi-sdk.resource-resolver";
import { createAgent, TAgent } from '@veramo/core'
import {
ICryptoService
} from "@sphereon/openid-federation-client";
import { IOIDFClient, OIDFClient } from '../../src'

import { mockResponses } from './TrustChainMockResponses'
import { IJwtService, JwtService } from '@sphereon/ssi-sdk-ext.jwt-service'
import nock = require('nock')
import { defaultCryptoJSImpl } from './CryptoDefaultCallback'

type ConfiguredAgent = TAgent<IOIDFClient & IJwtService>

function nockSetup() {
const url = new URL(mockResponses[0][0])
const url5 = new URL(mockResponses[5][0])
nock(url.origin) //https://oidc.registry.servizicie.interno.gov.it
.persist()
.get(url.pathname) //.well-known/openid-federation
.reply(200, mockResponses[0][1], { 'Content-Type': 'application/entity-statement+jwt' })
.get(url5.pathname)
.query({
sub: 'https://spid.wbss.it/Spid/oidc/sa',
iss: 'https://oidc.registry.servizicie.interno.gov.it',
})
.reply(200, mockResponses[5][1], { 'Content-Type': 'application/entity-statement+jwt' })
const fetchService = {
async fetchStatement(endpoint: string) {
const match = mockResponses.find(item => item[0] === endpoint);
if (match) {
return match[1];
} else {
throw new Error("Not found: " + endpoint);
}
}
};

const url1 = new URL(mockResponses[1][0])
const url2 = new URL(mockResponses[2][0])
const url3 = new URL(mockResponses[3][0])
const url4 = new URL(mockResponses[4][0])
nock(url1.origin) //https://spid.wbss.it
.persist()
.get(url1.pathname) //Spid/oidc/sa/.well-known/openid-federation
.reply(200, mockResponses[1][1], { 'Content-Type': 'application/entity-statement+jwt' })
.get(url2.pathname) //Spid/oidc/rp/ipasv_lt/.well-known/openid-federation
.reply(200, mockResponses[2][1], { 'Content-Type': 'application/entity-statement+jwt' })
.get(url3.pathname)
.query({
sub: 'https://spid.wbss.it/Spid/oidc/rp/ipasv_lt',
iss: 'https://spid.wbss.it/Spid/oidc/sa',
}) //Spid/oidc/sa/fetch?sub=https://spid.wbss.it/Spid/oidc/rp/ipasv_lt&iss=https://spid.wbss.it/Spid/oidc/sa
.reply(200, mockResponses[3][1], { 'Content-Type': 'application/entity-statement+jwt' })
.get(url4.pathname) //Spid/oidc/sa/fetch
.query({}) // Match empty query string for url4
.reply(200, mockResponses[4][1], { 'Content-Type': 'application/entity-statement+jwt' })
const cryptoService: ICryptoService = {
verify: async (jwt: string, key: any): Promise<boolean> => {
return true
}
}

export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Promise<boolean>; tearDown: () => Promise<boolean> }): void => {
Expand All @@ -49,28 +34,28 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro

beforeAll(async (): Promise<void> => {
await testContext.setup()
//agent = testContext.getAgent()
// FIXME Remove createAgent and uncomment the line above when the issue with the jwt-service is fixed

agent = createAgent({
plugins: [
new JwtService(),
new OIDFClient({
cryptoServiceCallback: defaultCryptoJSImpl,
fetchServiceCallback: fetchService,
cryptoServiceCallback: cryptoService
}),
new ResourceResolver(),
],
})
})

afterAll(testContext.tearDown)

it('should build a trust chain 1', async () => {
nockSetup()
const trustChain = await agent.resolveTrustChain({
entityIdentifier: 'https://spid.wbss.it/Spid/oidc/rp/ipasv_lt',
trustAnchors: ['https://oidc.registry.servizicie.interno.gov.it'],
})

expect(trustChain).not.toBeNull()
expect(trustChain).toBeTruthy()
expect(trustChain).toHaveLength(4)

expect(trustChain).toEqual(
Expand All @@ -84,13 +69,12 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
})

it('should build trust chain 2', async () => {
nockSetup()
const trustChain = await agent.resolveTrustChain({
entityIdentifier: 'https://spid.wbss.it/Spid/oidc/sa',
trustAnchors: ['https://oidc.registry.servizicie.interno.gov.it'],
})

expect(trustChain).not.toBeNull()
expect(trustChain).toBeTruthy()
expect(trustChain).toHaveLength(3)

expect(trustChain).toEqual(
Expand Down
13 changes: 6 additions & 7 deletions packages/oidf-client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@sphereon/ssi-sdk.oidf-client",
"type": "module",
"version": "0.30.1",
"source": "src/index.ts",
"main": "dist/index.js",
Expand All @@ -16,18 +17,16 @@
},
"dependencies": {
"@sphereon/ssi-types": "workspace:*",
"@sphereon/openid-federation-open-api": "0.1.0-unstable.8663d94",
"@sphereon/openid-federation-client": "0.1.0-unstable.8663d94",
"@sphereon/openid-federation-common": "0.1.0-unstable.8663d94",
"@sphereon/openid-federation-open-api": "0.1.0-unstable.b945ca8",
"@sphereon/openid-federation-client": "0.1.0-unstable.b945ca8",
"@sphereon/openid-federation-common": "0.1.0-unstable.b945ca8",
"@sphereon/ssi-sdk-ext.jwt-service": "0.25.0"
},
"devDependencies": {
"@sphereon/ssi-sdk.resource-resolver": "workspace:*",
"@sphereon/ssi-sdk.agent-config": "workspace:*",
"@veramo/remote-client": "4.2.0",
"@veramo/remote-server": "4.2.0",
"jose": "5.9.4",
"nock": "^13.5.5",
"cross-fetch": "^3.1.8"
"@veramo/remote-server": "4.2.0"
},
"files": [
"dist/**/*",
Expand Down
Loading

0 comments on commit 3cfbcdf

Please sign in to comment.