Skip to content

Commit

Permalink
Merge branch 'main' into test-x509-with-ed25519
Browse files Browse the repository at this point in the history
  • Loading branch information
berendsliedrecht authored Sep 12, 2024
2 parents a14f33f + 5ddd37a commit 5806268
Show file tree
Hide file tree
Showing 61 changed files with 6,853 additions and 8,929 deletions.
5 changes: 0 additions & 5 deletions .changeset/chatty-pens-hope.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/fifty-tools-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@credo-ts/openid4vc": patch
---

add support for cose_key as cryptographic_binding_methods_supported value
5 changes: 0 additions & 5 deletions .changeset/four-dodos-smoke.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/six-geese-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@credo-ts/cheqd": patch
---

add cheqd api to allow creation of DID-Linked resources
7 changes: 7 additions & 0 deletions packages/action-menu/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/action-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/action-menu",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
7 changes: 7 additions & 0 deletions packages/anoncreds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/anoncreds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/anoncreds",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export class AnonCredsCredentialFormatService implements CredentialFormatService
revocationRegistryIndex = Number(credentialMetadata.credentialRevocationId)
}

if (!revocationRegistryDefinitionId || !revocationRegistryIndex) {
if (!revocationRegistryDefinitionId || revocationRegistryIndex === undefined) {
throw new CredoError(
'Revocation registry definition id and revocation index are mandatory to issue AnonCreds revocable credentials'
)
Expand Down
4 changes: 3 additions & 1 deletion packages/anoncreds/src/utils/anonCredsObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export async function fetchCredentialDefinition(agentContext: AgentContext, cred
.getCredentialDefinition(agentContext, credentialDefinitionId)

if (!result || !result.credentialDefinition) {
throw new CredoError(`Schema not found for id ${credentialDefinitionId}: ${result.resolutionMetadata.message}`)
throw new CredoError(
`Credential definition not found for id ${credentialDefinitionId}: ${result.resolutionMetadata.message}`
)
}

const indyNamespace = result.credentialDefinitionMetadata.didIndyNamespace
Expand Down
7 changes: 7 additions & 0 deletions packages/askar/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/askar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/askar",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
7 changes: 7 additions & 0 deletions packages/bbs-signatures/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bbs-signatures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/bbs-signatures",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
8 changes: 8 additions & 0 deletions packages/cheqd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10
- @credo-ts/anoncreds@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/cheqd",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
23 changes: 23 additions & 0 deletions packages/cheqd/src/CheqdApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { AgentContext } from '@credo-ts/core'
import { injectable } from 'tsyringe'

import { CheqdCreateResourceOptions, CheqdDidRegistrar, CheqdDidResolver } from './dids'

@injectable()
export class CheqdApi {
private agentContext: AgentContext

public constructor(agentContext: AgentContext) {
this.agentContext = agentContext
}

public async createResource(did: string, options: CheqdCreateResourceOptions) {
const cheqdDidRegistrar = this.agentContext.dependencyManager.resolve(CheqdDidRegistrar)
return await cheqdDidRegistrar.createResource(this.agentContext, did, options)
}

public async resolveResource(resourceUrl: string) {
const cheqdDidResolver = this.agentContext.dependencyManager.resolve(CheqdDidResolver)
return await cheqdDidResolver.resolveResource(this.agentContext, resourceUrl)
}
}
2 changes: 2 additions & 0 deletions packages/cheqd/src/CheqdModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import type { AgentContext, DependencyManager, Module } from '@credo-ts/core'

import { AgentConfig, Buffer } from '@credo-ts/core'

import { CheqdApi } from './CheqdApi'
import { CheqdModuleConfig } from './CheqdModuleConfig'
import { CheqdLedgerService } from './ledger'

export class CheqdModule implements Module {
public readonly config: CheqdModuleConfig
public readonly api = CheqdApi

public constructor(config: CheqdModuleConfigOptions) {
this.config = new CheqdModuleConfig(config)
Expand Down
5 changes: 4 additions & 1 deletion packages/cheqd/src/dids/CheqdDidRegistrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,11 @@ export interface CheqdDidDeactivateOptions extends DidCreateOptions {
}
}

export interface CheqdCreateResourceOptions extends Omit<Partial<MsgCreateResourcePayload>, 'data'> {
export interface CheqdCreateResourceOptions extends Pick<MsgCreateResourcePayload, 'id' | 'name' | 'resourceType'> {
data: string | Uint8Array | object
collectionId?: MsgCreateResourcePayload['collectionId']
version?: MsgCreateResourcePayload['version']
alsoKnownAs?: MsgCreateResourcePayload['alsoKnownAs']
}

interface IVerificationMethod {
Expand Down
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.5.10

### Patch Changes

- fa62b74: Add support for Demonstrating Proof of Possesion (DPoP) when receiving credentials using OpenID4VCI

## 0.5.9

## 0.5.8
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/core",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down Expand Up @@ -42,7 +42,7 @@
"@sd-jwt/utils": "^0.7.0",
"@sphereon/pex": "^3.3.2",
"@sphereon/pex-models": "^2.2.4",
"@sphereon/ssi-types": "^0.23.0",
"@sphereon/ssi-types": "^0.28.0",
"@stablelib/ed25519": "^1.0.2",
"@types/ws": "^8.5.4",
"abort-controller": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export class V2CredentialProtocol<CFs extends CredentialFormatService[] = Creden
let credentialRecord = await this.findByProperties(messageContext.agentContext, {
threadId: proposalMessage.threadId,
role: CredentialRole.Issuer,
connectionId: connection?.id,
})

const formatServices = this.getFormatServicesFromMessage(proposalMessage.formats)
Expand Down Expand Up @@ -207,6 +206,15 @@ export class V2CredentialProtocol<CFs extends CredentialFormatService[] = Creden
expectedConnectionId: credentialRecord.connectionId,
})

// This makes sure that the sender of the incoming message is authorized to do so.
if (!credentialRecord?.connectionId) {
await connectionService.matchIncomingMessageToRequestMessageInOutOfBandExchange(messageContext, {
expectedConnectionId: credentialRecord?.connectionId,
})

credentialRecord.connectionId = connection?.id
}

await this.credentialFormatCoordinator.processProposal(messageContext.agentContext, {
credentialRecord,
formatServices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function getSubmissionRequirementRulePick(
// if the requirement is satisfied, we only need to return the satisfied submissions
// however if the requirement is not satisfied, we include all entries so the wallet could
// render which credentials are missing.
submission:
submissionEntry:
satisfiedSubmissions.length >= selectedSubmission.needsCount
? satisfiedSubmissions
: [...satisfiedSubmissions, ...unsatisfiedSubmissions],
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/modules/x509/X509ModuleConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export interface X509ModuleConfigOptions {
/**
*
* Array of trusted base64-encoded certificate strings in the DER-format.
*/
trustedCertificates?: [string, ...string[]]
}

Expand Down
7 changes: 7 additions & 0 deletions packages/drpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/drpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/drpc",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
10 changes: 10 additions & 0 deletions packages/indy-sdk-to-askar-migration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10
- @credo-ts/anoncreds@0.5.10
- @credo-ts/askar@0.5.10
- @credo-ts/node@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/indy-sdk-to-askar-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/indy-sdk-to-askar-migration",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
8 changes: 8 additions & 0 deletions packages/indy-vdr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10
- @credo-ts/anoncreds@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/indy-vdr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/indy-vdr",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
7 changes: 7 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.5.10

### Patch Changes

- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10

## 0.5.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/node",
"main": "src/index",
"types": "src/index",
"version": "0.5.9",
"version": "0.5.10",
"files": [
"build"
],
Expand Down
12 changes: 12 additions & 0 deletions packages/openid4vc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.5.10

### Patch Changes

- 2110e4a: fix: incorrect generation of code verifier for pkce
- 2110e4a: fix: include client_id when requesting credential using authorization_code flow
- 35a04e3: fix v11 metadata typing and update v11<->v13 tranformation logic accordingly
- fa62b74: Add support for Demonstrating Proof of Possesion (DPoP) when receiving credentials using OpenID4VCI
- a093150: fix: pass the `clientId` in the `requestCredentials` method from the API down to the service
- Updated dependencies [fa62b74]
- @credo-ts/core@0.5.10

## 0.5.9

### Patch Changes
Expand Down
Loading

0 comments on commit 5806268

Please sign in to comment.