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
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/**
* Method to mask the entities in the image.
*/
export type DeidentifyImageRequestMaskingMethod = "blackout" | "blur";
export type DeidentifyImageRequestMaskingMethod = "blackbox" | "blur";
export const DeidentifyImageRequestMaskingMethod = {
Blackout: "blackout",
Blackbox: "blackbox",
Blur: "blur",
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
/**
* How the output file is specified.
*/
export type DeidentifyStatusResponseOutputType = "base64" | "efs_path";
export type DeidentifyStatusResponseOutputType = "BASE64" | "EFS_PATH" | "UNKNOWN";
export const DeidentifyStatusResponseOutputType = {
Base64: "base64",
EfsPath: "efs_path",
Base64: "BASE64",
EfsPath: "EFS_PATH",
Unknown: "UNKNOWN",
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
/**
* Status of the detect run.
*/
export type DeidentifyStatusResponseStatus = "failed" | "in_progress" | "success";
export type DeidentifyStatusResponseStatus = "FAILED" | "IN_PROGRESS" | "SUCCESS";
export const DeidentifyStatusResponseStatus = {
Failed: "failed",
InProgress: "in_progress",
Success: "success",
Failed: "FAILED",
InProgress: "IN_PROGRESS",
Success: "SUCCESS",
} as const;
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export enum DetectOutputTranscription {
}

export enum MaskingMethod{
Blackout= "blackout",
Blackbox= "blackbox",
Blur= "blur",
}

Expand Down
10 changes: 8 additions & 2 deletions test/vault/utils/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,22 @@ describe('getToken', () => {

describe('getBearerToken', () => {
const logLevel = LogLevel.INFO;
const originalEnv = process.env;

beforeEach(() => {
jest.clearAllMocks();
process.env.SKYFLOW_CREDENTIALS = undefined;
process.env = { ...originalEnv };
delete process.env.SKYFLOW_CREDENTIALS;
});

afterEach(() => {
process.env = originalEnv;
});

test('should throw error if no credentials and no env variable', async () => {
await expect(getBearerToken(undefined, logLevel))
.rejects
.toThrow();
.toThrow(errorMessages.CREDENTIALS_REQUIRED);
});

test('should use environment variable when credentials not provided', async () => {
Expand Down
Loading