Skip to content

Commit

Permalink
refactor: finish Vault migration for private keys (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
lautarodragan authored Sep 20, 2019
1 parent 5644ed4 commit 0808593
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 110 deletions.
1 change: 0 additions & 1 deletion src/api/works/CreateWork.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as Joi from 'joi'

import { WorkController } from '../../controllers/WorkController'
import { Vault } from '../../utils/Vault/Vault'

export const CreateWorkSchema = () => ({
'@context': Joi.alternatives(
Expand Down
5 changes: 1 addition & 4 deletions src/controllers/WorkController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { pipeP } from 'ramda'
import { PoetNode, WorkSearchFilters } from '../daos/PoetNodeDao'
import { decrypt } from '../helpers/crypto'
import { Network } from '../interfaces/Network'
import { Vault } from '../utils/Vault/Vault'

export interface WorkController {
readonly getById: (id: string, network: Network) => Promise<SignedVerifiableClaim>
Expand Down Expand Up @@ -76,9 +75,7 @@ export const WorkController = ({
},
}

const privateKey = encryptedPrivateKey.startsWith('vault')
? await Vault.decrypt(encryptedPrivateKey)
: decrypt(encryptedPrivateKey, privateKeyEncryptionKey)
const privateKey = decrypt(encryptedPrivateKey, privateKeyEncryptionKey)

const createAndSignClaim = pipeP(
configureCreateVerifiableClaim({ issuer, context: { ...legacyContext, ...context, ...aboutContext} }),
Expand Down
105 changes: 0 additions & 105 deletions src/scripts/migrate-private-keys.ts

This file was deleted.

0 comments on commit 0808593

Please sign in to comment.