Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

[CON-100] Implemented didAuthAdapter field #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions common-libs/internal-api-clients/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# release 1.2.1 (2021-12-13)
* More types exported
# release 1.2.0 (2021-12-07)
* Updated `tools-openapi` (removing dependency on `node-fetch` and `undici`)
# release 1.1.1 (2021-11-29)
Expand Down
4 changes: 2 additions & 2 deletions common-libs/internal-api-clients/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions common-libs/internal-api-clients/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affinidi/internal-api-clients",
"version": "1.2.0",
"version": "1.2.1",
"description": "SDK core monorepo for affinity DID solution",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -42,7 +42,7 @@
"homepage": "https://github.com/affinityproject/affinidi-core-sdk#readme",
"dependencies": {
"@affinidi/tools-common": "^1.0.1",
"@affinidi/tools-openapi": "^1.1.0"
"@affinidi/tools-openapi": "^1.1.1"
},
"devDependencies": {
"@affinidi/eslint-config": "1.0.1",
Expand Down
2 changes: 2 additions & 0 deletions common-libs/internal-api-clients/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ export {
CloudWalletApiService,
VaultMigrationApiService,
}

export type { DidAuthAdapterType } from '@affinidi/tools-openapi'
vitalyrudenko-affinidi marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions common-libs/tools-openapi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# release 1.1.1 (2021-12-13)
* More types exported
# release 1.1.0 (2021-12-07)
* Removed dependency on `node-fetch` and `undici`
# release 1.0.2 (2021-11-29)
Expand Down
4 changes: 2 additions & 2 deletions common-libs/tools-openapi/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common-libs/tools-openapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affinidi/tools-openapi",
"version": "1.1.0",
"version": "1.1.1",
"description": "SDK core monorepo for affinity DID solution",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions common-libs/tools-openapi/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export { ClientOptions, createClient, createClientMethods, GetParams } from './helpers/client'
export {
createDidAuthClient,
DidAuthAdapterType,
DidAuthConstructorOptions,
GetDidAuthParams,
wrapWithDidAuth,
Expand Down
4 changes: 2 additions & 2 deletions sdk/browser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affinidi/wallet-browser-sdk",
"version": "6.1.0",
"version": "6.1.1",
"description": "SDK monorepo for affinity DID solution for browser",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -38,7 +38,7 @@
"license": "ISC",
"dependencies": {
"@affinidi/platform-fetch-native": "^1.0.0",
"@affinidi/wallet-core-sdk": "^6.1.0",
"@affinidi/wallet-core-sdk": "^6.1.1",
"eccrypto-js": "^5.0.0",
"randombytes": "^2.1.0"
},
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# release 6.1.1 (2021-12-13)
* Implemented `didAuthAdapter` field
# release 6.1.0 (2021-12-07)
* Updated `internal-api-clients`, `did-auth-lib`, `user-management` and `common` (removing dependency on `node-fetch` and `undici`)
# release 6.0.4 (2021-12-06)
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affinidi/wallet-core-sdk",
"version": "6.1.0",
"version": "6.1.1",
"description": "SDK core monorepo for affinity DID solution",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -44,7 +44,7 @@
"@affinidi/affinidi-did-auth-lib": "^2.1.0",
"@affinidi/affinity-metrics-lib": "^0.0.25",
"@affinidi/common": "^2.1.0",
"@affinidi/internal-api-clients": "^1.2.0",
"@affinidi/internal-api-clients": "^1.2.1",
"@affinidi/issuer-email-ses-client": "^0.1.1",
"@affinidi/issuer-phone-twilio-client": "^0.1.1",
"@affinidi/tools-common": "^1.0.0",
Expand Down
5 changes: 4 additions & 1 deletion sdk/core/src/CommonNetworkMember/BaseNetworkMember.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DidDocumentService, JwtService, KeysService, MetricsService, Affinity, LocalKeyVault } from '@affinidi/common'
import { DidAuthClientService, Signer } from '@affinidi/affinidi-did-auth-lib'
import {
DidAuthAdapterType,
IssuerApiService,
RegistryApiService,
RevocationApiService,
Expand Down Expand Up @@ -92,6 +93,7 @@ export abstract class BaseNetworkMember {
private readonly _didDocumentKeyId: string
protected readonly _component: EventComponent
protected readonly _platformCryptographyTools
public readonly didAuthAdapter

constructor(
{ did, didDocumentKeyId, encryptedSeed, password }: ConstructorUserData,
Expand Down Expand Up @@ -119,7 +121,7 @@ export abstract class BaseNetworkMember {
const keyVault = new LocalKeyVault(keysService)
const signer = new Signer({ did, keyId: didDocumentKeyId, keyVault })
const didAuthService = new DidAuthClientService(signer)
const didAuthAdapter = new DidAuthAdapter(did, didAuthService)
const didAuthAdapter: DidAuthAdapterType = new DidAuthAdapter(did, didAuthService)

this._metricsService = new MetricsService({
metricsUrl,
Expand Down Expand Up @@ -170,6 +172,7 @@ export abstract class BaseNetworkMember {
this._did = did
this._didDocumentKeyId = didDocumentKeyId
this._platformCryptographyTools = platformCryptographyTools
this.didAuthAdapter = didAuthAdapter
}

/**
Expand Down
5 changes: 2 additions & 3 deletions sdk/core/src/migration/credentials/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { DidAuthAdapterType, VaultMigrationApiService } from '@affinidi/internal-api-clients'
import { CredentialLike } from '../../dto/internal'
import { DidAuthAdapter } from '../../shared/DidAuthAdapter'
import { extractSDKVersion } from '../../_helpers'
import { VaultMigrationApiService } from '@affinidi/internal-api-clients'
import AffinidiVaultEncryptionService from '../../services/AffinidiVaultEncryptionService'

interface vcMigrationList {
Expand All @@ -14,7 +13,7 @@ interface vcMigrationList {
type ConstructorOptions = {
accessApiKey: string
bloomDid: string
didAuthAdapter: DidAuthAdapter
didAuthAdapter: DidAuthAdapterType
encryptionService: AffinidiVaultEncryptionService
migrationUrl: string
}
Expand Down
5 changes: 2 additions & 3 deletions sdk/core/src/services/AffinidiVaultStorageService.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { AffinidiVaultApiService } from '@affinidi/internal-api-clients'
import { AffinidiVaultApiService, DidAuthAdapterType } from '@affinidi/internal-api-clients'
import { profile } from '@affinidi/tools-common'

import { extractSDKVersion } from '../_helpers'
import { CredentialLike } from '../dto/internal'
import { VaultCredential } from '../dto/vault.dto'
import { DidAuthAdapter } from '../shared/DidAuthAdapter'
import AffinidiVaultEncryptionService from './AffinidiVaultEncryptionService'

type AffinidiVaultStorageOptions = {
didAuthAdapter: DidAuthAdapter
didAuthAdapter: DidAuthAdapterType
accessApiKey: string
vaultUrl: string
}
Expand Down
5 changes: 2 additions & 3 deletions sdk/core/src/services/BloomVaultStorageService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { KeysService } from '@affinidi/common'
import { BloomVaultApiService } from '@affinidi/internal-api-clients'
import { DidAuthAdapter } from '../shared/DidAuthAdapter'
import { BloomVaultApiService, DidAuthAdapterType } from '@affinidi/internal-api-clients'
import { profile } from '@affinidi/tools-common'

import { toRpcSig, ecsign } from 'ethereumjs-util'
Expand All @@ -20,7 +19,7 @@ const bip32 = require('bip32')
const jolocomIdentityKey = "m/73'/0'/0'/0" // eslint-disable-line

type BloomVaultStorageOptions = {
didAuthAdapter?: DidAuthAdapter
didAuthAdapter?: DidAuthAdapterType
accessApiKey: string
vaultUrl: string
migrationUrl: string
Expand Down
5 changes: 2 additions & 3 deletions sdk/core/src/services/WalletStorageService.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { JwtService, KeysService } from '@affinidi/common'
import { KeyStorageApiService } from '@affinidi/internal-api-clients'
import { DidAuthAdapterType, KeyStorageApiService } from '@affinidi/internal-api-clients'
import { profile } from '@affinidi/tools-common'
import { extractSDKVersion } from '../_helpers'
import { Env, SignedCredential } from '../dto/shared.dto'
import { DidAuthAdapter } from '../shared/DidAuthAdapter'
import { IPlatformCryptographyTools } from '../shared/interfaces'
import SdkErrorFromCode from '../shared/SdkErrorFromCode'
import AffinidiVaultStorageService from './AffinidiVaultStorageService'
Expand All @@ -22,7 +21,7 @@ type ConstructorOptions = {
migrationUrl: string
storageRegion: string
accessApiKey: string
didAuthAdapter: DidAuthAdapter
didAuthAdapter: DidAuthAdapterType
}

@profile()
Expand Down
4 changes: 2 additions & 2 deletions sdk/expo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/expo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affinidi/wallet-expo-sdk",
"version": "6.1.0",
"version": "6.1.1",
"description": "SDK monorepo for affinity DID solution for Expo",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -39,7 +39,7 @@
"license": "ISC",
"dependencies": {
"@affinidi/platform-fetch-native": "^1.0.0",
"@affinidi/wallet-core-sdk": "^6.1.0",
"@affinidi/wallet-core-sdk": "^6.1.1",
"assert": "^2.0.0",
"buffer": "^5.6.0",
"eccrypto-js": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affinidi/wallet-node-sdk",
"version": "6.2.0",
"version": "6.2.1",
"description": "SDK monorepo for affinity DID solution for node",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -38,7 +38,7 @@
"license": "ISC",
"dependencies": {
"@affinidi/platform-fetch-node": "^1.0.0",
"@affinidi/wallet-core-sdk": "^6.1.0",
"@affinidi/wallet-core-sdk": "^6.1.1",
"@mattrglobal/jsonld-signatures-bbs": "^0.12.0",
"bs58": "^4.0.1",
"crypto-ld": "^3.9.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/react-native/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@affinidi/wallet-react-native-sdk",
"version": "6.1.0",
"version": "6.1.1",
"description": "SDK for affinity DID solution for React Native",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -32,7 +32,7 @@
"license": "ISC",
"dependencies": {
"@affinidi/platform-fetch-native": "^1.0.0",
"@affinidi/wallet-core-sdk": "^6.1.0",
"@affinidi/wallet-core-sdk": "^6.1.1",
"assert": "^2.0.0",
"buffer": "^5.6.0",
"eccrypto-js": "^5.0.0",
Expand Down