Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cerbos/grpc

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cerbos/grpc - npm Package Compare versions

Comparing version 0.18.4 to 0.19.0

41

lib/protobuf/buf/validate/validate.d.ts
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Duration } from "../../google/protobuf/duration";
import { Constraint } from "./expression";
export declare const protobufPackage = "buf.validate";

@@ -18,2 +17,7 @@ export declare enum Ignore {

}
export interface Constraint {
id?: string | undefined;
message?: string | undefined;
expression?: string | undefined;
}
export interface OneofConstraints {

@@ -24,4 +28,4 @@ required?: boolean | undefined;

cel: Constraint[];
required: boolean;
ignore: Ignore;
required?: boolean | undefined;
ignore?: Ignore | undefined;
type?: {

@@ -91,5 +95,8 @@ $case: "float";

} | undefined;
skipped: boolean;
ignoreEmpty: boolean;
skipped?: boolean | undefined;
ignoreEmpty?: boolean | undefined;
}
export interface PredefinedConstraints {
cel: Constraint[];
}
export interface FloatRules {

@@ -113,3 +120,4 @@ const?: number | undefined;

notIn: number[];
finite: boolean;
finite?: boolean | undefined;
example: number[];
}

@@ -134,3 +142,4 @@ export interface DoubleRules {

notIn: number[];
finite: boolean;
finite?: boolean | undefined;
example: number[];
}

@@ -155,2 +164,3 @@ export interface Int32Rules {

notIn: number[];
example: number[];
}

@@ -175,2 +185,3 @@ export interface Int64Rules {

notIn: string[];
example: string[];
}

@@ -195,2 +206,3 @@ export interface UInt32Rules {

notIn: number[];
example: number[];
}

@@ -215,2 +227,3 @@ export interface UInt64Rules {

notIn: string[];
example: string[];
}

@@ -235,2 +248,3 @@ export interface SInt32Rules {

notIn: number[];
example: number[];
}

@@ -255,2 +269,3 @@ export interface SInt64Rules {

notIn: string[];
example: string[];
}

@@ -275,2 +290,3 @@ export interface Fixed32Rules {

notIn: number[];
example: number[];
}

@@ -295,2 +311,3 @@ export interface Fixed64Rules {

notIn: string[];
example: string[];
}

@@ -315,2 +332,3 @@ export interface SFixed32Rules {

notIn: number[];
example: number[];
}

@@ -335,5 +353,7 @@ export interface SFixed64Rules {

notIn: string[];
example: string[];
}
export interface BoolRules {
const?: boolean | undefined;
example: boolean[];
}

@@ -411,2 +431,3 @@ export interface StringRules {

strict?: boolean | undefined;
example: string[];
}

@@ -434,2 +455,3 @@ export interface BytesRules {

} | undefined;
example: Uint8Array[];
}

@@ -441,2 +463,3 @@ export interface EnumRules {

notIn: number[];
example: number[];
}

@@ -477,2 +500,3 @@ export interface RepeatedRules {

notIn: Duration[];
example: Duration[];
}

@@ -502,5 +526,8 @@ export interface TimestampRules {

within?: Duration | undefined;
example: Date[];
}
export declare const Constraint: MessageFns<Constraint>;
export declare const OneofConstraints: MessageFns<OneofConstraints>;
export declare const FieldConstraints: MessageFns<FieldConstraints>;
export declare const PredefinedConstraints: MessageFns<PredefinedConstraints>;
export declare const FloatRules: MessageFns<FloatRules>;

@@ -507,0 +534,0 @@ export declare const DoubleRules: MessageFns<DoubleRules>;

import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Effect } from "../../effect/v1/effect";
export declare const protobufPackage = "cerbos.policy.v1";
export declare enum ScopePermissions {
SCOPE_PERMISSIONS_UNSPECIFIED = 0,
SCOPE_PERMISSIONS_OVERRIDE_PARENT = 1,
SCOPE_PERMISSIONS_REQUIRE_PARENTAL_CONSENT_FOR_ALLOWS = 2
}
export interface Policy {

@@ -21,2 +26,8 @@ apiVersion: string;

exportVariables: ExportVariables;
} | {
$case: "rolePolicy";
rolePolicy: RolePolicy;
} | {
$case: "exportConstants";
exportConstants: ExportConstants;
} | undefined;

@@ -63,2 +74,4 @@ variables: {

variables: Variables | undefined;
scopePermissions: ScopePermissions;
constants: Constants | undefined;
}

@@ -74,2 +87,16 @@ export interface ResourceRule {

}
export interface RolePolicy {
policyType?: {
$case: "role";
role: string;
} | undefined;
parentRoles: string[];
scope: string;
rules: RoleRule[];
scopePermissions: ScopePermissions;
}
export interface RoleRule {
resource: string;
allowActions: string[];
}
export interface PrincipalPolicy {

@@ -81,2 +108,4 @@ principal: string;

variables: Variables | undefined;
scopePermissions: ScopePermissions;
constants: Constants | undefined;
}

@@ -98,2 +127,3 @@ export interface PrincipalRule {

variables: Variables | undefined;
constants: Constants | undefined;
}

@@ -105,2 +135,22 @@ export interface RoleDef {

}
export interface ExportConstants {
name: string;
definitions: {
[key: string]: any | undefined;
};
}
export interface ExportConstants_DefinitionsEntry {
key: string;
value: any | undefined;
}
export interface Constants {
import: string[];
local: {
[key: string]: any | undefined;
};
}
export interface Constants_LocalEntry {
key: string;
value: any | undefined;
}
export interface ExportVariables {

@@ -180,2 +230,4 @@ name: string;

export declare const ResourceRule: MessageFns<ResourceRule>;
export declare const RolePolicy: MessageFns<RolePolicy>;
export declare const RoleRule: MessageFns<RoleRule>;
export declare const PrincipalPolicy: MessageFns<PrincipalPolicy>;

@@ -186,2 +238,6 @@ export declare const PrincipalRule: MessageFns<PrincipalRule>;

export declare const RoleDef: MessageFns<RoleDef>;
export declare const ExportConstants: MessageFns<ExportConstants>;
export declare const ExportConstants_DefinitionsEntry: MessageFns<ExportConstants_DefinitionsEntry>;
export declare const Constants: MessageFns<Constants>;
export declare const Constants_LocalEntry: MessageFns<Constants_LocalEntry>;
export declare const ExportVariables: MessageFns<ExportVariables>;

@@ -188,0 +244,0 @@ export declare const ExportVariables_DefinitionsEntry: MessageFns<ExportVariables_DefinitionsEntry>;

@@ -107,2 +107,3 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";

versionRegexp: string;
policyId: string[];
}

@@ -118,2 +119,9 @@ export interface GetPolicyRequest {

}
export interface InspectPoliciesRequest {
includeDisabled: boolean;
nameRegexp: string;
scopeRegexp: string;
versionRegexp: string;
policyId: string[];
}
export interface AddOrUpdateSchemaRequest {

@@ -153,2 +161,3 @@ schemas: Schema[];

export declare const EnablePolicyRequest: MessageFns<EnablePolicyRequest>;
export declare const InspectPoliciesRequest: MessageFns<InspectPoliciesRequest>;
export declare const AddOrUpdateSchemaRequest: MessageFns<AddOrUpdateSchemaRequest>;

@@ -155,0 +164,0 @@ export declare const ListSchemasRequest: MessageFns<ListSchemasRequest>;

@@ -5,3 +5,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ReloadStoreRequest = exports.DeleteSchemaRequest = exports.GetSchemaRequest = exports.ListSchemasRequest = exports.AddOrUpdateSchemaRequest = exports.EnablePolicyRequest = exports.DisablePolicyRequest = exports.GetPolicyRequest = exports.ListPoliciesRequest = exports.ServerInfoRequest = exports.ListAuditLogEntriesRequest_TimeRange = exports.ListAuditLogEntriesRequest = exports.AddOrUpdatePolicyRequest = exports.AuxData_JWT = exports.AuxData = exports.CheckResourcesRequest_ResourceEntry = exports.CheckResourcesRequest = exports.CheckResourceBatchRequest_BatchEntry = exports.CheckResourceBatchRequest = exports.AttributesMap_AttrEntry = exports.AttributesMap = exports.ResourceSet_InstancesEntry = exports.ResourceSet = exports.CheckResourceSetRequest = exports.PlanResourcesRequest = exports.ListAuditLogEntriesRequest_Kind = exports.protobufPackage = void 0;
exports.ReloadStoreRequest = exports.DeleteSchemaRequest = exports.GetSchemaRequest = exports.ListSchemasRequest = exports.AddOrUpdateSchemaRequest = exports.InspectPoliciesRequest = exports.EnablePolicyRequest = exports.DisablePolicyRequest = exports.GetPolicyRequest = exports.ListPoliciesRequest = exports.ServerInfoRequest = exports.ListAuditLogEntriesRequest_TimeRange = exports.ListAuditLogEntriesRequest = exports.AddOrUpdatePolicyRequest = exports.AuxData_JWT = exports.AuxData = exports.CheckResourcesRequest_ResourceEntry = exports.CheckResourcesRequest = exports.CheckResourceBatchRequest_BatchEntry = exports.CheckResourceBatchRequest = exports.AttributesMap_AttrEntry = exports.AttributesMap = exports.ResourceSet_InstancesEntry = exports.ResourceSet = exports.CheckResourceSetRequest = exports.PlanResourcesRequest = exports.ListAuditLogEntriesRequest_Kind = exports.protobufPackage = void 0;
/* eslint-disable */

@@ -887,2 +887,3 @@ const wire_1 = require("@bufbuild/protobuf/wire");

versionRegexp: "",
policyId: [],
};

@@ -904,2 +905,5 @@ }

}
for (const v of message.policyId) {
writer.uint32(42).string(v);
}
return writer;

@@ -942,2 +946,9 @@ },

}
case 5: {
if (tag !== 42) {
break;
}
message.policyId.push(reader.string());
continue;
}
}

@@ -1051,2 +1062,81 @@ if ((tag & 7) === 4 || tag === 0) {

};
function createBaseInspectPoliciesRequest() {
return {
includeDisabled: false,
nameRegexp: "",
scopeRegexp: "",
versionRegexp: "",
policyId: [],
};
}
exports.InspectPoliciesRequest = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.includeDisabled !== false) {
writer.uint32(8).bool(message.includeDisabled);
}
if (message.nameRegexp !== "") {
writer.uint32(18).string(message.nameRegexp);
}
if (message.scopeRegexp !== "") {
writer.uint32(26).string(message.scopeRegexp);
}
if (message.versionRegexp !== "") {
writer.uint32(34).string(message.versionRegexp);
}
for (const v of message.policyId) {
writer.uint32(42).string(v);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseInspectPoliciesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.includeDisabled = reader.bool();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.nameRegexp = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.scopeRegexp = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.versionRegexp = reader.string();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.policyId.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseAddOrUpdateSchemaRequest() {

@@ -1053,0 +1143,0 @@ return { schemas: [] };

@@ -149,2 +149,69 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";

}
export interface InspectPoliciesResponse {
results: {
[key: string]: InspectPoliciesResponse_Result;
};
}
export interface InspectPoliciesResponse_Attribute {
kind: InspectPoliciesResponse_Attribute_Kind;
name: string;
}
export declare enum InspectPoliciesResponse_Attribute_Kind {
KIND_UNSPECIFIED = 0,
KIND_PRINCIPAL_ATTRIBUTE = 1,
KIND_RESOURCE_ATTRIBUTE = 2
}
export interface InspectPoliciesResponse_DerivedRole {
name: string;
kind: InspectPoliciesResponse_DerivedRole_Kind;
source: string;
}
export declare enum InspectPoliciesResponse_DerivedRole_Kind {
KIND_UNSPECIFIED = 0,
KIND_UNDEFINED = 1,
KIND_EXPORTED = 2,
KIND_IMPORTED = 3
}
export interface InspectPoliciesResponse_Constant {
name: string;
value: any | undefined;
kind: InspectPoliciesResponse_Constant_Kind;
source: string;
used: boolean;
}
export declare enum InspectPoliciesResponse_Constant_Kind {
KIND_UNSPECIFIED = 0,
KIND_EXPORTED = 1,
KIND_IMPORTED = 2,
KIND_LOCAL = 3,
KIND_UNDEFINED = 4,
KIND_UNKNOWN = 5
}
export interface InspectPoliciesResponse_Variable {
name: string;
value: string;
kind: InspectPoliciesResponse_Variable_Kind;
source: string;
used: boolean;
}
export declare enum InspectPoliciesResponse_Variable_Kind {
KIND_UNSPECIFIED = 0,
KIND_EXPORTED = 1,
KIND_IMPORTED = 2,
KIND_LOCAL = 3,
KIND_UNDEFINED = 4,
KIND_UNKNOWN = 5
}
export interface InspectPoliciesResponse_Result {
actions: string[];
variables: InspectPoliciesResponse_Variable[];
policyId: string;
derivedRoles: InspectPoliciesResponse_DerivedRole[];
attributes: InspectPoliciesResponse_Attribute[];
constants: InspectPoliciesResponse_Constant[];
}
export interface InspectPoliciesResponse_ResultsEntry {
key: string;
value: InspectPoliciesResponse_Result | undefined;
}
export interface AddOrUpdateSchemaResponse {

@@ -191,2 +258,9 @@ }

export declare const EnablePolicyResponse: MessageFns<EnablePolicyResponse>;
export declare const InspectPoliciesResponse: MessageFns<InspectPoliciesResponse>;
export declare const InspectPoliciesResponse_Attribute: MessageFns<InspectPoliciesResponse_Attribute>;
export declare const InspectPoliciesResponse_DerivedRole: MessageFns<InspectPoliciesResponse_DerivedRole>;
export declare const InspectPoliciesResponse_Constant: MessageFns<InspectPoliciesResponse_Constant>;
export declare const InspectPoliciesResponse_Variable: MessageFns<InspectPoliciesResponse_Variable>;
export declare const InspectPoliciesResponse_Result: MessageFns<InspectPoliciesResponse_Result>;
export declare const InspectPoliciesResponse_ResultsEntry: MessageFns<InspectPoliciesResponse_ResultsEntry>;
export declare const AddOrUpdateSchemaResponse: MessageFns<AddOrUpdateSchemaResponse>;

@@ -193,0 +267,0 @@ export declare const ListSchemasResponse: MessageFns<ListSchemasResponse>;

@@ -1,4 +0,4 @@

import { type CallOptions, ChannelCredentials, Client, type ClientOptions, ClientReadableStream, type ClientUnaryCall, handleServerStreamingCall, type handleUnaryCall, Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
import { AddOrUpdatePolicyRequest, AddOrUpdateSchemaRequest, CheckResourceBatchRequest, CheckResourceSetRequest, CheckResourcesRequest, DeleteSchemaRequest, DisablePolicyRequest, EnablePolicyRequest, GetPolicyRequest, GetSchemaRequest, ListAuditLogEntriesRequest, ListPoliciesRequest, ListSchemasRequest, PlanResourcesRequest, ReloadStoreRequest, ServerInfoRequest } from "../../request/v1/request";
import { AddOrUpdatePolicyResponse, AddOrUpdateSchemaResponse, CheckResourceBatchResponse, CheckResourceSetResponse, CheckResourcesResponse, DeleteSchemaResponse, DisablePolicyResponse, EnablePolicyResponse, GetPolicyResponse, GetSchemaResponse, ListAuditLogEntriesResponse, ListPoliciesResponse, ListSchemasResponse, PlanResourcesResponse, ReloadStoreResponse, ServerInfoResponse } from "../../response/v1/response";
import { type CallOptions, ChannelCredentials, Client, type ClientOptions, type ClientReadableStream, type ClientUnaryCall, type handleServerStreamingCall, type handleUnaryCall, Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
import { AddOrUpdatePolicyRequest, AddOrUpdateSchemaRequest, CheckResourceBatchRequest, CheckResourceSetRequest, CheckResourcesRequest, DeleteSchemaRequest, DisablePolicyRequest, EnablePolicyRequest, GetPolicyRequest, GetSchemaRequest, InspectPoliciesRequest, ListAuditLogEntriesRequest, ListPoliciesRequest, ListSchemasRequest, PlanResourcesRequest, ReloadStoreRequest, ServerInfoRequest } from "../../request/v1/request";
import { AddOrUpdatePolicyResponse, AddOrUpdateSchemaResponse, CheckResourceBatchResponse, CheckResourceSetResponse, CheckResourcesResponse, DeleteSchemaResponse, DisablePolicyResponse, EnablePolicyResponse, GetPolicyResponse, GetSchemaResponse, InspectPoliciesResponse, ListAuditLogEntriesResponse, ListPoliciesResponse, ListSchemasResponse, PlanResourcesResponse, ReloadStoreResponse, ServerInfoResponse } from "../../response/v1/response";
export declare const protobufPackage = "cerbos.svc.v1";

@@ -93,2 +93,11 @@ export type CerbosServiceService = typeof CerbosServiceService;

};
readonly inspectPolicies: {
readonly path: "/cerbos.svc.v1.CerbosAdminService/InspectPolicies";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: InspectPoliciesRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => InspectPoliciesRequest;
readonly responseSerialize: (value: InspectPoliciesResponse) => Buffer;
readonly responseDeserialize: (value: Buffer) => InspectPoliciesResponse;
};
readonly listPolicies: {

@@ -187,2 +196,3 @@ readonly path: "/cerbos.svc.v1.CerbosAdminService/ListPolicies";

addOrUpdatePolicy: handleUnaryCall<AddOrUpdatePolicyRequest, AddOrUpdatePolicyResponse>;
inspectPolicies: handleUnaryCall<InspectPoliciesRequest, InspectPoliciesResponse>;
listPolicies: handleUnaryCall<ListPoliciesRequest, ListPoliciesResponse>;

@@ -203,2 +213,5 @@ getPolicy: handleUnaryCall<GetPolicyRequest, GetPolicyResponse>;

addOrUpdatePolicy(request: AddOrUpdatePolicyRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: AddOrUpdatePolicyResponse) => void): ClientUnaryCall;
inspectPolicies(request: InspectPoliciesRequest, callback: (error: ServiceError | null, response: InspectPoliciesResponse) => void): ClientUnaryCall;
inspectPolicies(request: InspectPoliciesRequest, metadata: Metadata, callback: (error: ServiceError | null, response: InspectPoliciesResponse) => void): ClientUnaryCall;
inspectPolicies(request: InspectPoliciesRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: InspectPoliciesResponse) => void): ClientUnaryCall;
listPolicies(request: ListPoliciesRequest, callback: (error: ServiceError | null, response: ListPoliciesResponse) => void): ClientUnaryCall;

@@ -205,0 +218,0 @@ listPolicies(request: ListPoliciesRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ListPoliciesResponse) => void): ClientUnaryCall;

@@ -69,2 +69,11 @@ "use strict";

},
inspectPolicies: {
path: "/cerbos.svc.v1.CerbosAdminService/InspectPolicies",
requestStream: false,
responseStream: false,
requestSerialize: (value) => Buffer.from(request_1.InspectPoliciesRequest.encode(value).finish()),
requestDeserialize: (value) => request_1.InspectPoliciesRequest.decode(value),
responseSerialize: (value) => Buffer.from(response_1.InspectPoliciesResponse.encode(value).finish()),
responseDeserialize: (value) => response_1.InspectPoliciesResponse.decode(value),
},
listPolicies: {

@@ -71,0 +80,0 @@ path: "/cerbos.svc.v1.CerbosAdminService/ListPolicies",

6

package.json
{
"name": "@cerbos/grpc",
"version": "0.18.4",
"version": "0.19.0",
"description": "Client library for interacting with the Cerbos policy decision point service over gRPC from server-side Node.js applications",

@@ -52,4 +52,4 @@ "repository": {

"dependencies": {
"@bufbuild/protobuf": "^2.2.0",
"@cerbos/core": "^0.18.1",
"@bufbuild/protobuf": "^2.2.2",
"@cerbos/core": "^0.19.0",
"@grpc/grpc-js": "^1.12.2"

@@ -56,0 +56,0 @@ },

@@ -12,2 +12,8 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.

export enum ScopePermissions {
SCOPE_PERMISSIONS_UNSPECIFIED = 0,
SCOPE_PERMISSIONS_OVERRIDE_PARENT = 1,
SCOPE_PERMISSIONS_REQUIRE_PARENTAL_CONSENT_FOR_ALLOWS = 2,
}
export interface Policy {

@@ -23,2 +29,4 @@ apiVersion: string;

| { $case: "exportVariables"; exportVariables: ExportVariables }
| { $case: "rolePolicy"; rolePolicy: RolePolicy }
| { $case: "exportConstants"; exportConstants: ExportConstants }
| undefined;

@@ -65,2 +73,4 @@ variables: { [key: string]: string };

variables: Variables | undefined;
scopePermissions: ScopePermissions;
constants: Constants | undefined;
}

@@ -78,2 +88,15 @@

export interface RolePolicy {
policyType?: { $case: "role"; role: string } | undefined;
parentRoles: string[];
scope: string;
rules: RoleRule[];
scopePermissions: ScopePermissions;
}
export interface RoleRule {
resource: string;
allowActions: string[];
}
export interface PrincipalPolicy {

@@ -85,2 +108,4 @@ principal: string;

variables: Variables | undefined;
scopePermissions: ScopePermissions;
constants: Constants | undefined;
}

@@ -105,2 +130,3 @@

variables: Variables | undefined;
constants: Constants | undefined;
}

@@ -114,2 +140,22 @@

export interface ExportConstants {
name: string;
definitions: { [key: string]: any | undefined };
}
export interface ExportConstants_DefinitionsEntry {
key: string;
value: any | undefined;
}
export interface Constants {
import: string[];
local: { [key: string]: any | undefined };
}
export interface Constants_LocalEntry {
key: string;
value: any | undefined;
}
export interface ExportVariables {

@@ -233,2 +279,14 @@ name: string;

break;
case "rolePolicy":
RolePolicy.encode(
message.policyType.rolePolicy,
writer.uint32(90).fork(),
).join();
break;
case "exportConstants":
ExportConstants.encode(
message.policyType.exportConstants,
writer.uint32(98).fork(),
).join();
break;
}

@@ -331,2 +389,24 @@ Object.entries(message.variables).forEach(([key, value]) => {

}
case 11: {
if (tag !== 90) {
break;
}
message.policyType = {
$case: "rolePolicy",
rolePolicy: RolePolicy.decode(reader, reader.uint32()),
};
continue;
}
case 12: {
if (tag !== 98) {
break;
}
message.policyType = {
$case: "exportConstants",
exportConstants: ExportConstants.decode(reader, reader.uint32()),
};
continue;
}
case 8: {

@@ -713,2 +793,4 @@ if (tag !== 66) {

variables: undefined,
scopePermissions: 0,
constants: undefined,
};

@@ -743,2 +825,8 @@ }

}
if (message.scopePermissions !== 0) {
writer.uint32(64).int32(message.scopePermissions);
}
if (message.constants !== undefined) {
Constants.encode(message.constants, writer.uint32(74).fork()).join();
}
return writer;

@@ -811,2 +899,18 @@ },

}
case 8: {
if (tag !== 64) {
break;
}
message.scopePermissions = reader.int32() as any;
continue;
}
case 9: {
if (tag !== 74) {
break;
}
message.constants = Constants.decode(reader, reader.uint32());
continue;
}
}

@@ -937,2 +1041,147 @@ if ((tag & 7) === 4 || tag === 0) {

function createBaseRolePolicy(): RolePolicy {
return {
policyType: undefined,
parentRoles: [],
scope: "",
rules: [],
scopePermissions: 0,
};
}
export const RolePolicy: MessageFns<RolePolicy> = {
encode(
message: RolePolicy,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
switch (message.policyType?.$case) {
case "role":
writer.uint32(10).string(message.policyType.role);
break;
}
for (const v of message.parentRoles) {
writer.uint32(42).string(v!);
}
if (message.scope !== "") {
writer.uint32(18).string(message.scope);
}
for (const v of message.rules) {
RoleRule.encode(v!, writer.uint32(26).fork()).join();
}
if (message.scopePermissions !== 0) {
writer.uint32(32).int32(message.scopePermissions);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): RolePolicy {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRolePolicy();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.policyType = { $case: "role", role: reader.string() };
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.parentRoles.push(reader.string());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.scope = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.rules.push(RoleRule.decode(reader, reader.uint32()));
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.scopePermissions = reader.int32() as any;
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseRoleRule(): RoleRule {
return { resource: "", allowActions: [] };
}
export const RoleRule: MessageFns<RoleRule> = {
encode(
message: RoleRule,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.resource !== "") {
writer.uint32(10).string(message.resource);
}
for (const v of message.allowActions) {
writer.uint32(18).string(v!);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): RoleRule {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRoleRule();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.resource = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.allowActions.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBasePrincipalPolicy(): PrincipalPolicy {

@@ -945,2 +1194,4 @@ return {

variables: undefined,
scopePermissions: 0,
constants: undefined,
};

@@ -969,2 +1220,8 @@ }

}
if (message.scopePermissions !== 0) {
writer.uint32(48).int32(message.scopePermissions);
}
if (message.constants !== undefined) {
Constants.encode(message.constants, writer.uint32(58).fork()).join();
}
return writer;

@@ -1021,2 +1278,18 @@ },

}
case 6: {
if (tag !== 48) {
break;
}
message.scopePermissions = reader.int32() as any;
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.constants = Constants.decode(reader, reader.uint32());
continue;
}
}

@@ -1181,3 +1454,8 @@ if ((tag & 7) === 4 || tag === 0) {

function createBaseDerivedRoles(): DerivedRoles {
return { name: "", definitions: [], variables: undefined };
return {
name: "",
definitions: [],
variables: undefined,
constants: undefined,
};
}

@@ -1199,2 +1477,5 @@

}
if (message.constants !== undefined) {
Constants.encode(message.constants, writer.uint32(34).fork()).join();
}
return writer;

@@ -1235,2 +1516,10 @@ },

}
case 4: {
if (tag !== 34) {
break;
}
message.constants = Constants.decode(reader, reader.uint32());
continue;
}
}

@@ -1309,2 +1598,239 @@ if ((tag & 7) === 4 || tag === 0) {

function createBaseExportConstants(): ExportConstants {
return { name: "", definitions: {} };
}
export const ExportConstants: MessageFns<ExportConstants> = {
encode(
message: ExportConstants,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
Object.entries(message.definitions).forEach(([key, value]) => {
if (value !== undefined) {
ExportConstants_DefinitionsEntry.encode(
{ key: key as any, value },
writer.uint32(18).fork(),
).join();
}
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ExportConstants {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseExportConstants();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.name = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
const entry2 = ExportConstants_DefinitionsEntry.decode(
reader,
reader.uint32(),
);
if (entry2.value !== undefined) {
message.definitions[entry2.key] = entry2.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseExportConstants_DefinitionsEntry(): ExportConstants_DefinitionsEntry {
return { key: "", value: undefined };
}
export const ExportConstants_DefinitionsEntry: MessageFns<ExportConstants_DefinitionsEntry> =
{
encode(
message: ExportConstants_DefinitionsEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
Value.encode(
Value.wrap(message.value),
writer.uint32(18).fork(),
).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): ExportConstants_DefinitionsEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseExportConstants_DefinitionsEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseConstants(): Constants {
return { import: [], local: {} };
}
export const Constants: MessageFns<Constants> = {
encode(
message: Constants,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
for (const v of message.import) {
writer.uint32(10).string(v!);
}
Object.entries(message.local).forEach(([key, value]) => {
if (value !== undefined) {
Constants_LocalEntry.encode(
{ key: key as any, value },
writer.uint32(18).fork(),
).join();
}
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Constants {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConstants();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.import.push(reader.string());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
const entry2 = Constants_LocalEntry.decode(reader, reader.uint32());
if (entry2.value !== undefined) {
message.local[entry2.key] = entry2.value;
}
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseConstants_LocalEntry(): Constants_LocalEntry {
return { key: "", value: undefined };
}
export const Constants_LocalEntry: MessageFns<Constants_LocalEntry> = {
encode(
message: Constants_LocalEntry,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.value !== undefined) {
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): Constants_LocalEntry {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConstants_LocalEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseExportVariables(): ExportVariables {

@@ -1311,0 +1837,0 @@ return { name: "", definitions: {} };

@@ -124,2 +124,3 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.

versionRegexp: string;
policyId: string[];
}

@@ -139,2 +140,10 @@

export interface InspectPoliciesRequest {
includeDisabled: boolean;
nameRegexp: string;
scopeRegexp: string;
versionRegexp: string;
policyId: string[];
}
export interface AddOrUpdateSchemaRequest {

@@ -1269,2 +1278,3 @@ schemas: Schema[];

versionRegexp: "",
policyId: [],
};

@@ -1290,2 +1300,5 @@ }

}
for (const v of message.policyId) {
writer.uint32(42).string(v!);
}
return writer;

@@ -1337,2 +1350,10 @@ },

}
case 5: {
if (tag !== 42) {
break;
}
message.policyId.push(reader.string());
continue;
}
}

@@ -1477,2 +1498,96 @@ if ((tag & 7) === 4 || tag === 0) {

function createBaseInspectPoliciesRequest(): InspectPoliciesRequest {
return {
includeDisabled: false,
nameRegexp: "",
scopeRegexp: "",
versionRegexp: "",
policyId: [],
};
}
export const InspectPoliciesRequest: MessageFns<InspectPoliciesRequest> = {
encode(
message: InspectPoliciesRequest,
writer: BinaryWriter = new BinaryWriter(),
): BinaryWriter {
if (message.includeDisabled !== false) {
writer.uint32(8).bool(message.includeDisabled);
}
if (message.nameRegexp !== "") {
writer.uint32(18).string(message.nameRegexp);
}
if (message.scopeRegexp !== "") {
writer.uint32(26).string(message.scopeRegexp);
}
if (message.versionRegexp !== "") {
writer.uint32(34).string(message.versionRegexp);
}
for (const v of message.policyId) {
writer.uint32(42).string(v!);
}
return writer;
},
decode(
input: BinaryReader | Uint8Array,
length?: number,
): InspectPoliciesRequest {
const reader =
input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseInspectPoliciesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.includeDisabled = reader.bool();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.nameRegexp = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.scopeRegexp = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.versionRegexp = reader.string();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.policyId.push(reader.string());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseAddOrUpdateSchemaRequest(): AddOrUpdateSchemaRequest {

@@ -1479,0 +1594,0 @@ return { schemas: [] };

@@ -10,5 +10,5 @@ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.

type ClientOptions,
ClientReadableStream,
type ClientReadableStream,
type ClientUnaryCall,
handleServerStreamingCall,
type handleServerStreamingCall,
type handleUnaryCall,

@@ -31,2 +31,3 @@ makeGenericClientConstructor,

GetSchemaRequest,
InspectPoliciesRequest,
ListAuditLogEntriesRequest,

@@ -50,2 +51,3 @@ ListPoliciesRequest,

GetSchemaResponse,
InspectPoliciesResponse,
ListAuditLogEntriesResponse,

@@ -293,2 +295,14 @@ ListPoliciesResponse,

},
inspectPolicies: {
path: "/cerbos.svc.v1.CerbosAdminService/InspectPolicies",
requestStream: false,
responseStream: false,
requestSerialize: (value: InspectPoliciesRequest) =>
Buffer.from(InspectPoliciesRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => InspectPoliciesRequest.decode(value),
responseSerialize: (value: InspectPoliciesResponse) =>
Buffer.from(InspectPoliciesResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) =>
InspectPoliciesResponse.decode(value),
},
listPolicies: {

@@ -415,2 +429,6 @@ path: "/cerbos.svc.v1.CerbosAdminService/ListPolicies",

>;
inspectPolicies: handleUnaryCall<
InspectPoliciesRequest,
InspectPoliciesResponse
>;
listPolicies: handleUnaryCall<ListPoliciesRequest, ListPoliciesResponse>;

@@ -459,2 +477,26 @@ getPolicy: handleUnaryCall<GetPolicyRequest, GetPolicyResponse>;

): ClientUnaryCall;
inspectPolicies(
request: InspectPoliciesRequest,
callback: (
error: ServiceError | null,
response: InspectPoliciesResponse,
) => void,
): ClientUnaryCall;
inspectPolicies(
request: InspectPoliciesRequest,
metadata: Metadata,
callback: (
error: ServiceError | null,
response: InspectPoliciesResponse,
) => void,
): ClientUnaryCall;
inspectPolicies(
request: InspectPoliciesRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (
error: ServiceError | null,
response: InspectPoliciesResponse,
) => void,
): ClientUnaryCall;
listPolicies(

@@ -461,0 +503,0 @@ request: ListPoliciesRequest,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc