Skip to content

Commit

Permalink
fix: Show label in cloak CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Dec 14, 2021
1 parent 722ea43 commit b4eefb7
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import dotenv from 'dotenv'
import fs from 'fs'
import ago from 's-ago'
import {
CloakKey,
FINGERPRINT_LENGTH,
generateKey,
getKeyFingerprint,
FINGERPRINT_LENGTH,
parseKey,
serializeKey,
CloakKey
serializeKey
} from './key'
import {
CloakKeychain,
exportKeychain,
importKeychain,
findKeyForMessage,
makeKeychain,
CloakKeychain
importKeychain,
makeKeychain
} from './keychain'
import { encryptString, decryptString } from './message'
import { decryptString, encryptString } from './message'

dotenv.config()

Expand Down Expand Up @@ -181,18 +181,20 @@ program
const keychain = await getEnvKeychain()
const table = await Promise.all(
Object.keys(keychain).map(async fingerprint => {
const { key, createdAt } = keychain[fingerprint]
const { key, createdAt, label } = keychain[fingerprint]
const creationDate = new Date(createdAt)
return full
? {
fingerprint,
createdAt: creationDate.toISOString(),
key: await serializeKey(key)
key: await serializeKey(key),
label
}
: {
fingerprint,
created: ago(creationDate),
key: '[redacted]'
key: '[redacted]',
label
}
})
)
Expand Down

0 comments on commit b4eefb7

Please sign in to comment.