Skip to content

Commit

Permalink
add a test fips command
Browse files Browse the repository at this point in the history
  • Loading branch information
etnbrd committed Nov 7, 2024
1 parent 3e6dba6 commit a144dab
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/commands/test-fips/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { getFips, setFips } from 'crypto'

import { Command } from 'clipanion'

class TestFipsCommand extends Command {
public static paths = [['test-fips']]

public static usage = Command.Usage({
description: 'Test fips compliance of datadog-ci.',
})

public async execute() {
setFips(true)
const isFipsEnabled = getFips()
this.context.stdout.write(`FIPS ${isFipsEnabled === 1 ? 'enabled' : 'disabled'} (${isFipsEnabled})\n`)

return 0
}
}

module.exports = [TestFipsCommand]

0 comments on commit a144dab

Please sign in to comment.