@arcjet/protocol
Advanced tools
Comparing version 1.0.0-alpha.21 to 1.0.0-alpha.22
@@ -1,3 +0,4 @@ | ||
import { Transport } from "@connectrpc/connect"; | ||
import { ArcjetContext, ArcjetDecision, ArcjetRequestDetails, ArcjetRule, ArcjetStack } from "./index.js"; | ||
import type { Transport } from "@connectrpc/connect"; | ||
import type { ArcjetContext, ArcjetRequestDetails, ArcjetRule } from "./index.js"; | ||
import { ArcjetDecision, ArcjetStack } from "./index.js"; | ||
export interface Client { | ||
@@ -4,0 +5,0 @@ decide(context: ArcjetContext, details: Partial<ArcjetRequestDetails>, rules: ArcjetRule[]): Promise<ArcjetDecision>; |
import { createPromiseClient } from '@connectrpc/connect'; | ||
import { Timestamp } from '@bufbuild/protobuf'; | ||
import { ArcjetStackToProtocol, ArcjetRuleToProtocol, ArcjetDecisionFromProtocol, ArcjetDecisionToProtocol } from './convert.js'; | ||
import 'typeid-js'; | ||
import { DecideRequest, ReportRequest } from './proto/decide/v1alpha1/decide_pb.js'; | ||
import { DecideService } from './proto/decide/v1alpha1/decide_connect.js'; | ||
import { DecideRequest, ReportRequest } from './proto/decide/v1alpha1/decide_pb.js'; | ||
@@ -7,0 +8,0 @@ // TODO: Dedupe with `errorMessage` in core |
@@ -1,2 +0,3 @@ | ||
import { Transport, createPromiseClient } from "@connectrpc/connect"; | ||
import type { Transport } from "@connectrpc/connect"; | ||
import { createPromiseClient } from "@connectrpc/connect"; | ||
import { Timestamp } from "@bufbuild/protobuf"; | ||
@@ -9,9 +10,8 @@ import { | ||
} from "./convert.js"; | ||
import { | ||
import type { | ||
ArcjetContext, | ||
ArcjetDecision, | ||
ArcjetRequestDetails, | ||
ArcjetRule, | ||
ArcjetStack, | ||
} from "./index.js"; | ||
import { ArcjetDecision, ArcjetStack } from "./index.js"; | ||
import { DecideService } from "./proto/decide/v1alpha1/decide_connect.js"; | ||
@@ -18,0 +18,0 @@ import { |
@@ -1,3 +0,5 @@ | ||
import { ArcjetRuleResult, ArcjetBotType, ArcjetConclusion, ArcjetDecision, ArcjetEmailType, ArcjetMode, ArcjetReason, ArcjetRuleState, ArcjetStack, ArcjetRule, ArcjetRateLimitRule, ArcjetIpDetails } from "./index"; | ||
import { BotType, Conclusion, Decision, EmailType, IpDetails, Mode, Reason, Rule, RuleResult, RuleState, SDKStack } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
import type { ArcjetRule, ArcjetRateLimitRule } from "./index"; | ||
import { ArcjetRuleResult, ArcjetBotType, ArcjetConclusion, ArcjetDecision, ArcjetEmailType, ArcjetMode, ArcjetReason, ArcjetRuleState, ArcjetStack, ArcjetIpDetails } from "./index"; | ||
import type { IpDetails } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
import { BotType, Conclusion, Decision, EmailType, Mode, Reason, Rule, RuleResult, RuleState, SDKStack } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
export declare function ArcjetModeToProtocol(mode: ArcjetMode): Mode; | ||
@@ -4,0 +6,0 @@ export declare function ArcjetBotTypeToProtocol(botType: ArcjetBotType): BotType; |
import { Timestamp } from '@bufbuild/protobuf'; | ||
import { ArcjetReason, ArcjetErrorReason, ArcjetEmailReason, ArcjetShieldReason, ArcjetEdgeRuleReason, ArcjetBotReason, ArcjetRateLimitReason, ArcjetRuleResult, ArcjetIpDetails, ArcjetErrorDecision, ArcjetChallengeDecision, ArcjetDenyDecision, ArcjetAllowDecision } from './index.js'; | ||
import { Mode, BotType, EmailType, SDKStack, RuleState, Conclusion, Reason, RateLimitReason, BotReason, EdgeRuleReason, ShieldReason, EmailReason, ErrorReason, RuleResult, Decision, Rule, RateLimitAlgorithm } from './proto/decide/v1alpha1/decide_pb.js'; | ||
import { ArcjetReason, ArcjetErrorReason, ArcjetSensitiveInfoReason, ArcjetEmailReason, ArcjetShieldReason, ArcjetEdgeRuleReason, ArcjetBotReason, ArcjetRateLimitReason, ArcjetRuleResult, ArcjetIpDetails, ArcjetErrorDecision, ArcjetChallengeDecision, ArcjetDenyDecision, ArcjetAllowDecision } from './index.js'; | ||
import { Mode, BotType, EmailType, SDKStack, RuleState, Conclusion, Reason, RateLimitReason, BotReason, EdgeRuleReason, ShieldReason, EmailReason, ErrorReason, SensitiveInfoReason, RuleResult, Decision, Rule, RateLimitAlgorithm } from './proto/decide/v1alpha1/decide_pb.js'; | ||
@@ -213,2 +213,9 @@ function ArcjetModeToProtocol(mode) { | ||
} | ||
case "sensitiveInfo": { | ||
const reason = proto.reason.value; | ||
return new ArcjetSensitiveInfoReason({ | ||
allowed: reason.allowed, | ||
denied: reason.denied, | ||
}); | ||
} | ||
case "error": { | ||
@@ -299,2 +306,13 @@ const reason = proto.reason.value; | ||
} | ||
if (reason.isSensitiveInfo()) { | ||
return new Reason({ | ||
reason: { | ||
case: "sensitiveInfo", | ||
value: new SensitiveInfoReason({ | ||
allowed: reason.allowed, | ||
denied: reason.denied, | ||
}), | ||
}, | ||
}); | ||
} | ||
return new Reason(); | ||
@@ -457,2 +475,5 @@ } | ||
} | ||
function isSensitiveInfoRule(rule) { | ||
return rule.type === "SENSITIVE_INFO"; | ||
} | ||
function ArcjetRuleToProtocol(rule) { | ||
@@ -556,2 +577,13 @@ if (isTokenBucketRule(rule)) { | ||
} | ||
if (isSensitiveInfoRule(rule)) { | ||
return new Rule({ | ||
rule: { | ||
case: "sensitiveInfo", | ||
value: { | ||
allow: rule.allow, | ||
deny: rule.deny, | ||
}, | ||
}, | ||
}); | ||
} | ||
return new Rule(); | ||
@@ -558,0 +590,0 @@ } |
import { Timestamp } from "@bufbuild/protobuf"; | ||
import type { | ||
ArcjetRule, | ||
ArcjetRateLimitRule, | ||
ArcjetBotRule, | ||
ArcjetEmailRule, | ||
ArcjetTokenBucketRateLimitRule, | ||
ArcjetFixedWindowRateLimitRule, | ||
ArcjetSlidingWindowRateLimitRule, | ||
ArcjetShieldRule, | ||
ArcjetSensitiveInfoRule, | ||
} from "./index"; | ||
import { | ||
@@ -22,12 +33,6 @@ ArcjetAllowDecision, | ||
ArcjetStack, | ||
ArcjetRule, | ||
ArcjetRateLimitRule, | ||
ArcjetBotRule, | ||
ArcjetEmailRule, | ||
ArcjetTokenBucketRateLimitRule, | ||
ArcjetFixedWindowRateLimitRule, | ||
ArcjetSlidingWindowRateLimitRule, | ||
ArcjetIpDetails, | ||
ArcjetShieldRule, | ||
ArcjetSensitiveInfoReason, | ||
} from "./index"; | ||
import type { IpDetails } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
import { | ||
@@ -42,3 +47,2 @@ BotReason, | ||
ErrorReason, | ||
IpDetails, | ||
Mode, | ||
@@ -52,2 +56,3 @@ RateLimitAlgorithm, | ||
SDKStack, | ||
SensitiveInfoReason, | ||
ShieldReason, | ||
@@ -296,2 +301,9 @@ } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
} | ||
case "sensitiveInfo": { | ||
const reason = proto.reason.value; | ||
return new ArcjetSensitiveInfoReason({ | ||
allowed: reason.allowed, | ||
denied: reason.denied, | ||
}); | ||
} | ||
case "error": { | ||
@@ -389,2 +401,14 @@ const reason = proto.reason.value; | ||
if (reason.isSensitiveInfo()) { | ||
return new Reason({ | ||
reason: { | ||
case: "sensitiveInfo", | ||
value: new SensitiveInfoReason({ | ||
allowed: reason.allowed, | ||
denied: reason.denied, | ||
}), | ||
}, | ||
}); | ||
} | ||
return new Reason(); | ||
@@ -588,2 +612,8 @@ } | ||
function isSensitiveInfoRule<Props extends {}>( | ||
rule: ArcjetRule<Props>, | ||
): rule is ArcjetSensitiveInfoRule<Props> { | ||
return rule.type === "SENSITIVE_INFO"; | ||
} | ||
export function ArcjetRuleToProtocol<Props extends { [key: string]: unknown }>( | ||
@@ -695,3 +725,15 @@ rule: ArcjetRule<Props>, | ||
if (isSensitiveInfoRule(rule)) { | ||
return new Rule({ | ||
rule: { | ||
case: "sensitiveInfo", | ||
value: { | ||
allow: rule.allow, | ||
deny: rule.deny, | ||
}, | ||
}, | ||
}); | ||
} | ||
return new Rule(); | ||
} |
@@ -13,2 +13,7 @@ type RequiredProps<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>; | ||
export declare const ArcjetEmailType: ArcjetEnum<ArcjetEmailType>; | ||
export type ArcjetIdentifiedEntity = { | ||
start: number; | ||
end: number; | ||
identifiedType: string; | ||
}; | ||
export type ArcjetStack = "NODEJS" | "NEXTJS" | "BUN" | "SVELTEKIT"; | ||
@@ -20,6 +25,9 @@ export declare const ArcjetStack: ArcjetEnum<ArcjetStack>; | ||
export declare const ArcjetConclusion: ArcjetEnum<ArcjetConclusion>; | ||
export type ArcjetSensitiveInfoType = "EMAIL" | "PHONE_NUMBER" | "IP_ADDRESS" | "CREDIT_CARD_NUMBER"; | ||
export declare const ArcjetSensitiveInfoType: ArcjetEnum<ArcjetSensitiveInfoType>; | ||
export type ArcjetRuleType = "LOCAL" | "REMOTE"; | ||
export declare const ArcjetRuleType: ArcjetEnum<ArcjetRuleType>; | ||
export declare class ArcjetReason { | ||
type?: "RATE_LIMIT" | "BOT" | "EDGE_RULE" | "SHIELD" | "EMAIL" | "ERROR"; | ||
type?: "RATE_LIMIT" | "BOT" | "EDGE_RULE" | "SHIELD" | "EMAIL" | "ERROR" | "SENSITIVE_INFO"; | ||
isSensitiveInfo(): this is ArcjetSensitiveInfoReason; | ||
isRateLimit(): this is ArcjetRateLimitReason; | ||
@@ -32,2 +40,11 @@ isBot(): this is ArcjetBotReason; | ||
} | ||
export declare class ArcjetSensitiveInfoReason extends ArcjetReason { | ||
type: "SENSITIVE_INFO"; | ||
denied: ArcjetIdentifiedEntity[]; | ||
allowed: ArcjetIdentifiedEntity[]; | ||
constructor(init: { | ||
denied: ArcjetIdentifiedEntity[]; | ||
allowed: ArcjetIdentifiedEntity[]; | ||
}); | ||
} | ||
export declare class ArcjetRateLimitReason extends ArcjetReason { | ||
@@ -336,3 +353,3 @@ type: "RATE_LIMIT"; | ||
export type ArcjetRule<Props extends {} = {}> = { | ||
type: "RATE_LIMIT" | "BOT" | "EMAIL" | "SHIELD" | string; | ||
type: "RATE_LIMIT" | "BOT" | "EMAIL" | "SHIELD" | "SENSITIVE_INFO" | string; | ||
mode: ArcjetMode; | ||
@@ -379,2 +396,7 @@ priority: number; | ||
} | ||
export interface ArcjetSensitiveInfoRule<Props extends {}> extends ArcjetLocalRule<Props> { | ||
type: "SENSITIVE_INFO"; | ||
allow: string[]; | ||
deny: string[]; | ||
} | ||
export interface ArcjetBotRule<Props extends {}> extends ArcjetLocalRule<Props> { | ||
@@ -408,3 +430,4 @@ type: "BOT"; | ||
characteristics: string[]; | ||
getBody: () => Promise<string | undefined>; | ||
}; | ||
export {}; |
21
index.js
@@ -45,2 +45,8 @@ import { typeid } from 'typeid-js'; | ||
}); | ||
const ArcjetSensitiveInfoType = { | ||
EMAIL: "EMAIL", | ||
PHONE_NUMBER: "PHONE_NUMBER", | ||
IP_ADDRESS: "IP_ADDRESS", | ||
CREDIT_CARD_NUMBER: "CREDIT_CARD_NUMBER", | ||
}; | ||
const ArcjetRuleType = Object.freeze({ | ||
@@ -52,2 +58,5 @@ LOCAL: "LOCAL", | ||
type; | ||
isSensitiveInfo() { | ||
return this.type === "SENSITIVE_INFO"; | ||
} | ||
isRateLimit() { | ||
@@ -72,2 +81,12 @@ return this.type === "RATE_LIMIT"; | ||
} | ||
class ArcjetSensitiveInfoReason extends ArcjetReason { | ||
type = "SENSITIVE_INFO"; | ||
denied; | ||
allowed; | ||
constructor(init) { | ||
super(); | ||
this.denied = init.denied; | ||
this.allowed = init.allowed; | ||
} | ||
} | ||
class ArcjetRateLimitReason extends ArcjetReason { | ||
@@ -472,2 +491,2 @@ type = "RATE_LIMIT"; | ||
export { ArcjetAllowDecision, ArcjetBotReason, ArcjetBotType, ArcjetChallengeDecision, ArcjetConclusion, ArcjetDecision, ArcjetDenyDecision, ArcjetEdgeRuleReason, ArcjetEmailReason, ArcjetEmailType, ArcjetErrorDecision, ArcjetErrorReason, ArcjetIpDetails, ArcjetMode, ArcjetRateLimitAlgorithm, ArcjetRateLimitReason, ArcjetReason, ArcjetRuleResult, ArcjetRuleState, ArcjetRuleType, ArcjetShieldReason, ArcjetStack }; | ||
export { ArcjetAllowDecision, ArcjetBotReason, ArcjetBotType, ArcjetChallengeDecision, ArcjetConclusion, ArcjetDecision, ArcjetDenyDecision, ArcjetEdgeRuleReason, ArcjetEmailReason, ArcjetEmailType, ArcjetErrorDecision, ArcjetErrorReason, ArcjetIpDetails, ArcjetMode, ArcjetRateLimitAlgorithm, ArcjetRateLimitReason, ArcjetReason, ArcjetRuleResult, ArcjetRuleState, ArcjetRuleType, ArcjetSensitiveInfoReason, ArcjetSensitiveInfoType, ArcjetShieldReason, ArcjetStack }; |
59
index.ts
@@ -53,2 +53,8 @@ import { typeid } from "typeid-js"; | ||
export type ArcjetIdentifiedEntity = { | ||
start: number; | ||
end: number; | ||
identifiedType: string; | ||
}; | ||
export type ArcjetStack = "NODEJS" | "NEXTJS" | "BUN" | "SVELTEKIT"; | ||
@@ -78,2 +84,14 @@ export const ArcjetStack: ArcjetEnum<ArcjetStack> = { | ||
export type ArcjetSensitiveInfoType = | ||
| "EMAIL" | ||
| "PHONE_NUMBER" | ||
| "IP_ADDRESS" | ||
| "CREDIT_CARD_NUMBER"; | ||
export const ArcjetSensitiveInfoType: ArcjetEnum<ArcjetSensitiveInfoType> = { | ||
EMAIL: "EMAIL", | ||
PHONE_NUMBER: "PHONE_NUMBER", | ||
IP_ADDRESS: "IP_ADDRESS", | ||
CREDIT_CARD_NUMBER: "CREDIT_CARD_NUMBER", | ||
}; | ||
export type ArcjetRuleType = "LOCAL" | "REMOTE"; | ||
@@ -86,4 +104,15 @@ export const ArcjetRuleType: ArcjetEnum<ArcjetRuleType> = Object.freeze({ | ||
export class ArcjetReason { | ||
type?: "RATE_LIMIT" | "BOT" | "EDGE_RULE" | "SHIELD" | "EMAIL" | "ERROR"; | ||
type?: | ||
| "RATE_LIMIT" | ||
| "BOT" | ||
| "EDGE_RULE" | ||
| "SHIELD" | ||
| "EMAIL" | ||
| "ERROR" | ||
| "SENSITIVE_INFO"; | ||
isSensitiveInfo(): this is ArcjetSensitiveInfoReason { | ||
return this.type === "SENSITIVE_INFO"; | ||
} | ||
isRateLimit(): this is ArcjetRateLimitReason { | ||
@@ -114,2 +143,19 @@ return this.type === "RATE_LIMIT"; | ||
export class ArcjetSensitiveInfoReason extends ArcjetReason { | ||
type = "SENSITIVE_INFO" as const; | ||
denied: ArcjetIdentifiedEntity[]; | ||
allowed: ArcjetIdentifiedEntity[]; | ||
constructor(init: { | ||
denied: ArcjetIdentifiedEntity[]; | ||
allowed: ArcjetIdentifiedEntity[]; | ||
}) { | ||
super(); | ||
this.denied = init.denied; | ||
this.allowed = init.allowed; | ||
} | ||
} | ||
export class ArcjetRateLimitReason extends ArcjetReason { | ||
@@ -672,3 +718,3 @@ type = "RATE_LIMIT" as const; | ||
export type ArcjetRule<Props extends {} = {}> = { | ||
type: "RATE_LIMIT" | "BOT" | "EMAIL" | "SHIELD" | string; | ||
type: "RATE_LIMIT" | "BOT" | "EMAIL" | "SHIELD" | "SENSITIVE_INFO" | string; | ||
mode: ArcjetMode; | ||
@@ -737,2 +783,10 @@ priority: number; | ||
export interface ArcjetSensitiveInfoRule<Props extends {}> | ||
extends ArcjetLocalRule<Props> { | ||
type: "SENSITIVE_INFO"; | ||
allow: string[]; | ||
deny: string[]; | ||
} | ||
export interface ArcjetBotRule<Props extends {}> | ||
@@ -774,2 +828,3 @@ extends ArcjetLocalRule<Props> { | ||
characteristics: string[]; | ||
getBody: () => Promise<string | undefined>; | ||
}; |
{ | ||
"name": "@arcjet/protocol", | ||
"version": "1.0.0-alpha.21", | ||
"version": "1.0.0-alpha.22", | ||
"description": "The TypeScript & JavaScript interface into the Arcjet protocol", | ||
@@ -49,7 +49,7 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@arcjet/eslint-config": "1.0.0-alpha.21", | ||
"@arcjet/rollup-config": "1.0.0-alpha.21", | ||
"@arcjet/tsconfig": "1.0.0-alpha.21", | ||
"@arcjet/eslint-config": "1.0.0-alpha.22", | ||
"@arcjet/rollup-config": "1.0.0-alpha.22", | ||
"@arcjet/tsconfig": "1.0.0-alpha.22", | ||
"@jest/globals": "29.7.0", | ||
"@rollup/wasm-node": "4.20.0", | ||
"@rollup/wasm-node": "4.21.0", | ||
"@types/node": "18.18.0", | ||
@@ -56,0 +56,0 @@ "jest": "29.7.0", |
@@ -585,2 +585,11 @@ // @generated by protoc-gen-es v1.10.0 | ||
case: "error"; | ||
} | { | ||
/** | ||
* Contains details about sensitive info identified in the body of the | ||
* request if the sensitive info rule is configured. | ||
* | ||
* @generated from field: proto.decide.v1alpha1.SensitiveInfoReason sensitive_info = 7; | ||
*/ | ||
value: SensitiveInfoReason; | ||
case: "sensitiveInfo"; | ||
} | { case: undefined; value?: undefined }; | ||
@@ -867,2 +876,77 @@ | ||
/** | ||
* @generated from message proto.decide.v1alpha1.IdentifiedEntity | ||
*/ | ||
export declare class IdentifiedEntity extends Message<IdentifiedEntity> { | ||
/** | ||
* The type of entity that was identified | ||
* | ||
* @generated from field: string identified_type = 1; | ||
*/ | ||
identifiedType: string; | ||
/** | ||
* The start index of the entity in the body. | ||
* | ||
* @generated from field: uint32 start = 2; | ||
*/ | ||
start: number; | ||
/** | ||
* The end index of the entity in the body. | ||
* | ||
* @generated from field: uint32 end = 3; | ||
*/ | ||
end: number; | ||
constructor(data?: PartialMessage<IdentifiedEntity>); | ||
static readonly runtime: typeof proto3; | ||
static readonly typeName = "proto.decide.v1alpha1.IdentifiedEntity"; | ||
static readonly fields: FieldList; | ||
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): IdentifiedEntity; | ||
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): IdentifiedEntity; | ||
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): IdentifiedEntity; | ||
static equals(a: IdentifiedEntity | PlainMessage<IdentifiedEntity> | undefined, b: IdentifiedEntity | PlainMessage<IdentifiedEntity> | undefined): boolean; | ||
} | ||
/** | ||
* Details of a sensitive info reason. | ||
* | ||
* @generated from message proto.decide.v1alpha1.SensitiveInfoReason | ||
*/ | ||
export declare class SensitiveInfoReason extends Message<SensitiveInfoReason> { | ||
/** | ||
* The allowed sensitive info types | ||
* | ||
* @generated from field: repeated proto.decide.v1alpha1.IdentifiedEntity allowed = 1; | ||
*/ | ||
allowed: IdentifiedEntity[]; | ||
/** | ||
* The denied sensitive info types | ||
* | ||
* @generated from field: repeated proto.decide.v1alpha1.IdentifiedEntity denied = 2; | ||
*/ | ||
denied: IdentifiedEntity[]; | ||
constructor(data?: PartialMessage<SensitiveInfoReason>); | ||
static readonly runtime: typeof proto3; | ||
static readonly typeName = "proto.decide.v1alpha1.SensitiveInfoReason"; | ||
static readonly fields: FieldList; | ||
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SensitiveInfoReason; | ||
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SensitiveInfoReason; | ||
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SensitiveInfoReason; | ||
static equals(a: SensitiveInfoReason | PlainMessage<SensitiveInfoReason> | undefined, b: SensitiveInfoReason | PlainMessage<SensitiveInfoReason> | undefined): boolean; | ||
} | ||
/** | ||
* The configuration for a rate limit rule. | ||
@@ -1112,2 +1196,40 @@ * | ||
/** | ||
* The configuration for a detect sensitive info rule. | ||
* | ||
* @generated from message proto.decide.v1alpha1.SensitiveInfoRule | ||
*/ | ||
export declare class SensitiveInfoRule extends Message<SensitiveInfoRule> { | ||
/** | ||
* @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
*/ | ||
mode: Mode; | ||
/** | ||
* The sensitive info types to allow and deny. | ||
* | ||
* @generated from field: repeated string allow = 2; | ||
*/ | ||
allow: string[]; | ||
/** | ||
* @generated from field: repeated string deny = 3; | ||
*/ | ||
deny: string[]; | ||
constructor(data?: PartialMessage<SensitiveInfoRule>); | ||
static readonly runtime: typeof proto3; | ||
static readonly typeName = "proto.decide.v1alpha1.SensitiveInfoRule"; | ||
static readonly fields: FieldList; | ||
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SensitiveInfoRule; | ||
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SensitiveInfoRule; | ||
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SensitiveInfoRule; | ||
static equals(a: SensitiveInfoRule | PlainMessage<SensitiveInfoRule> | undefined, b: SensitiveInfoRule | PlainMessage<SensitiveInfoRule> | undefined): boolean; | ||
} | ||
/** | ||
* The configuration for a shield rule. | ||
@@ -1176,2 +1298,8 @@ * | ||
case: "shield"; | ||
} | { | ||
/** | ||
* @generated from field: proto.decide.v1alpha1.SensitiveInfoRule sensitive_info = 5; | ||
*/ | ||
value: SensitiveInfoRule; | ||
case: "sensitiveInfo"; | ||
} | { case: undefined; value?: undefined }; | ||
@@ -1178,0 +1306,0 @@ |
@@ -177,2 +177,3 @@ // @generated by protoc-gen-es v1.10.0 | ||
{ no: 6, name: "error", kind: "message", T: ErrorReason, oneof: "reason" }, | ||
{ no: 7, name: "sensitive_info", kind: "message", T: SensitiveInfoReason, oneof: "reason" }, | ||
], | ||
@@ -265,2 +266,27 @@ ); | ||
/** | ||
* @generated from message proto.decide.v1alpha1.IdentifiedEntity | ||
*/ | ||
export const IdentifiedEntity = /*@__PURE__*/ proto3.makeMessageType( | ||
"proto.decide.v1alpha1.IdentifiedEntity", | ||
() => [ | ||
{ no: 1, name: "identified_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, | ||
{ no: 2, name: "start", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, | ||
{ no: 3, name: "end", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, | ||
], | ||
); | ||
/** | ||
* Details of a sensitive info reason. | ||
* | ||
* @generated from message proto.decide.v1alpha1.SensitiveInfoReason | ||
*/ | ||
export const SensitiveInfoReason = /*@__PURE__*/ proto3.makeMessageType( | ||
"proto.decide.v1alpha1.SensitiveInfoReason", | ||
() => [ | ||
{ no: 1, name: "allowed", kind: "message", T: IdentifiedEntity, repeated: true }, | ||
{ no: 2, name: "denied", kind: "message", T: IdentifiedEntity, repeated: true }, | ||
], | ||
); | ||
/** | ||
* The configuration for a rate limit rule. | ||
@@ -329,2 +355,16 @@ * | ||
/** | ||
* The configuration for a detect sensitive info rule. | ||
* | ||
* @generated from message proto.decide.v1alpha1.SensitiveInfoRule | ||
*/ | ||
export const SensitiveInfoRule = /*@__PURE__*/ proto3.makeMessageType( | ||
"proto.decide.v1alpha1.SensitiveInfoRule", | ||
() => [ | ||
{ no: 1, name: "mode", kind: "enum", T: proto3.getEnumType(Mode) }, | ||
{ no: 2, name: "allow", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, | ||
{ no: 3, name: "deny", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, | ||
], | ||
); | ||
/** | ||
* The configuration for a shield rule. | ||
@@ -354,2 +394,3 @@ * | ||
{ no: 4, name: "shield", kind: "message", T: ShieldRule, oneof: "rule" }, | ||
{ no: 5, name: "sensitive_info", kind: "message", T: SensitiveInfoRule, oneof: "rule" }, | ||
], | ||
@@ -356,0 +397,0 @@ ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
187030
5170