-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Command } from 'clipanion' | ||
|
||
import { enableFips } from '../../helpers/fips' | ||
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Build and test (18)
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Build and test (20)
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Build and test (14)
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Test standalone binary in ARM ubuntu
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Build and test (16)
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Test standalone binary in ubuntu
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Test standalone binary in macOS
Check failure on line 3 in src/commands/test-fips/cli.ts GitHub Actions / Test standalone binary in ARM macOS
|
||
|
||
class TestFipsCommand extends Command { | ||
public static paths = [['test-fips']] | ||
|
||
public static usage = Command.Usage({ | ||
description: 'Test fips compliance of datadog-ci.', | ||
}) | ||
|
||
public async execute() { | ||
try { | ||
const fipsEnabled = enableFips() | ||
this.context.stdout.write(`FIPS is ${fipsEnabled ? 'enabled' : 'disabled'} (${fipsEnabled})\n`) | ||
} catch (error) { | ||
this.context.stdout.write(error.message) | ||
} | ||
|
||
return 0 | ||
} | ||
} | ||
|
||
module.exports = [TestFipsCommand] |