Skip to content

Commit

Permalink
chore(cli): Adds mimeType option (#323)
Browse files Browse the repository at this point in the history
this matches the go command line tool
  • Loading branch information
dmihalcik-virtru authored Aug 12, 2024
1 parent fe0f663 commit 536c528
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ async function tdf3EncryptParamsFor(argv: Partial<mainArgs>): Promise<EncryptPar
if (argv.usersWithAccess?.length) {
c.setUsersWithAccess(argv.usersWithAccess.split(','));
}
if (argv.mimeType?.length) {
c.setMimeType(argv.mimeType);
}
// use offline mode, we do not have upsert for v2
c.setOffline();
// FIXME TODO must call file.close() after we are done
Expand Down Expand Up @@ -232,19 +235,25 @@ export const handleArgs = (args: string[]) => {
.options({
usersWithAccess: {
alias: 'users-with-access',
group: 'Policy Options',
group: 'Encrypt Options',
desc: 'Add users to the policy',
type: 'string',
default: '',
validate: (users: string) => users.split(','),
},
attributes: {
group: 'Policy Options',
group: 'Encrypt Options',
desc: 'Data attributes for the policy',
type: 'string',
default: '',
validate: (attributes: string) => attributes.split(','),
},
mimeType: {
group: 'Encrypt Options',
desc: 'Mime type for the plain text file (only supported for ztdf)',
type: 'string',
default: '',
},
})

// COMMANDS
Expand Down

0 comments on commit 536c528

Please sign in to comment.