openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
276 stars 202 forks source link

Allow to specify TAA method #707

Closed TimoGlastra closed 2 years ago

TimoGlastra commented 2 years ago

Currently we always take the first TAA acceptance mechanism. We should update this to be configurable so users of the framework can indicate which TAA acceptance mechanism to use

Relevant code:

https://github.com/hyperledger/aries-framework-javascript/blob/858253a2ed9da8f62a7b41b7a4c9c16dc9d2614c/packages/core/src/modules/ledger/services/IndyLedgerService.ts#L454-L478

As we have multi ledger support I propose we extend the indy ledgers config and add an optional taaAccept property to it with a version (you have to know which version of the TAA you've accepted).

// Add new interface
export interface TransactionAuthorAgreement {
    version: `${number}.${number}`
    acceptanceMechanism: string
}

export interface IndyPoolConfig {
  genesisPath?: string
  genesisTransactions?: string
  id: string
  isProduction: boolean
  // add optional property
  transactionAuthorAgreement?: TransactionAuthorAgreement
}

If the TAA hasn't been specified we should throw an error instead of automatically taking the first one. We need to keep it optional for agents that do not write to the ledger.

morrieinmaas commented 2 years ago

@TimoGlastra can you assign me this issue please

TimoGlastra commented 2 years ago

Fixed in #849