Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add exposure report to api key model #897

Merged
merged 1 commit into from
Dec 17, 2024
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
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'
}
Loading