Skip to content

Commit

Permalink
Merge pull request #38 from Sphereon-Opensource/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
nklomp authored Jul 23, 2024
2 parents 18c799e + c69c349 commit 9d40086
Show file tree
Hide file tree
Showing 17 changed files with 2,953 additions and 2,894 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@
"@veramo/remote-server": "4.2.0",
"@veramo/selective-disclosure": "4.2.0",
"@veramo/url-handler": "4.2.0",
"@sphereon/ssi-sdk.core": "0.25.0",
"@sphereon/ssi-types": "0.25.0",
"@sphereon/ssi-sdk.core": "0.27.0",
"@sphereon/ssi-types": "0.27.0",
"@digitalcredentials/ed25519-verification-key-2020": "3.2.2",
"*>@digitalcredentials/ed25519-verification-key-2020": "3.2.2",
"did-jwt": "6.11.6",
"did-jwt-vc": "3.1.3",
"ethr-did": "2.3.9",
Expand Down
7 changes: 0 additions & 7 deletions packages/did-provider-jwk/__tests__/jwk-did-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ describe('@sphereon/did-provider-jwk', () => {
expect(identifier.keys[0].type).toBe(Key.Ed25519)
})

it('should throw error when importing key without privateKeyHex', async () => {
const options = {
key: {},
}
await expect(agent.didManagerCreate({ options })).rejects.toThrow('We need to have a private key in Hex or PEM when importing a key')
})

it('should throw error for keys Ed25519 with key usage encryption', async () => {
const options = {
type: Key.Ed25519,
Expand Down
2 changes: 1 addition & 1 deletion packages/did-provider-jwk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@ethersproject/random": "^5.7.0",
"@sphereon/ssi-sdk-ext.did-utils": "workspace:*",
"@sphereon/ssi-sdk-ext.key-utils": "workspace:*",
"@sphereon/ssi-types": "0.25.0",
"@sphereon/ssi-types": "0.27.0",
"@stablelib/ed25519": "^1.0.3",
"@veramo/core": "4.2.0",
"@veramo/did-manager": "4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/did-provider-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"devDependencies": {
"@sphereon/ssi-sdk-ext.key-manager": "workspace:*",
"@sphereon/ssi-sdk-ext.kms-local": "workspace:*",
"@sphereon/ssi-sdk.dev": "0.25.0",
"@sphereon/ssi-sdk.dev": "0.27.0",
"@veramo/did-resolver": "4.2.0",
"@veramo/key-manager": "4.2.0"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/did-provider-web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ export interface IImportX509DIDArg {
}*/

export interface ICreateIdentifierArgs {
services?: IService[]
kms?: string
alias: string
options?: { keys?: IKeyOpts | IKeyOpts[] }
options?: { keys?: IKeyOpts | IKeyOpts[]; services?: IService[] }
}

export type IRequiredContext = IAgentContext<IKeyManager & IDIDManager>
10 changes: 4 additions & 6 deletions packages/did-provider-web/src/web-did-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ export class WebDIDProvider extends AbstractIdentifierProvider {
// Let's generate a key as no import keys or types are provided
opts.keys = [{ type: 'Secp256r1', isController: true }]
}
const keyOpts = typeof opts.keys === 'object' ? [opts.keys as IKeyOpts] : opts.keys
const keyOpts = Array.isArray(opts.keys) ? opts.keys : [opts.keys as IKeyOpts]
const keys = await Promise.all(
keyOpts.map((keyOpt) =>
importProvidedOrGeneratedKey({ kms: kms ?? this.defaultKms, options: Array.isArray(keyOpt) ? keyOpt[0] : keyOpt }, context)
)
keyOpts.map((keyOpt: IKeyOpts) => importProvidedOrGeneratedKey({ kms: kms ?? this.defaultKms, options: keyOpt }, context))
)

const controllerIdx = keyOpts.findIndex((opt) => opt.isController)
Expand All @@ -42,9 +40,9 @@ export class WebDIDProvider extends AbstractIdentifierProvider {
did: await asDidWeb(alias),
controllerKeyId,
keys,
services: args.services ?? [],
services: opts.services ?? [],
}
debug('Created', identifier.did)
debug('Created', identifier)
return identifier
}

Expand Down
15 changes: 10 additions & 5 deletions packages/did-resolver-ebsi/src/drivers/ebsi-v1.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { DIDDocument, DIDResolutionOptions } from 'did-resolver'
import { fetch } from 'cross-fetch'

export const EBSI_TEST_REGISTRY = 'https://api-test.ebsi.eu/did-registry/v4/identifiers'
export const EBSI_PILOT_REGISTRY = 'https://api-pilot.ebsi.eu/did-registry/v4'
export const EBSI_CONFORMANCE_REGISTRY = 'https://api-conformance.ebsi.eu/did-registry/v4/identifiers'
export const EBSI_TEST_REGISTRY = 'https://api-test.ebsi.eu/did-registry/v5/identifiers'
export const EBSI_PILOT_REGISTRY_V5 = 'https://api-pilot.ebsi.eu/did-registry/v5'
export const EBSI_CONFORMANCE_REGISTRY_V5 = 'https://api-conformance.ebsi.eu/did-registry/v5/identifiers'

export const EBSI_PILOT_REGISTRY_V4 = 'https://api-pilot.ebsi.eu/did-registry/v4'
export const EBSI_CONFORMANCE_REGISTRY_V4 = 'https://api-conformance.ebsi.eu/did-registry/v4/identifiers'

type EBSIResolutionOptions = DIDResolutionOptions & {
noFallbackRegistries?: boolean
Expand Down Expand Up @@ -58,8 +61,10 @@ const determineRegistries = (options: EBSIResolutionOptions): string[] => {
registries.add(process.env.EBSI_DEFAULT_REGISTRY)
}
if (options.noFallbackRegistries !== true) {
registries.add(EBSI_PILOT_REGISTRY)
registries.add(EBSI_CONFORMANCE_REGISTRY)
registries.add(EBSI_PILOT_REGISTRY_V5)
registries.add(EBSI_CONFORMANCE_REGISTRY_V5)
registries.add(EBSI_PILOT_REGISTRY_V4)
registries.add(EBSI_CONFORMANCE_REGISTRY_V4)
registries.add(EBSI_TEST_REGISTRY)
}
if (registries.size === 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/did-resolver-jwk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
"@sphereon/ssi-types": "0.25.0",
"@sphereon/ssi-types": "0.27.0",
"base64url": "^3.0.1",
"debug": "^4.3.4",
"did-resolver": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/did-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@ethersproject/transactions": "^5.7.0",
"@sphereon/did-uni-client": "^0.6.3",
"@sphereon/ssi-sdk-ext.key-utils": "workspace:*",
"@sphereon/ssi-sdk.core": "0.25.0",
"@sphereon/ssi-sdk.core": "0.27.0",
"@stablelib/ed25519": "^1.0.3",
"@veramo/core": "4.2.0",
"@veramo/utils": "4.2.0",
Expand Down
Loading

0 comments on commit 9d40086

Please sign in to comment.