Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ssl-key-storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ import * as path from 'path';
import { mockExecaFn } from './test-helpers/mock-execa.test-utils';
import {
mountSslTmpfs,
secureWipeFile,
cleanupSslKeyMaterial,
testHelpers,
} from './ssl-key-storage';

const FAKE_FD = 42;
const { secureWipeFile } = testHelpers;

describe('ssl-key-storage', () => {
beforeEach(() => {
Expand Down
7 changes: 5 additions & 2 deletions src/ssl-key-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ export async function unmountSslTmpfs(sslDir: string): Promise<void> {
* cannot be guaranteed on all filesystems (for example, journaling/COW).
*
* @param filePath - Path to the file to securely wipe
* @internal Exported for testing
*/
export function secureWipeFile(filePath: string): void {
function secureWipeFile(filePath: string): void {
let fd: number | undefined;

try {
Expand Down Expand Up @@ -167,3 +166,7 @@ export function cleanupSslKeyMaterial(workDir: string): void {

logger.debug('SSL key material securely wiped');
}

/** @internal Exposed for unit tests. */
// ts-prune-ignore-next
export const testHelpers = { secureWipeFile };
Loading