Skip to content

Commit

Permalink
fix: remove patches
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Oct 8, 2024
1 parent 9a83952 commit 3c2e24c
Show file tree
Hide file tree
Showing 16 changed files with 2,123 additions and 3,057 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules
.DS_Store
dist
.env
.env.local
.env.local
.next
out
8 changes: 4 additions & 4 deletions agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ WORKDIR /app

FROM base AS prod-deps
COPY tsconfig.json /app/tsconfig.json
COPY patches /app/patches
COPY sphereon-did-auth-siop-0.16.0.tgz /app/sphereon-did-auth-siop-0.16.0.tgz
# COPY patches /app/patches
# COPY sphereon-did-auth-siop-0.16.0.tgz /app/sphereon-did-auth-siop-0.16.0.tgz

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod

FROM base AS build
COPY tsconfig.json /app/tsconfig.json
COPY patches /app/patches
COPY sphereon-did-auth-siop-0.16.0.tgz /app/sphereon-did-auth-siop-0.16.0.tgz
# COPY patches /app/patches
# COPY sphereon-did-auth-siop-0.16.0.tgz /app/sphereon-did-auth-siop-0.16.0.tgz

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install
COPY src src
Expand Down
26 changes: 15 additions & 11 deletions agent/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "agent",
"dependencies": {
"@credo-ts/askar": "0.5.11-pr-1996-20240827124430",
"@credo-ts/cheqd": "0.5.11-pr-1996-20240827124430",
"@credo-ts/core": "0.5.11-pr-1996-20240827124430",
"@credo-ts/indy-vdr": "0.5.11-pr-1996-20240827124430",
"@credo-ts/node": "0.5.11-pr-1996-20240827124430",
"@credo-ts/openid4vc": "0.5.11-pr-1996-20240827124430",
"@credo-ts/askar": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/askar?funke",
"@credo-ts/core": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/core?funke",
"@credo-ts/openid4vc": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/openid4vc?funke",
"@credo-ts/node": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/node?funke",
"@hyperledger/aries-askar-nodejs": "^0.2.3",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
Expand All @@ -27,11 +25,17 @@
},
"pnpm": {
"overrides": {
"@sphereon/did-auth-siop": "file:./sphereon-did-auth-siop-0.16.0.tgz"
},
"patchedDependencies": {
"@credo-ts/[email protected]": "patches/@[email protected]",
"@credo-ts/[email protected]": "patches/@[email protected]"
"@credo-ts/askar": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/askar?funke",
"@credo-ts/core": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/core?funke",
"@credo-ts/openid4vc": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/openid4vc?funke",
"@credo-ts/node": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/node?funke",
"@sphereon/did-auth-siop": "https://gitpkg.vercel.app/animo/OID4VC/packages/siop-oid4vp?funke",
"@sphereon/oid4vc-common": "https://gitpkg.vercel.app/animo/OID4VC/packages/common?funke",
"@sphereon/oid4vci-common": "https://gitpkg.vercel.app/animo/OID4VC/packages/oid4vci-common?funke",
"@sphereon/oid4vci-issuer": "https://gitpkg.vercel.app/animo/OID4VC/packages/issuer?funke",
"@sphereon/oid4vci-client": "https://gitpkg.vercel.app/animo/OID4VC/packages/client?funke",
"@sphereon/jarm": "https://gitpkg.vercel.app/animo/OID4VC/packages/jarm?funke",
"@sphereon/ssi-types": "0.29.1-unstable.208"
}
}
}
67 changes: 0 additions & 67 deletions agent/patches/@[email protected]

This file was deleted.

81 changes: 0 additions & 81 deletions agent/patches/@[email protected]

This file was deleted.

Binary file removed agent/sphereon-did-auth-siop-0.16.0.tgz
Binary file not shown.
5 changes: 2 additions & 3 deletions agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ariesAskar } from '@hyperledger/aries-askar-nodejs'
import { Router } from 'express'
import { AGENT_HOST, AGENT_WALLET_KEY } from './constants'
import { credentialRequestToCredentialMapper } from './issuer'
import { verifyHs256Callback } from './verifyHs256Callback'
import { getVerifyHs256Callback } from './verifyHs256Callback'

process.on('unhandledRejection', (reason) => {
console.error('Unhandled rejection', reason)
Expand Down Expand Up @@ -50,8 +50,7 @@ export const agent = new Agent({
router: openId4VpRouter,
endpoints: {
authorization: {
// @ts-ignore
verifyHs256Callback,
getVerifyHs256Callback,
},
},
}),
Expand Down
35 changes: 20 additions & 15 deletions agent/src/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
DifPresentationExchangeService,
JsonTransformer,
KeyType,
Mdoc,
MdocVerifiablePresentation,
// Mdoc,
// MdocVerifiablePresentation,
RecordNotFoundError,
TypedArrayEncoder,
W3cJsonLdVerifiablePresentation,
Expand Down Expand Up @@ -105,16 +105,20 @@ apiRouter.post('/offers/receive', async (request: Request, response: Response) =
})

for (const credential of credentials) {
// authenticated channel issuance, not relevant here
if (typeof credential === 'string') continue

if ('compact' in credential.credential) {
await agent.sdJwtVc.store(credential.credential.compact as string)
}
}

return response.json({
credentials: credentials.map((credential) => {
if (credential instanceof Mdoc) {
return credential.credential
}
// if (credential instanceof Mdoc) {
// return credential.credential
// }
if (typeof credential === 'string') return credential
if ('payload' in credential.credential) {
return credential.credential.payload
}
Expand Down Expand Up @@ -152,10 +156,11 @@ apiRouter.post('/requests/create', async (request: Request, response: Response)
issuer: `${AGENT_HOST}/siop/${verifier.verifierId}/authorize`,
},
presentationExchange: {
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
definition: definition as any,
},
// @ts-ignore
additionalPayloadClaims,
responseMode: 'direct_post.jwt',
})

console.log(authorizationRequest)
Expand Down Expand Up @@ -197,16 +202,16 @@ apiRouter.get('/requests/:verificationSessionId', async (request, response) => {
}
}

if (presentation instanceof MdocVerifiablePresentation) {
const deviceSigned = JSON.parse(presentation.deviceSignedBase64Url).deviceSigned
const disclosedClaims = await Mdoc.getDisclosedClaims(deviceSigned)
console.log('disclosedClaims', JSON.stringify(disclosedClaims, null, 2))
// if (presentation instanceof MdocVerifiablePresentation) {
// const deviceSigned = JSON.parse(presentation.deviceSignedBase64Url).deviceSigned
// const disclosedClaims = await Mdoc.getDisclosedClaims(deviceSigned)
// console.log('disclosedClaims', JSON.stringify(disclosedClaims, null, 2))

return {
pretty: JsonTransformer.toJSON(disclosedClaims),
encoded: deviceSigned,
}
}
// return {
// pretty: JsonTransformer.toJSON(disclosedClaims),
// encoded: deviceSigned,
// }
// }

return {
pretty: {
Expand Down
2 changes: 1 addition & 1 deletion agent/src/verifyHs256Callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const compressP256PublicKey = (uncompressed: Uint8Array): Uint8Array => {
return new Uint8Array(compressed)
}

export const verifyHs256Callback = (context: AgentContext, verifierKey: Record<string, unknown>) => {
export const getVerifyHs256Callback = (context: AgentContext, verifierKey: Record<string, unknown>) => {
return async (key: Key, data: Uint8Array, signatureBase64Url: string) => {
const mac = TypedArrayEncoder.fromBase64(signatureBase64Url)

Expand Down
1 change: 1 addition & 0 deletions app/components/IssueTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function IssueTab({ disabled = false }: { disabled?: boolean }) {
display: string
}>
availableX509Certificates: string[]
// biome-ignore lint/complexity/noBannedTypes: <explanation>
display: {}
}>()

Expand Down
2 changes: 1 addition & 1 deletion app/components/VerifyBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getRequestStatus } from '@/lib/api'
import { useInterval } from '@/lib/hooks'
import { CheckboxIcon, ExclamationTriangleIcon, InfoCircledIcon } from '@radix-ui/react-icons'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@radix-ui/react-tooltip'
import Link from 'next/link'
import { type FormEvent, useState } from 'react'
import QRCode from 'react-qr-code'
import { HighLight } from './highLight'
Expand All @@ -11,7 +12,6 @@ import { Card } from './ui/card'
import { Label } from './ui/label'
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from './ui/select'
import { TypographyH3, TypographyH4 } from './ui/typography'
import Link from 'next/link'

export type CredentialType = 'mdoc' | 'sdjwt'
export type RequestType = 'name_age_over_21' | 'city' | 'age_birth_family_name'
Expand Down
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
},
"pnpm": {
"overrides": {
"@sphereon/did-auth-siop": "file:./sphereon-did-auth-siop-0.16.0.tgz"
},
"patchedDependencies": {
"@credo-ts/[email protected]": "patches/@[email protected]",
"@credo-ts/[email protected]": "patches/@[email protected]"
"@credo-ts/askar": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/askar?funke",
"@credo-ts/core": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/core?funke",
"@credo-ts/openid4vc": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/openid4vc?funke",
"@credo-ts/node": "https://gitpkg.vercel.app/animo/aries-framework-javascript/packages/node?funke",
"@sphereon/did-auth-siop": "https://gitpkg.vercel.app/animo/OID4VC/packages/siop-oid4vp?funke",
"@sphereon/oid4vc-common": "https://gitpkg.vercel.app/animo/OID4VC/packages/common?funke",
"@sphereon/oid4vci-common": "https://gitpkg.vercel.app/animo/OID4VC/packages/oid4vci-common?funke",
"@sphereon/oid4vci-issuer": "https://gitpkg.vercel.app/animo/OID4VC/packages/issuer?funke",
"@sphereon/oid4vci-client": "https://gitpkg.vercel.app/animo/OID4VC/packages/client?funke",
"@sphereon/jarm": "https://gitpkg.vercel.app/animo/OID4VC/packages/jarm?funke",
"@sphereon/ssi-types": "0.29.1-unstable.208"
}
}
}
Loading

0 comments on commit 3c2e24c

Please sign in to comment.