@cerbos/core
Version:
Common types used by the Cerbos client libraries
146 lines (124 loc) • 3.33 kB
text/typescript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// source: cerbos/audit/v1/audit.proto
/* eslint-disable */
import type {
CheckInput,
CheckOutput,
PlanResourcesInput,
PlanResourcesOutput,
} from "../../engine/v1/engine";
import type { SourceAttributes } from "../../policy/v1/policy";
export const protobufPackage = "cerbos.audit.v1";
export interface AccessLogEntry {
callId: string;
timestamp: Date | undefined;
peer: Peer | undefined;
metadata: { [key: string]: MetaValues };
method: string;
statusCode: number;
oversized: boolean;
policySource: PolicySource | undefined;
}
export interface AccessLogEntry_MetadataEntry {
key: string;
value: MetaValues | undefined;
}
export interface DecisionLogEntry {
callId: string;
timestamp: Date | undefined;
peer: Peer | undefined;
inputs: CheckInput[];
outputs: CheckOutput[];
error: string;
method?:
| {
$case: "checkResources";
checkResources: DecisionLogEntry_CheckResources;
}
| {
$case: "planResources";
planResources: DecisionLogEntry_PlanResources;
}
| undefined;
metadata: { [key: string]: MetaValues };
auditTrail: AuditTrail | undefined;
oversized: boolean;
policySource: PolicySource | undefined;
}
export interface DecisionLogEntry_CheckResources {
inputs: CheckInput[];
outputs: CheckOutput[];
error: string;
}
export interface DecisionLogEntry_PlanResources {
input: PlanResourcesInput | undefined;
output: PlanResourcesOutput | undefined;
error: string;
}
export interface DecisionLogEntry_MetadataEntry {
key: string;
value: MetaValues | undefined;
}
export interface MetaValues {
values: string[];
}
export interface Peer {
address: string;
authInfo: string;
userAgent: string;
forwardedFor: string;
}
export interface AuditTrail {
effectivePolicies: { [key: string]: SourceAttributes };
}
export interface AuditTrail_EffectivePoliciesEntry {
key: string;
value: SourceAttributes | undefined;
}
export interface PolicySource {
source?:
| { $case: "blob"; blob: PolicySource_Blob }
| { $case: "database"; database: PolicySource_Database }
| { $case: "disk"; disk: PolicySource_Disk }
| { $case: "git"; git: PolicySource_Git }
| { $case: "hub"; hub: PolicySource_Hub }
| { $case: "embeddedPdp"; embeddedPdp: PolicySource_EmbeddedPDP }
| undefined;
}
export interface PolicySource_Blob {
bucketUrl: string;
prefix: string;
}
export interface PolicySource_Database {
driver: PolicySource_Database_Driver;
}
export enum PolicySource_Database_Driver {
DRIVER_UNSPECIFIED = 0,
DRIVER_MYSQL = 1,
DRIVER_POSTGRES = 2,
DRIVER_SQLITE3 = 3,
}
export interface PolicySource_Disk {
directory: string;
}
export interface PolicySource_EmbeddedPDP {
url: string;
commitHash: string;
builtAt: Date | undefined;
}
export interface PolicySource_Git {
repositoryUrl: string;
branch: string;
subdirectory: string;
}
export interface PolicySource_Hub {
source?:
| { $case: "label"; label: string }
| { $case: "deploymentId"; deploymentId: string }
| { $case: "playgroundId"; playgroundId: string }
| { $case: "localBundle"; localBundle: PolicySource_Hub_LocalBundle }
| undefined;
}
export interface PolicySource_Hub_LocalBundle {
path: string;
}