Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] next from decentralized-identity:next #178

Merged
merged 11 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/build-and-test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:
POSTGRES_PORT: 5432
run: pnpm test:integration --shard=${{ matrix.shard }}/${{ strategy.job-total }}
- run: mv coverage/coverage-final.json coverage/${{matrix.shard}}.json
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-artifacts
name: coverage-artifacts-${{matrix.shard}}
path: coverage/

report-coverage:
Expand All @@ -78,9 +78,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-artifacts
pattern: coverage-artifacts-*
merge-multiple: true
path: coverage
- name: Merge Code Coverage
run: npx nyc merge coverage/ coverage/coverage-final.json
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build-test-publish-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
POSTGRES_PORT: 5432
run: pnpm test:integration --shard=${{ matrix.shard }}/${{ strategy.job-total }}
- run: mv coverage/coverage-final.json coverage/${{matrix.shard}}.json
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-artifacts
name: coverage-artifacts-${{ matrix.shard }}
path: coverage/

report-coverage:
Expand All @@ -87,9 +87,10 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-artifacts
pattern: coverage-artifacts-*
merge-multiple: true
path: coverage
- name: Merge Code Coverage
run: npx nyc merge coverage/ coverage/coverage-final.json
Expand Down
8 changes: 5 additions & 3 deletions __tests__/data.migration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ describe('data handling tests', () => {
describe('can recompute p256 keys from old database', () => {
const fixture = __dirname + '/fixtures/local-database-before-p256key-migration.sqlite'
const databaseFile = fixture + '.tmp'
// intentionally using DataSource instead of Promise<DataSource> to test compatibility
let dbConnection: DataSource
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let dbConnection: any // typeorm types don't seem to follow semantic release patterns leading to type errors

beforeAll(async () => {
await fs.promises.copyFile(fixture, databaseFile)
Expand Down Expand Up @@ -93,7 +93,9 @@ describe('data handling tests', () => {
})

it('when using data-store', async () => {
const dbConnection = new DataSource({
// typeorm types don't seem to follow semantic release patterns leading to type errors
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const dbConnection: any = new DataSource({
type: 'sqlite',
database: ':memory:',
entities: Entities,
Expand Down
3 changes: 2 additions & 1 deletion __tests__/initial.migration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ describe('database initial migration tests', () => {
const databaseFile = databaseBeforeFile + '.tmp'
type TestingAgentPlugins = IDIDManager & IKeyManager & IDataStore & IDataStoreORM & IResolver & IDIDComm
let agent: TAgent<TestingAgentPlugins>
let dbConnection: DataSource
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let dbConnection: any // typeorm types don't seem to follow semantic release patterns leading to type errors

beforeAll(async () => {
fs.copyFileSync(databaseBeforeFile, databaseFile)
Expand Down
3 changes: 2 additions & 1 deletion __tests__/localAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ let agent: TAgent<
ISelectiveDisclosure &
IDIDDiscovery
>
let dbConnection: Promise<DataSource>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let dbConnection: any // typeorm types don't seem to follow semantic release patterns leading to type errors
let databaseFile: string

const setup = async (options?: IAgentOptions): Promise<boolean> => {
Expand Down
3 changes: 2 additions & 1 deletion __tests__/localMemoryStoreAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ let agent: TAgent<
ICredentialPlugin &
ISelectiveDisclosure
>
let dbConnection: DataSource
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let dbConnection: any // typeorm types don't seem to follow semantic release patterns leading to type errors

const setup = async (options?: IAgentOptions): Promise<boolean> => {
// intentionally not initializing here to test compatibility
Expand Down
5 changes: 3 additions & 2 deletions __tests__/restAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ const secretKey = '29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa8
const port = 3002
const basePath = '/agent'

let dbConnection: Promise<DataSource>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let dbConnection: any // typeorm types don't seem to follow semantic release patterns leading to type errors
let serverAgent: IAgent
let restServer: Server

Expand Down Expand Up @@ -285,7 +286,7 @@ const setup = async (options?: IAgentOptions): Promise<boolean> => {
}

const tearDown = async (): Promise<boolean> => {
await new Promise((resolve, reject) => restServer.close(resolve))
await new Promise((resolve) => restServer.close(resolve))
try {
await (await dbConnection).dropDatabase()
await (await dbConnection).close()
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@
"devDependencies": {
"@jest/globals": "29.7.0",
"@metamask/eth-sig-util": "7.0.1",
"@microsoft/api-documenter": "7.23.30",
"@microsoft/api-extractor": "7.40.6",
"@microsoft/api-extractor-model": "7.28.13",
"@microsoft/tsdoc": "0.14.2",
"@noble/hashes": "1.4.0",
"@microsoft/api-documenter": "7.25.21",
"@microsoft/api-extractor": "7.47.11",
"@microsoft/api-extractor-model": "7.29.8",
"@microsoft/tsdoc": "0.15.0",
"@noble/hashes": "1.5.0",
"@stablelib/ed25519": "1.0.3",
"@transmute/credentials-context": "0.7.0-unstable.82",
"@types/express": "4.17.21",
"@types/fs-extra": "11.0.4",
"@types/jest": "29.5.12",
"@types/node": "20.11.19",
"@types/node": "20.17.4",
"@types/uuid": "9.0.8",
"caip": "1.1.0",
"credential-status": "3.0.4",
"cross-env": "7.0.3",
"did-jwt": "8.0.4",
"did-jwt-vc": "4.0.4",
"did-resolver": "4.1.0",
"ethers": "6.11.1",
"ethr-did-resolver": "10.1.9",
"express": "4.19.2",
"ethers": "6.13.4",
"ethr-did-resolver": "11.0.2",
"express": "4.21.1",
"ganache": "7.9.2",
"jest": "29.7.0",
"jest-config": "29.7.0",
Expand All @@ -59,15 +59,15 @@
"lerna": "8.1.2",
"lerna-changelog": "2.2.0",
"openapi-types": "12.1.3",
"prettier": "3.2.5",
"prettier": "3.3.3",
"rimraf": "5.0.5",
"semantic-release": "23.0.2",
"ts-jest": "29.1.2",
"semantic-release": "23.1.1",
"ts-jest": "29.2.5",
"ts-json-schema-generator": "1.5.0",
"ts-node": "10.9.2",
"typeorm": "0.3.17",
"typescript": "5.3.3",
"uint8arrays": "5.0.2",
"typeorm": "0.3.20",
"typescript": "5.6.3",
"uint8arrays": "5.1.0",
"uuid": "9.0.1",
"web-did-resolver": "2.0.27"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"debug": "^4.3.4",
"did-resolver": "^4.1.0",
"dotenv": "^16.4.5",
"ethr-did-resolver": "^10.1.5",
"ethr-did-resolver": "^11.0.2",
"express": "^4.18.2",
"express-handlebars": "^7.1.2",
"fuzzy": "^0.1.3",
Expand All @@ -93,7 +93,7 @@
"sqlite3": "^5.1.7",
"swagger-ui-express": "^5.0.0",
"ts-json-schema-generator": "^2.0.0",
"typeorm": "^0.3.17",
"typeorm": "^0.3.20",
"url-parse": "^1.5.10",
"web-did-resolver": "^2.0.27",
"ws": "^8.16.0",
Expand All @@ -109,7 +109,7 @@
"@types/qrcode-terminal": "0.12.0",
"@types/url-parse": "1.4.8",
"@types/ws": "8.5.5",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"bin/**/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@types/debug": "4.1.8",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
14 changes: 13 additions & 1 deletion packages/core-types/src/plugin.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ export const schema = {
"meta": {
"$ref": "#/components/schemas/KeyMetadata",
"description": "Optional. Key meta data"
},
"kid": {
"type": "string",
"description": "Optional. Key ID"
}
},
"required": [
Expand Down Expand Up @@ -4363,7 +4367,15 @@ export const schema = {
"description": "The data type for `@context` properties of credentials, presentations, etc."
},
"DateType": {
"type": "string",
"anyOf": [
{
"type": "string"
},
{
"type": "string",
"format": "date-time"
}
],
"description": "Represents an issuance or expiration date for Credentials / Presentations. This is used as input when creating them."
},
"CredentialStatusReference": {
Expand Down
5 changes: 5 additions & 0 deletions packages/core-types/src/types/IKeyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export interface IKeyManagerCreateArgs {
* Optional. Key meta data
*/
meta?: KeyMetadata

/**
* Optional. Key ID
*/
kid?: string;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"devDependencies": {
"@types/debug": "4.1.8",
"@types/events": "3.0.0",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-eip712/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@types/debug": "4.1.8",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-jwt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@types/debug": "4.1.8",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-ld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"devDependencies": {
"@types/debug": "4.1.8",
"borc": "3.0.0",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-status/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@types/debug": "4.1.8",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
2 changes: 2 additions & 0 deletions packages/credential-status/src/credential-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ICheckCredentialStatusArgs,
ICredentialStatusVerifier,
IResolver,
schema,
} from '@veramo/core-types'
import { extractIssuer, isDefined, resolveDidOrThrow } from '@veramo/utils'
import { Status, StatusMethod } from 'credential-status'
Expand All @@ -29,6 +30,7 @@ import { Status, StatusMethod } from 'credential-status'
*/
export class CredentialStatusPlugin implements IAgentPlugin {
private readonly status: Status
readonly schema = schema.ICredentialStatusVerifier
readonly methods: ICredentialStatusVerifier

constructor(registry: Record<string, StatusMethod> = {}) {
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-w3c/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"devDependencies": {
"@types/debug": "4.1.8",
"@types/uuid": "9.0.2",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-store-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/debug": "4.1.8",
"@types/ungap__structured-clone": "1.2.0",
"@types/uuid": "9.0.2",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
4 changes: 2 additions & 2 deletions packages/data-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"@veramo/utils": "workspace:^",
"debug": "^4.3.3",
"did-jwt-vc": "^4.0.0",
"typeorm": "^0.3.17",
"typeorm": "^0.3.20",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/debug": "4.1.8",
"@types/uuid": "9.0.2",
"sqlite3": "5.1.6",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
4 changes: 2 additions & 2 deletions packages/did-comm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@noble/curves": "^1.4.2",
"@noble/ciphers": "^0.5.3",
"@noble/ciphers": "^1.0.0",
"@stablelib/aes-kw": "^2.0.0",
"@veramo/core-types": "workspace:^",
"@veramo/kv-store": "workspace:^",
Expand All @@ -34,7 +34,7 @@
"devDependencies": {
"@types/debug": "4.1.8",
"@types/uuid": "9.0.2",
"typescript": "5.3.3"
"typescript": "5.6.3"
},
"files": [
"build/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ describe('coordinate-mediation-message-handler', () => {
let agent: TAgent<IResolver & IKeyManager & IDIDManager & IDIDComm & IMessageHandler & IDataStore>
let didCommEndpointServer: Server
let listeningPort = Math.round(Math.random() * 32000 + 2048)
let dbConnection: DataSource
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let dbConnection: any // typeorm types don't seem to follow semantic release patterns leading to type errors

beforeAll(async () => {
dbConnection = new DataSource({
Expand Down Expand Up @@ -168,7 +169,7 @@ describe('coordinate-mediation-message-handler', () => {

afterAll(async () => {
try {
await new Promise((resolve, reject) => didCommEndpointServer?.close(resolve))
await new Promise((resolve) => didCommEndpointServer?.close(resolve))
} catch (e: any) {
// nop
}
Expand Down
Loading
Loading