Skip to content

Commit

Permalink
feat: add exposure report to api key model (#897)
Browse files Browse the repository at this point in the history
J:ORG-911
  • Loading branch information
schaoukicoveo authored Dec 17, 2024
1 parent 0a2772a commit f396eb0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/resources/ApiKeys/ApiKeysInterfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {GranularResource, PrivilegeModel} from '../BaseInterfaces.js';
import {ApiKeyStatus} from '../Enums.js';
import {ApiKeyStatus,ApiKeyExposureReportSeverity,ApiKeyReportCreationType} from '../Enums.js';

export interface ApiKeyBaseModel extends GranularResource {
/**
Expand Down Expand Up @@ -99,6 +99,10 @@ export interface ApiKeyModel extends ApiKeyBaseModel {
* The date the API key has been disabled.
*/
disabledDate?: number;
/**
* The exposure report associated with the API key
*/
exposureReport?: ExposureReport;
}

export interface CreateApiKeyModel extends ApiKeyBaseModel {
Expand Down Expand Up @@ -184,3 +188,32 @@ interface EnforceQueryPipelineConfigurationModel {
interface ImpersonationRestrictionsModel {
allowedUserIds: QueryAuthenticationModel[];
}

interface ExposureReport {
/**
* API Key logger id associated to the Exposure Report
*/
apiKeyLoggerId: string,
/**
* The severity of the exposure
*/
severity: ApiKeyExposureReportSeverity,
/**
* The reason behind the exposure report for a given API key
*/
reason: string,
/**
* The date the key should be deactivated
*/
deactivationDate: number,
/**
* The way the API key report has been created
*/
creationType: ApiKeyReportCreationType,
/**
* Represents the user that has created the report
*/
createdBy: any
}


14 changes: 14 additions & 0 deletions src/resources/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,3 +1178,17 @@ export enum ApiKeyStatus {
SOON_TO_BE_DISABLED = 'SOON_TO_BE_DISABLED',
DISABLED_EXPOSED = 'DISABLED_EXPOSED'
}

export enum ApiKeyReportCreationType {
MANUAL = 'MANUAL',
AUTOMATED = 'AUTOMATED'
}


export enum ApiKeyExposureReportSeverity {
CRITICAL = 'CRITICAL',
HIGH = 'HIGH',
MEDIUM = 'MEDIUM',
LOW = 'LOW',
WARN = 'WARN'
}

0 comments on commit f396eb0

Please sign in to comment.