diff --git a/Makefile b/Makefile index 464ecf64..75e4bd72 100644 --- a/Makefile +++ b/Makefile @@ -46,3 +46,14 @@ format license-check lint test: ci doc: cd lib && npm run doc + +toolcheck: + @echo "Checking for required tools..." + @which buf > /dev/null || (echo "buf not found, please install it from https://docs.buf.build/installation" && exit 1) + @which protoc-gen-grpc-gateway-ts > /dev/null || (echo "protoc-gen-grpc-gateway-ts not found, run 'go install github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts@v1.1.2'" && exit 1) + @golangci-lint --version | grep "version v\?1.5[67]" > /dev/null || (echo "golangci-lint version must be v1.55 [$$(golangci-lint --version)]" && exit 1) + +proto-generate: + rm -rf lib/gen + npx buf generate --template lib/buf.gen.yaml https://github.com/opentdf/platform.git\#branch\=main,subdir\=service --output lib + \ No newline at end of file diff --git a/README.md b/README.md index 4dc3fde4..4c35f282 100644 --- a/README.md +++ b/README.md @@ -58,3 +58,13 @@ nvm use make test make start ``` + +### Generation + +Our native gRPC service functions are generated from `proto` definitions in the [platform](https://github.com/opentdf/platform) repo using [Buf](https://buf.build/docs/introduction). + +The `Makefile` provides command scripts to invoke `Buf` with the `buf.gen.yaml` config. + +For convenience, the `make toolcheck` script checks if you have the necessary dependencies for the proto generation. + +Once this script passes, you can generate the gRPC service functions by running `make proto-generate`. \ No newline at end of file diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 17ef53d6..b086c1d3 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -8,6 +8,7 @@ overrides: - '*.spec.ts' rules: '@typescript-eslint/ban-ts-comment': 'off' +ignores: ['lib/proto/**/*.ts'] parserOptions: project: ['**/tsconfig.json'] root: true diff --git a/lib/buf.gen.yaml b/lib/buf.gen.yaml new file mode 100644 index 00000000..63319212 --- /dev/null +++ b/lib/buf.gen.yaml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - plugin: es + opt: target=ts + out: gen + - plugin: connect-es + opt: target=ts + out: gen \ No newline at end of file diff --git a/lib/gen/authorization/authorization_connect.ts b/lib/gen/authorization/authorization_connect.ts new file mode 100644 index 00000000..eb682174 --- /dev/null +++ b/lib/gen/authorization/authorization_connect.ts @@ -0,0 +1,35 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file authorization/authorization.proto (package authorization, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { GetDecisionsRequest, GetDecisionsResponse, GetEntitlementsRequest, GetEntitlementsResponse } from "./authorization_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service authorization.AuthorizationService + */ +export const AuthorizationService = { + typeName: "authorization.AuthorizationService", + methods: { + /** + * @generated from rpc authorization.AuthorizationService.GetDecisions + */ + getDecisions: { + name: "GetDecisions", + I: GetDecisionsRequest, + O: GetDecisionsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc authorization.AuthorizationService.GetEntitlements + */ + getEntitlements: { + name: "GetEntitlements", + I: GetEntitlementsRequest, + O: GetEntitlementsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/authorization/authorization_pb.ts b/lib/gen/authorization/authorization_pb.ts new file mode 100644 index 00000000..5ed12dca --- /dev/null +++ b/lib/gen/authorization/authorization_pb.ts @@ -0,0 +1,707 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file authorization/authorization.proto (package authorization, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Any, Message, proto3 } from "@bufbuild/protobuf"; +import { Action } from "../policy/objects_pb.js"; + +/** + * PE (Person Entity) or NPE (Non-Person Entity) + * + * @generated from message authorization.Entity + */ +export class Entity extends Message { + /** + * ephemeral id for tracking between request and response + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Standard entity types supported by the platform + * + * @generated from oneof authorization.Entity.entity_type + */ + entityType: { + /** + * @generated from field: string email_address = 2; + */ + value: string; + case: "emailAddress"; + } | { + /** + * @generated from field: string user_name = 3; + */ + value: string; + case: "userName"; + } | { + /** + * @generated from field: string remote_claims_url = 4; + */ + value: string; + case: "remoteClaimsUrl"; + } | { + /** + * @generated from field: string jwt = 5; + */ + value: string; + case: "jwt"; + } | { + /** + * @generated from field: google.protobuf.Any claims = 6; + */ + value: Any; + case: "claims"; + } | { + /** + * @generated from field: authorization.EntityCustom custom = 7; + */ + value: EntityCustom; + case: "custom"; + } | { + /** + * @generated from field: string client_id = 8; + */ + value: string; + case: "clientId"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.Entity"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "email_address", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "entity_type" }, + { no: 3, name: "user_name", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "entity_type" }, + { no: 4, name: "remote_claims_url", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "entity_type" }, + { no: 5, name: "jwt", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "entity_type" }, + { no: 6, name: "claims", kind: "message", T: Any, oneof: "entity_type" }, + { no: 7, name: "custom", kind: "message", T: EntityCustom, oneof: "entity_type" }, + { no: 8, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "entity_type" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Entity { + return new Entity().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Entity { + return new Entity().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Entity { + return new Entity().fromJsonString(jsonString, options); + } + + static equals(a: Entity | PlainMessage | undefined, b: Entity | PlainMessage | undefined): boolean { + return proto3.util.equals(Entity, a, b); + } +} + +/** + * Entity type for custom entities beyond the standard types + * + * @generated from message authorization.EntityCustom + */ +export class EntityCustom extends Message { + /** + * @generated from field: google.protobuf.Any extension = 1; + */ + extension?: Any; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.EntityCustom"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "extension", kind: "message", T: Any }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EntityCustom { + return new EntityCustom().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EntityCustom { + return new EntityCustom().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EntityCustom { + return new EntityCustom().fromJsonString(jsonString, options); + } + + static equals(a: EntityCustom | PlainMessage | undefined, b: EntityCustom | PlainMessage | undefined): boolean { + return proto3.util.equals(EntityCustom, a, b); + } +} + +/** + * A set of related PE and NPE + * + * @generated from message authorization.EntityChain + */ +export class EntityChain extends Message { + /** + * ephemeral id for tracking between request and response + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: repeated authorization.Entity entities = 2; + */ + entities: Entity[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.EntityChain"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "entities", kind: "message", T: Entity, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EntityChain { + return new EntityChain().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EntityChain { + return new EntityChain().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EntityChain { + return new EntityChain().fromJsonString(jsonString, options); + } + + static equals(a: EntityChain | PlainMessage | undefined, b: EntityChain | PlainMessage | undefined): boolean { + return proto3.util.equals(EntityChain, a, b); + } +} + +/** + * + * Example Request Get Decisions to answer the question - Do Bob (represented by entity chain ec1) + * and Alice (represented by entity chain ec2) have TRANSMIT authorization for + * 2 resources; resource1 (attr-set-1) defined by attributes foo:bar resource2 (attr-set-2) defined by attribute foo:bar, color:red ? + * + * { + * "actions": [ + * { + * "standard": "STANDARD_ACTION_TRANSMIT" + * } + * ], + * "entityChains": [ + * { + * "id": "ec1", + * "entities": [ + * { + * "emailAddress": "bob@example.org" + * } + * ] + * }, + * { + * "id": "ec2", + * "entities": [ + * { + * "userName": "alice@example.org" + * } + * ] + * } + * ], + * "resourceAttributes": [ + * { + * "attributeFqns": [ + * "https://www.example.org/attr/foo/value/value1" + * ] + * }, + * { + * "attributeFqns": [ + * "https://example.net/attr/attr1/value/value1", + * "https://example.net/attr/attr1/value/value2" + * ] + * } + * ] + * } + * + * + * @generated from message authorization.DecisionRequest + */ +export class DecisionRequest extends Message { + /** + * @generated from field: repeated policy.Action actions = 1; + */ + actions: Action[] = []; + + /** + * @generated from field: repeated authorization.EntityChain entity_chains = 2; + */ + entityChains: EntityChain[] = []; + + /** + * @generated from field: repeated authorization.ResourceAttribute resource_attributes = 3; + */ + resourceAttributes: ResourceAttribute[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.DecisionRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "actions", kind: "message", T: Action, repeated: true }, + { no: 2, name: "entity_chains", kind: "message", T: EntityChain, repeated: true }, + { no: 3, name: "resource_attributes", kind: "message", T: ResourceAttribute, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DecisionRequest { + return new DecisionRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DecisionRequest { + return new DecisionRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DecisionRequest { + return new DecisionRequest().fromJsonString(jsonString, options); + } + + static equals(a: DecisionRequest | PlainMessage | undefined, b: DecisionRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DecisionRequest, a, b); + } +} + +/** + * + * + * Example response for a Decision Request - Do Bob (represented by entity chain ec1) + * and Alice (represented by entity chain ec2) have TRANSMIT authorization for + * 2 resources; resource1 (attr-set-1) defined by attributes foo:bar resource2 (attr-set-2) defined by attribute foo:bar, color:red ? + * + * Results: + * - bob has permitted authorization to transmit for a resource defined by attr-set-1 attributes and has a watermark obligation + * - bob has denied authorization to transmit a for a resource defined by attr-set-2 attributes + * - alice has permitted authorization to transmit for a resource defined by attr-set-1 attributes + * - alice has denied authorization to transmit a for a resource defined by attr-set-2 attributes + * + * { + * "entityChainId": "ec1", + * "resourceAttributesId": "attr-set-1", + * "decision": "DECISION_PERMIT", + * "obligations": [ + * "http://www.example.org/obligation/watermark" + * ] + * }, + * { + * "entityChainId": "ec1", + * "resourceAttributesId": "attr-set-2", + * "decision": "DECISION_PERMIT" + * }, + * { + * "entityChainId": "ec2", + * "resourceAttributesId": "attr-set-1", + * "decision": "DECISION_PERMIT" + * }, + * { + * "entityChainId": "ec2", + * "resourceAttributesId": "attr-set-2", + * "decision": "DECISION_DENY" + * } + * + * + * + * @generated from message authorization.DecisionResponse + */ +export class DecisionResponse extends Message { + /** + * ephemeral entity chain id from the request + * + * @generated from field: string entity_chain_id = 1; + */ + entityChainId = ""; + + /** + * ephemeral resource attributes id from the request + * + * @generated from field: string resource_attributes_id = 2; + */ + resourceAttributesId = ""; + + /** + * Action of the decision response + * + * @generated from field: policy.Action action = 3; + */ + action?: Action; + + /** + * The decision response + * + * @generated from field: authorization.DecisionResponse.Decision decision = 4; + */ + decision = DecisionResponse_Decision.UNSPECIFIED; + + /** + * optional list of obligations represented in URI format + * + * @generated from field: repeated string obligations = 5; + */ + obligations: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.DecisionResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entity_chain_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "resource_attributes_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "action", kind: "message", T: Action }, + { no: 4, name: "decision", kind: "enum", T: proto3.getEnumType(DecisionResponse_Decision) }, + { no: 5, name: "obligations", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DecisionResponse { + return new DecisionResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DecisionResponse { + return new DecisionResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DecisionResponse { + return new DecisionResponse().fromJsonString(jsonString, options); + } + + static equals(a: DecisionResponse | PlainMessage | undefined, b: DecisionResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DecisionResponse, a, b); + } +} + +/** + * @generated from enum authorization.DecisionResponse.Decision + */ +export enum DecisionResponse_Decision { + /** + * @generated from enum value: DECISION_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: DECISION_DENY = 1; + */ + DENY = 1, + + /** + * @generated from enum value: DECISION_PERMIT = 2; + */ + PERMIT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(DecisionResponse_Decision) +proto3.util.setEnumType(DecisionResponse_Decision, "authorization.DecisionResponse.Decision", [ + { no: 0, name: "DECISION_UNSPECIFIED" }, + { no: 1, name: "DECISION_DENY" }, + { no: 2, name: "DECISION_PERMIT" }, +]); + +/** + * @generated from message authorization.GetDecisionsRequest + */ +export class GetDecisionsRequest extends Message { + /** + * @generated from field: repeated authorization.DecisionRequest decision_requests = 1; + */ + decisionRequests: DecisionRequest[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.GetDecisionsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "decision_requests", kind: "message", T: DecisionRequest, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDecisionsRequest { + return new GetDecisionsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDecisionsRequest { + return new GetDecisionsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDecisionsRequest { + return new GetDecisionsRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetDecisionsRequest | PlainMessage | undefined, b: GetDecisionsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDecisionsRequest, a, b); + } +} + +/** + * @generated from message authorization.GetDecisionsResponse + */ +export class GetDecisionsResponse extends Message { + /** + * @generated from field: repeated authorization.DecisionResponse decision_responses = 1; + */ + decisionResponses: DecisionResponse[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.GetDecisionsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "decision_responses", kind: "message", T: DecisionResponse, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDecisionsResponse { + return new GetDecisionsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDecisionsResponse { + return new GetDecisionsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDecisionsResponse { + return new GetDecisionsResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetDecisionsResponse | PlainMessage | undefined, b: GetDecisionsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDecisionsResponse, a, b); + } +} + +/** + * + * Request to get entitlements for one or more entities for an optional attribute scope + * + * Example: Get entitlements for bob and alice (both represented using an email address + * + * { + * "entities": [ + * { + * "id": "e1", + * "emailAddress": "bob@example.org" + * }, + * { + * "id": "e2", + * "emailAddress": "alice@example.org" + * } + * ] + * } + * + * + * @generated from message authorization.GetEntitlementsRequest + */ +export class GetEntitlementsRequest extends Message { + /** + * list of requested entities + * + * @generated from field: repeated authorization.Entity entities = 1; + */ + entities: Entity[] = []; + + /** + * optional attribute fqn as a scope + * + * @generated from field: optional authorization.ResourceAttribute scope = 2; + */ + scope?: ResourceAttribute; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.GetEntitlementsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entities", kind: "message", T: Entity, repeated: true }, + { no: 2, name: "scope", kind: "message", T: ResourceAttribute, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetEntitlementsRequest { + return new GetEntitlementsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetEntitlementsRequest { + return new GetEntitlementsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetEntitlementsRequest { + return new GetEntitlementsRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetEntitlementsRequest | PlainMessage | undefined, b: GetEntitlementsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetEntitlementsRequest, a, b); + } +} + +/** + * @generated from message authorization.EntityEntitlements + */ +export class EntityEntitlements extends Message { + /** + * @generated from field: string entity_id = 1; + */ + entityId = ""; + + /** + * @generated from field: repeated string attribute_value_fqns = 2; + */ + attributeValueFqns: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.EntityEntitlements"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entity_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "attribute_value_fqns", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EntityEntitlements { + return new EntityEntitlements().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EntityEntitlements { + return new EntityEntitlements().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EntityEntitlements { + return new EntityEntitlements().fromJsonString(jsonString, options); + } + + static equals(a: EntityEntitlements | PlainMessage | undefined, b: EntityEntitlements | PlainMessage | undefined): boolean { + return proto3.util.equals(EntityEntitlements, a, b); + } +} + +/** + * A logical bucket of attributes belonging to a "Resource" + * + * @generated from message authorization.ResourceAttribute + */ +export class ResourceAttribute extends Message { + /** + * @generated from field: repeated string attribute_value_fqns = 2; + */ + attributeValueFqns: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.ResourceAttribute"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 2, name: "attribute_value_fqns", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResourceAttribute { + return new ResourceAttribute().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResourceAttribute { + return new ResourceAttribute().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResourceAttribute { + return new ResourceAttribute().fromJsonString(jsonString, options); + } + + static equals(a: ResourceAttribute | PlainMessage | undefined, b: ResourceAttribute | PlainMessage | undefined): boolean { + return proto3.util.equals(ResourceAttribute, a, b); + } +} + +/** + * + * + * Example Response for a request of : Get entitlements for bob and alice (both represented using an email address + * + * { + * "entitlements": [ + * { + * "entityId": "e1", + * "attributeValueReferences": [ + * { + * "attributeFqn": "http://www.example.org/attr/foo/value/bar" + * } + * ] + * }, + * { + * "entityId": "e2", + * "attributeValueReferences": [ + * { + * "attributeFqn": "http://www.example.org/attr/color/value/red" + * } + * ] + * } + * ] + * } + * + * + * + * @generated from message authorization.GetEntitlementsResponse + */ +export class GetEntitlementsResponse extends Message { + /** + * @generated from field: repeated authorization.EntityEntitlements entitlements = 1; + */ + entitlements: EntityEntitlements[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.GetEntitlementsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entitlements", kind: "message", T: EntityEntitlements, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetEntitlementsResponse { + return new GetEntitlementsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetEntitlementsResponse { + return new GetEntitlementsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetEntitlementsResponse { + return new GetEntitlementsResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetEntitlementsResponse | PlainMessage | undefined, b: GetEntitlementsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetEntitlementsResponse, a, b); + } +} + diff --git a/lib/gen/authorization/idp_plugin_pb.ts b/lib/gen/authorization/idp_plugin_pb.ts new file mode 100644 index 00000000..139b4faa --- /dev/null +++ b/lib/gen/authorization/idp_plugin_pb.ts @@ -0,0 +1,252 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file authorization/idp_plugin.proto (package authorization, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Any, Message, proto3, Struct } from "@bufbuild/protobuf"; +import { Entity } from "./authorization_pb.js"; + +/** + * @generated from message authorization.IdpConfig + */ +export class IdpConfig extends Message { + /** + * @generated from field: google.protobuf.Struct config = 1; + */ + config?: Struct; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.IdpConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "config", kind: "message", T: Struct }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IdpConfig { + return new IdpConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IdpConfig { + return new IdpConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IdpConfig { + return new IdpConfig().fromJsonString(jsonString, options); + } + + static equals(a: IdpConfig | PlainMessage | undefined, b: IdpConfig | PlainMessage | undefined): boolean { + return proto3.util.equals(IdpConfig, a, b); + } +} + +/** + * + * Example: Get idp attributes for bob and alice (both represented using an email address + * { + * "entities": [ + * { + * "id": "e1", + * "emailAddress": "bob@example.org" + * }, + * { + * "id": "e2", + * "emailAddress": "alice@example.org" + * } + * ] + * } + * + * + * @generated from message authorization.IdpPluginRequest + */ +export class IdpPluginRequest extends Message { + /** + * @generated from field: repeated authorization.Entity entities = 1; + */ + entities: Entity[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.IdpPluginRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entities", kind: "message", T: Entity, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IdpPluginRequest { + return new IdpPluginRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IdpPluginRequest { + return new IdpPluginRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IdpPluginRequest { + return new IdpPluginRequest().fromJsonString(jsonString, options); + } + + static equals(a: IdpPluginRequest | PlainMessage | undefined, b: IdpPluginRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(IdpPluginRequest, a, b); + } +} + +/** + * @generated from message authorization.IdpEntityRepresentation + */ +export class IdpEntityRepresentation extends Message { + /** + * @generated from field: repeated google.protobuf.Struct additional_props = 1; + */ + additionalProps: Struct[] = []; + + /** + * ephemeral entity id from the request + * + * @generated from field: string original_id = 2; + */ + originalId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.IdpEntityRepresentation"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "additional_props", kind: "message", T: Struct, repeated: true }, + { no: 2, name: "original_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IdpEntityRepresentation { + return new IdpEntityRepresentation().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IdpEntityRepresentation { + return new IdpEntityRepresentation().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IdpEntityRepresentation { + return new IdpEntityRepresentation().fromJsonString(jsonString, options); + } + + static equals(a: IdpEntityRepresentation | PlainMessage | undefined, b: IdpEntityRepresentation | PlainMessage | undefined): boolean { + return proto3.util.equals(IdpEntityRepresentation, a, b); + } +} + +/** + * + * Example: Get idp attributes for bob and alice + * { + * "entity_representations": [ + * { + * "idp_entity_id": "e1", + * "additional_props": {"someAttr1":"someValue1"} + * }, + * { + * "idp_entity_id": "e2", + * "additional_props": {"someAttr2":"someValue2"} + * } + * ] + * } + * + * + * @generated from message authorization.IdpPluginResponse + */ +export class IdpPluginResponse extends Message { + /** + * @generated from field: repeated authorization.IdpEntityRepresentation entity_representations = 1; + */ + entityRepresentations: IdpEntityRepresentation[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.IdpPluginResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "entity_representations", kind: "message", T: IdpEntityRepresentation, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IdpPluginResponse { + return new IdpPluginResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IdpPluginResponse { + return new IdpPluginResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IdpPluginResponse { + return new IdpPluginResponse().fromJsonString(jsonString, options); + } + + static equals(a: IdpPluginResponse | PlainMessage | undefined, b: IdpPluginResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(IdpPluginResponse, a, b); + } +} + +/** + * @generated from message authorization.EntityNotFoundError + */ +export class EntityNotFoundError extends Message { + /** + * @generated from field: int32 code = 1; + */ + code = 0; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + /** + * @generated from field: repeated google.protobuf.Any details = 3; + */ + details: Any[] = []; + + /** + * @generated from field: string entity = 4; + */ + entity = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "authorization.EntityNotFoundError"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "code", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "details", kind: "message", T: Any, repeated: true }, + { no: 4, name: "entity", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EntityNotFoundError { + return new EntityNotFoundError().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EntityNotFoundError { + return new EntityNotFoundError().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EntityNotFoundError { + return new EntityNotFoundError().fromJsonString(jsonString, options); + } + + static equals(a: EntityNotFoundError | PlainMessage | undefined, b: EntityNotFoundError | PlainMessage | undefined): boolean { + return proto3.util.equals(EntityNotFoundError, a, b); + } +} + diff --git a/lib/gen/common/common_pb.ts b/lib/gen/common/common_pb.ts new file mode 100644 index 00000000..7394621e --- /dev/null +++ b/lib/gen/common/common_pb.ts @@ -0,0 +1,170 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file common/common.proto (package common, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; + +/** + * @generated from enum common.MetadataUpdateEnum + */ +export enum MetadataUpdateEnum { + /** + * unspecified update type + * + * @generated from enum value: METADATA_UPDATE_ENUM_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * only update the fields that are provided + * + * @generated from enum value: METADATA_UPDATE_ENUM_EXTEND = 1; + */ + EXTEND = 1, + + /** + * replace the entire metadata with the provided metadata + * + * @generated from enum value: METADATA_UPDATE_ENUM_REPLACE = 2; + */ + REPLACE = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(MetadataUpdateEnum) +proto3.util.setEnumType(MetadataUpdateEnum, "common.MetadataUpdateEnum", [ + { no: 0, name: "METADATA_UPDATE_ENUM_UNSPECIFIED" }, + { no: 1, name: "METADATA_UPDATE_ENUM_EXTEND" }, + { no: 2, name: "METADATA_UPDATE_ENUM_REPLACE" }, +]); + +/** + * buflint ENUM_VALUE_PREFIX: to make sure that C++ scoping rules aren't violated when users add new enum values to an enum in a given package + * + * @generated from enum common.ActiveStateEnum + */ +export enum ActiveStateEnum { + /** + * @generated from enum value: ACTIVE_STATE_ENUM_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: ACTIVE_STATE_ENUM_ACTIVE = 1; + */ + ACTIVE = 1, + + /** + * @generated from enum value: ACTIVE_STATE_ENUM_INACTIVE = 2; + */ + INACTIVE = 2, + + /** + * @generated from enum value: ACTIVE_STATE_ENUM_ANY = 3; + */ + ANY = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(ActiveStateEnum) +proto3.util.setEnumType(ActiveStateEnum, "common.ActiveStateEnum", [ + { no: 0, name: "ACTIVE_STATE_ENUM_UNSPECIFIED" }, + { no: 1, name: "ACTIVE_STATE_ENUM_ACTIVE" }, + { no: 2, name: "ACTIVE_STATE_ENUM_INACTIVE" }, + { no: 3, name: "ACTIVE_STATE_ENUM_ANY" }, +]); + +/** + * Struct to uniquely identify a resource with optional additional metadata + * + * @generated from message common.Metadata + */ +export class Metadata extends Message { + /** + * created_at set by server (entity who created will recorded in an audit event) + * + * @generated from field: google.protobuf.Timestamp created_at = 1; + */ + createdAt?: Timestamp; + + /** + * updated_at set by server (entity who updated will recorded in an audit event) + * + * @generated from field: google.protobuf.Timestamp updated_at = 2; + */ + updatedAt?: Timestamp; + + /** + * optional short description + * + * @generated from field: map labels = 3; + */ + labels: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "common.Metadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "created_at", kind: "message", T: Timestamp }, + { no: 2, name: "updated_at", kind: "message", T: Timestamp }, + { no: 3, name: "labels", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Metadata { + return new Metadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Metadata { + return new Metadata().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Metadata { + return new Metadata().fromJsonString(jsonString, options); + } + + static equals(a: Metadata | PlainMessage | undefined, b: Metadata | PlainMessage | undefined): boolean { + return proto3.util.equals(Metadata, a, b); + } +} + +/** + * @generated from message common.MetadataMutable + */ +export class MetadataMutable extends Message { + /** + * optional labels + * + * @generated from field: map labels = 3; + */ + labels: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "common.MetadataMutable"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 3, name: "labels", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MetadataMutable { + return new MetadataMutable().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MetadataMutable { + return new MetadataMutable().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MetadataMutable { + return new MetadataMutable().fromJsonString(jsonString, options); + } + + static equals(a: MetadataMutable | PlainMessage | undefined, b: MetadataMutable | PlainMessage | undefined): boolean { + return proto3.util.equals(MetadataMutable, a, b); + } +} + diff --git a/lib/gen/kas/kas_connect.ts b/lib/gen/kas/kas_connect.ts new file mode 100644 index 00000000..3318b6f3 --- /dev/null +++ b/lib/gen/kas/kas_connect.ts @@ -0,0 +1,59 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file kas/kas.proto (package kas, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { InfoRequest, InfoResponse, LegacyPublicKeyRequest, PublicKeyRequest, PublicKeyResponse, RewrapRequest, RewrapResponse } from "./kas_pb.js"; +import { MethodKind, StringValue } from "@bufbuild/protobuf"; + +/** + * Get app info from the root path + * + * @generated from service kas.AccessService + */ +export const AccessService = { + typeName: "kas.AccessService", + methods: { + /** + * Get the current version of the service + * + * @generated from rpc kas.AccessService.Info + */ + info: { + name: "Info", + I: InfoRequest, + O: InfoResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc kas.AccessService.PublicKey + */ + publicKey: { + name: "PublicKey", + I: PublicKeyRequest, + O: PublicKeyResponse, + kind: MethodKind.Unary, + }, + /** + * buf:lint:ignore RPC_RESPONSE_STANDARD_NAME + * + * @generated from rpc kas.AccessService.LegacyPublicKey + */ + legacyPublicKey: { + name: "LegacyPublicKey", + I: LegacyPublicKeyRequest, + O: StringValue, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc kas.AccessService.Rewrap + */ + rewrap: { + name: "Rewrap", + I: RewrapRequest, + O: RewrapResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/kas/kas_pb.ts b/lib/gen/kas/kas_pb.ts new file mode 100644 index 00000000..8b1c8261 --- /dev/null +++ b/lib/gen/kas/kas_pb.ts @@ -0,0 +1,295 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file kas/kas.proto (package kas, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Value } from "@bufbuild/protobuf"; + +/** + * Intentionally empty. May include features later. + * + * @generated from message kas.InfoRequest + */ +export class InfoRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "kas.InfoRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): InfoRequest { + return new InfoRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): InfoRequest { + return new InfoRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): InfoRequest { + return new InfoRequest().fromJsonString(jsonString, options); + } + + static equals(a: InfoRequest | PlainMessage | undefined, b: InfoRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(InfoRequest, a, b); + } +} + +/** + * Service application level metadata + * + * @generated from message kas.InfoResponse + */ +export class InfoResponse extends Message { + /** + * @generated from field: string version = 1; + */ + version = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "kas.InfoResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): InfoResponse { + return new InfoResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): InfoResponse { + return new InfoResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): InfoResponse { + return new InfoResponse().fromJsonString(jsonString, options); + } + + static equals(a: InfoResponse | PlainMessage | undefined, b: InfoResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(InfoResponse, a, b); + } +} + +/** + * @generated from message kas.LegacyPublicKeyRequest + */ +export class LegacyPublicKeyRequest extends Message { + /** + * @generated from field: string algorithm = 1; + */ + algorithm = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "kas.LegacyPublicKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "algorithm", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LegacyPublicKeyRequest { + return new LegacyPublicKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LegacyPublicKeyRequest { + return new LegacyPublicKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LegacyPublicKeyRequest { + return new LegacyPublicKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: LegacyPublicKeyRequest | PlainMessage | undefined, b: LegacyPublicKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(LegacyPublicKeyRequest, a, b); + } +} + +/** + * @generated from message kas.PublicKeyRequest + */ +export class PublicKeyRequest extends Message { + /** + * @generated from field: string algorithm = 1; + */ + algorithm = ""; + + /** + * @generated from field: string fmt = 2; + */ + fmt = ""; + + /** + * @generated from field: string v = 3; + */ + v = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "kas.PublicKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "algorithm", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "fmt", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "v", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublicKeyRequest { + return new PublicKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublicKeyRequest { + return new PublicKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublicKeyRequest { + return new PublicKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: PublicKeyRequest | PlainMessage | undefined, b: PublicKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(PublicKeyRequest, a, b); + } +} + +/** + * @generated from message kas.PublicKeyResponse + */ +export class PublicKeyResponse extends Message { + /** + * @generated from field: string public_key = 1; + */ + publicKey = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "kas.PublicKeyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "public_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublicKeyResponse { + return new PublicKeyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublicKeyResponse { + return new PublicKeyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublicKeyResponse { + return new PublicKeyResponse().fromJsonString(jsonString, options); + } + + static equals(a: PublicKeyResponse | PlainMessage | undefined, b: PublicKeyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(PublicKeyResponse, a, b); + } +} + +/** + * @generated from message kas.RewrapRequest + */ +export class RewrapRequest extends Message { + /** + * @generated from field: string signed_request_token = 1; + */ + signedRequestToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "kas.RewrapRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "signed_request_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RewrapRequest { + return new RewrapRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RewrapRequest { + return new RewrapRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RewrapRequest { + return new RewrapRequest().fromJsonString(jsonString, options); + } + + static equals(a: RewrapRequest | PlainMessage | undefined, b: RewrapRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RewrapRequest, a, b); + } +} + +/** + * @generated from message kas.RewrapResponse + */ +export class RewrapResponse extends Message { + /** + * @generated from field: map metadata = 1; + */ + metadata: { [key: string]: Value } = {}; + + /** + * @generated from field: bytes entity_wrapped_key = 2; + */ + entityWrappedKey = new Uint8Array(0); + + /** + * @generated from field: string session_public_key = 3; + */ + sessionPublicKey = ""; + + /** + * @generated from field: string schema_version = 4; + */ + schemaVersion = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "kas.RewrapResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "metadata", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Value} }, + { no: 2, name: "entity_wrapped_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 3, name: "session_public_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "schema_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RewrapResponse { + return new RewrapResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RewrapResponse { + return new RewrapResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RewrapResponse { + return new RewrapResponse().fromJsonString(jsonString, options); + } + + static equals(a: RewrapResponse | PlainMessage | undefined, b: RewrapResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RewrapResponse, a, b); + } +} + diff --git a/lib/gen/policy/attributes/attributes_connect.ts b/lib/gen/policy/attributes/attributes_connect.ts new file mode 100644 index 00000000..5eb0c595 --- /dev/null +++ b/lib/gen/policy/attributes/attributes_connect.ts @@ -0,0 +1,168 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file policy/attributes/attributes.proto (package policy.attributes, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { AssignKeyAccessServerToAttributeRequest, AssignKeyAccessServerToAttributeResponse, AssignKeyAccessServerToValueRequest, AssignKeyAccessServerToValueResponse, CreateAttributeRequest, CreateAttributeResponse, CreateAttributeValueRequest, CreateAttributeValueResponse, DeactivateAttributeRequest, DeactivateAttributeResponse, DeactivateAttributeValueRequest, DeactivateAttributeValueResponse, GetAttributeRequest, GetAttributeResponse, GetAttributeValueRequest, GetAttributeValueResponse, GetAttributeValuesByFqnsRequest, GetAttributeValuesByFqnsResponse, ListAttributesRequest, ListAttributesResponse, ListAttributeValuesRequest, ListAttributeValuesResponse, RemoveKeyAccessServerFromAttributeRequest, RemoveKeyAccessServerFromAttributeResponse, RemoveKeyAccessServerFromValueRequest, RemoveKeyAccessServerFromValueResponse, UpdateAttributeRequest, UpdateAttributeResponse, UpdateAttributeValueRequest, UpdateAttributeValueResponse } from "./attributes_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * / + * / Attribute Service + * / + * + * @generated from service policy.attributes.AttributesService + */ +export const AttributesService = { + typeName: "policy.attributes.AttributesService", + methods: { + /** + * --------------------------------------* + * Attribute RPCs + * --------------------------------------- + * + * @generated from rpc policy.attributes.AttributesService.ListAttributes + */ + listAttributes: { + name: "ListAttributes", + I: ListAttributesRequest, + O: ListAttributesResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.ListAttributeValues + */ + listAttributeValues: { + name: "ListAttributeValues", + I: ListAttributeValuesRequest, + O: ListAttributeValuesResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.GetAttribute + */ + getAttribute: { + name: "GetAttribute", + I: GetAttributeRequest, + O: GetAttributeResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.GetAttributeValuesByFqns + */ + getAttributeValuesByFqns: { + name: "GetAttributeValuesByFqns", + I: GetAttributeValuesByFqnsRequest, + O: GetAttributeValuesByFqnsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.CreateAttribute + */ + createAttribute: { + name: "CreateAttribute", + I: CreateAttributeRequest, + O: CreateAttributeResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.UpdateAttribute + */ + updateAttribute: { + name: "UpdateAttribute", + I: UpdateAttributeRequest, + O: UpdateAttributeResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.DeactivateAttribute + */ + deactivateAttribute: { + name: "DeactivateAttribute", + I: DeactivateAttributeRequest, + O: DeactivateAttributeResponse, + kind: MethodKind.Unary, + }, + /** + * --------------------------------------* + * Value RPCs + * --------------------------------------- + * + * @generated from rpc policy.attributes.AttributesService.GetAttributeValue + */ + getAttributeValue: { + name: "GetAttributeValue", + I: GetAttributeValueRequest, + O: GetAttributeValueResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.CreateAttributeValue + */ + createAttributeValue: { + name: "CreateAttributeValue", + I: CreateAttributeValueRequest, + O: CreateAttributeValueResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.UpdateAttributeValue + */ + updateAttributeValue: { + name: "UpdateAttributeValue", + I: UpdateAttributeValueRequest, + O: UpdateAttributeValueResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.DeactivateAttributeValue + */ + deactivateAttributeValue: { + name: "DeactivateAttributeValue", + I: DeactivateAttributeValueRequest, + O: DeactivateAttributeValueResponse, + kind: MethodKind.Unary, + }, + /** + * --------------------------------------* + * Attribute <> Key Access Server RPCs + * --------------------------------------- + * + * @generated from rpc policy.attributes.AttributesService.AssignKeyAccessServerToAttribute + */ + assignKeyAccessServerToAttribute: { + name: "AssignKeyAccessServerToAttribute", + I: AssignKeyAccessServerToAttributeRequest, + O: AssignKeyAccessServerToAttributeResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.RemoveKeyAccessServerFromAttribute + */ + removeKeyAccessServerFromAttribute: { + name: "RemoveKeyAccessServerFromAttribute", + I: RemoveKeyAccessServerFromAttributeRequest, + O: RemoveKeyAccessServerFromAttributeResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.AssignKeyAccessServerToValue + */ + assignKeyAccessServerToValue: { + name: "AssignKeyAccessServerToValue", + I: AssignKeyAccessServerToValueRequest, + O: AssignKeyAccessServerToValueResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.attributes.AttributesService.RemoveKeyAccessServerFromValue + */ + removeKeyAccessServerFromValue: { + name: "RemoveKeyAccessServerFromValue", + I: RemoveKeyAccessServerFromValueRequest, + O: RemoveKeyAccessServerFromValueResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/policy/attributes/attributes_pb.ts b/lib/gen/policy/attributes/attributes_pb.ts new file mode 100644 index 00000000..73b81db7 --- /dev/null +++ b/lib/gen/policy/attributes/attributes_pb.ts @@ -0,0 +1,1376 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file policy/attributes/attributes.proto (package policy.attributes, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { ActiveStateEnum, MetadataMutable, MetadataUpdateEnum } from "../../common/common_pb.js"; +import { Attribute, AttributeRuleTypeEnum, Value } from "../objects_pb.js"; +import { AttributeValueSelector } from "../selectors_pb.js"; + +/** + * @generated from message policy.attributes.AttributeKeyAccessServer + */ +export class AttributeKeyAccessServer extends Message { + /** + * @generated from field: string attribute_id = 1; + */ + attributeId = ""; + + /** + * @generated from field: string key_access_server_id = 2; + */ + keyAccessServerId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.AttributeKeyAccessServer"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key_access_server_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeKeyAccessServer { + return new AttributeKeyAccessServer().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeKeyAccessServer { + return new AttributeKeyAccessServer().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeKeyAccessServer { + return new AttributeKeyAccessServer().fromJsonString(jsonString, options); + } + + static equals(a: AttributeKeyAccessServer | PlainMessage | undefined, b: AttributeKeyAccessServer | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeKeyAccessServer, a, b); + } +} + +/** + * @generated from message policy.attributes.ValueKeyAccessServer + */ +export class ValueKeyAccessServer extends Message { + /** + * @generated from field: string value_id = 1; + */ + valueId = ""; + + /** + * @generated from field: string key_access_server_id = 2; + */ + keyAccessServerId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.ValueKeyAccessServer"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key_access_server_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ValueKeyAccessServer { + return new ValueKeyAccessServer().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ValueKeyAccessServer { + return new ValueKeyAccessServer().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ValueKeyAccessServer { + return new ValueKeyAccessServer().fromJsonString(jsonString, options); + } + + static equals(a: ValueKeyAccessServer | PlainMessage | undefined, b: ValueKeyAccessServer | PlainMessage | undefined): boolean { + return proto3.util.equals(ValueKeyAccessServer, a, b); + } +} + +/** + * @generated from message policy.attributes.ListAttributesRequest + */ +export class ListAttributesRequest extends Message { + /** + * ACTIVE by default when not specified + * + * @generated from field: common.ActiveStateEnum state = 1; + */ + state = ActiveStateEnum.UNSPECIFIED; + + /** + * can be id or name + * + * @generated from field: string namespace = 2; + */ + namespace = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.ListAttributesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(ActiveStateEnum) }, + { no: 2, name: "namespace", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAttributesRequest { + return new ListAttributesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAttributesRequest { + return new ListAttributesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAttributesRequest { + return new ListAttributesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListAttributesRequest | PlainMessage | undefined, b: ListAttributesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAttributesRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.ListAttributesResponse + */ +export class ListAttributesResponse extends Message { + /** + * @generated from field: repeated policy.Attribute attributes = 1; + */ + attributes: Attribute[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.ListAttributesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attributes", kind: "message", T: Attribute, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAttributesResponse { + return new ListAttributesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAttributesResponse { + return new ListAttributesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAttributesResponse { + return new ListAttributesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListAttributesResponse | PlainMessage | undefined, b: ListAttributesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAttributesResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.GetAttributeRequest + */ +export class GetAttributeRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.GetAttributeRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAttributeRequest { + return new GetAttributeRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAttributeRequest { + return new GetAttributeRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAttributeRequest { + return new GetAttributeRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetAttributeRequest | PlainMessage | undefined, b: GetAttributeRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAttributeRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.GetAttributeResponse + */ +export class GetAttributeResponse extends Message { + /** + * @generated from field: policy.Attribute attribute = 1; + */ + attribute?: Attribute; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.GetAttributeResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute", kind: "message", T: Attribute }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAttributeResponse { + return new GetAttributeResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAttributeResponse { + return new GetAttributeResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAttributeResponse { + return new GetAttributeResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetAttributeResponse | PlainMessage | undefined, b: GetAttributeResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAttributeResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.CreateAttributeRequest + */ +export class CreateAttributeRequest extends Message { + /** + * Required + * + * @generated from field: string namespace_id = 1; + */ + namespaceId = ""; + + /** + * @generated from field: string name = 2; + */ + name = ""; + + /** + * @generated from field: policy.AttributeRuleTypeEnum rule = 3; + */ + rule = AttributeRuleTypeEnum.UNSPECIFIED; + + /** + * Optional attribute values (when provided) must be alphanumeric strings, allowing hyphens and underscores but not as the first or last character. + * The stored attribute value will be normalized to lower case. + * + * @generated from field: repeated string values = 4; + */ + values: string[] = []; + + /** + * Optional + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.CreateAttributeRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "namespace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "rule", kind: "enum", T: proto3.getEnumType(AttributeRuleTypeEnum) }, + { no: 4, name: "values", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateAttributeRequest { + return new CreateAttributeRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateAttributeRequest { + return new CreateAttributeRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateAttributeRequest { + return new CreateAttributeRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateAttributeRequest | PlainMessage | undefined, b: CreateAttributeRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateAttributeRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.CreateAttributeResponse + */ +export class CreateAttributeResponse extends Message { + /** + * @generated from field: policy.Attribute attribute = 1; + */ + attribute?: Attribute; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.CreateAttributeResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute", kind: "message", T: Attribute }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateAttributeResponse { + return new CreateAttributeResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateAttributeResponse { + return new CreateAttributeResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateAttributeResponse { + return new CreateAttributeResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateAttributeResponse | PlainMessage | undefined, b: CreateAttributeResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateAttributeResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.UpdateAttributeRequest + */ +export class UpdateAttributeRequest extends Message { + /** + * Required + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Optional + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + /** + * @generated from field: common.MetadataUpdateEnum metadata_update_behavior = 101; + */ + metadataUpdateBehavior = MetadataUpdateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.UpdateAttributeRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + { no: 101, name: "metadata_update_behavior", kind: "enum", T: proto3.getEnumType(MetadataUpdateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateAttributeRequest { + return new UpdateAttributeRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateAttributeRequest { + return new UpdateAttributeRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateAttributeRequest { + return new UpdateAttributeRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateAttributeRequest | PlainMessage | undefined, b: UpdateAttributeRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateAttributeRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.UpdateAttributeResponse + */ +export class UpdateAttributeResponse extends Message { + /** + * @generated from field: policy.Attribute attribute = 1; + */ + attribute?: Attribute; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.UpdateAttributeResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute", kind: "message", T: Attribute }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateAttributeResponse { + return new UpdateAttributeResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateAttributeResponse { + return new UpdateAttributeResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateAttributeResponse { + return new UpdateAttributeResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateAttributeResponse | PlainMessage | undefined, b: UpdateAttributeResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateAttributeResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.DeactivateAttributeRequest + */ +export class DeactivateAttributeRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.DeactivateAttributeRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeactivateAttributeRequest { + return new DeactivateAttributeRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeactivateAttributeRequest { + return new DeactivateAttributeRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeactivateAttributeRequest { + return new DeactivateAttributeRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeactivateAttributeRequest | PlainMessage | undefined, b: DeactivateAttributeRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeactivateAttributeRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.DeactivateAttributeResponse + */ +export class DeactivateAttributeResponse extends Message { + /** + * @generated from field: policy.Attribute attribute = 1; + */ + attribute?: Attribute; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.DeactivateAttributeResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute", kind: "message", T: Attribute }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeactivateAttributeResponse { + return new DeactivateAttributeResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeactivateAttributeResponse { + return new DeactivateAttributeResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeactivateAttributeResponse { + return new DeactivateAttributeResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeactivateAttributeResponse | PlainMessage | undefined, b: DeactivateAttributeResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeactivateAttributeResponse, a, b); + } +} + +/** + * / + * / Value RPC messages + * / + * + * @generated from message policy.attributes.GetAttributeValueRequest + */ +export class GetAttributeValueRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.GetAttributeValueRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAttributeValueRequest { + return new GetAttributeValueRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAttributeValueRequest { + return new GetAttributeValueRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAttributeValueRequest { + return new GetAttributeValueRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetAttributeValueRequest | PlainMessage | undefined, b: GetAttributeValueRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAttributeValueRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.GetAttributeValueResponse + */ +export class GetAttributeValueResponse extends Message { + /** + * @generated from field: policy.Value value = 1; + */ + value?: Value; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.GetAttributeValueResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "message", T: Value }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAttributeValueResponse { + return new GetAttributeValueResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAttributeValueResponse { + return new GetAttributeValueResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAttributeValueResponse { + return new GetAttributeValueResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetAttributeValueResponse | PlainMessage | undefined, b: GetAttributeValueResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAttributeValueResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.ListAttributeValuesRequest + */ +export class ListAttributeValuesRequest extends Message { + /** + * @generated from field: string attribute_id = 1; + */ + attributeId = ""; + + /** + * ACTIVE by default when not specified + * + * @generated from field: common.ActiveStateEnum state = 2; + */ + state = ActiveStateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.ListAttributeValuesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(ActiveStateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAttributeValuesRequest { + return new ListAttributeValuesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAttributeValuesRequest { + return new ListAttributeValuesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAttributeValuesRequest { + return new ListAttributeValuesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListAttributeValuesRequest | PlainMessage | undefined, b: ListAttributeValuesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAttributeValuesRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.ListAttributeValuesResponse + */ +export class ListAttributeValuesResponse extends Message { + /** + * @generated from field: repeated policy.Value values = 1; + */ + values: Value[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.ListAttributeValuesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "values", kind: "message", T: Value, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAttributeValuesResponse { + return new ListAttributeValuesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAttributeValuesResponse { + return new ListAttributeValuesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAttributeValuesResponse { + return new ListAttributeValuesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListAttributeValuesResponse | PlainMessage | undefined, b: ListAttributeValuesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListAttributeValuesResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.CreateAttributeValueRequest + */ +export class CreateAttributeValueRequest extends Message { + /** + * Required + * + * @generated from field: string attribute_id = 1; + */ + attributeId = ""; + + /** + * @generated from field: string value = 2; + */ + value = ""; + + /** + * Optional + * + * @generated from field: repeated string members = 3; + */ + members: string[] = []; + + /** + * Common metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.CreateAttributeValueRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "members", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateAttributeValueRequest { + return new CreateAttributeValueRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateAttributeValueRequest { + return new CreateAttributeValueRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateAttributeValueRequest { + return new CreateAttributeValueRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateAttributeValueRequest | PlainMessage | undefined, b: CreateAttributeValueRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateAttributeValueRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.CreateAttributeValueResponse + */ +export class CreateAttributeValueResponse extends Message { + /** + * @generated from field: policy.Value value = 1; + */ + value?: Value; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.CreateAttributeValueResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "message", T: Value }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateAttributeValueResponse { + return new CreateAttributeValueResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateAttributeValueResponse { + return new CreateAttributeValueResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateAttributeValueResponse { + return new CreateAttributeValueResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateAttributeValueResponse | PlainMessage | undefined, b: CreateAttributeValueResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateAttributeValueResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.UpdateAttributeValueRequest + */ +export class UpdateAttributeValueRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Optional + * + * @generated from field: repeated string members = 4; + */ + members: string[] = []; + + /** + * Common metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + /** + * @generated from field: common.MetadataUpdateEnum metadata_update_behavior = 101; + */ + metadataUpdateBehavior = MetadataUpdateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.UpdateAttributeValueRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "members", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + { no: 101, name: "metadata_update_behavior", kind: "enum", T: proto3.getEnumType(MetadataUpdateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateAttributeValueRequest { + return new UpdateAttributeValueRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateAttributeValueRequest { + return new UpdateAttributeValueRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateAttributeValueRequest { + return new UpdateAttributeValueRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateAttributeValueRequest | PlainMessage | undefined, b: UpdateAttributeValueRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateAttributeValueRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.UpdateAttributeValueResponse + */ +export class UpdateAttributeValueResponse extends Message { + /** + * @generated from field: policy.Value value = 1; + */ + value?: Value; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.UpdateAttributeValueResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "message", T: Value }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateAttributeValueResponse { + return new UpdateAttributeValueResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateAttributeValueResponse { + return new UpdateAttributeValueResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateAttributeValueResponse { + return new UpdateAttributeValueResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateAttributeValueResponse | PlainMessage | undefined, b: UpdateAttributeValueResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateAttributeValueResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.DeactivateAttributeValueRequest + */ +export class DeactivateAttributeValueRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.DeactivateAttributeValueRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeactivateAttributeValueRequest { + return new DeactivateAttributeValueRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeactivateAttributeValueRequest { + return new DeactivateAttributeValueRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeactivateAttributeValueRequest { + return new DeactivateAttributeValueRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeactivateAttributeValueRequest | PlainMessage | undefined, b: DeactivateAttributeValueRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeactivateAttributeValueRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.DeactivateAttributeValueResponse + */ +export class DeactivateAttributeValueResponse extends Message { + /** + * @generated from field: policy.Value value = 1; + */ + value?: Value; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.DeactivateAttributeValueResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "message", T: Value }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeactivateAttributeValueResponse { + return new DeactivateAttributeValueResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeactivateAttributeValueResponse { + return new DeactivateAttributeValueResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeactivateAttributeValueResponse { + return new DeactivateAttributeValueResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeactivateAttributeValueResponse | PlainMessage | undefined, b: DeactivateAttributeValueResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeactivateAttributeValueResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.GetAttributeValuesByFqnsRequest + */ +export class GetAttributeValuesByFqnsRequest extends Message { + /** + * Required + * Fully Qualified Names of attribute values (i.e. https:///attr//value/), normalized to lower case. + * + * @generated from field: repeated string fqns = 1; + */ + fqns: string[] = []; + + /** + * @generated from field: policy.AttributeValueSelector with_value = 2; + */ + withValue?: AttributeValueSelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.GetAttributeValuesByFqnsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "fqns", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "with_value", kind: "message", T: AttributeValueSelector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAttributeValuesByFqnsRequest { + return new GetAttributeValuesByFqnsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAttributeValuesByFqnsRequest { + return new GetAttributeValuesByFqnsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAttributeValuesByFqnsRequest { + return new GetAttributeValuesByFqnsRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetAttributeValuesByFqnsRequest | PlainMessage | undefined, b: GetAttributeValuesByFqnsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAttributeValuesByFqnsRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.GetAttributeValuesByFqnsResponse + */ +export class GetAttributeValuesByFqnsResponse extends Message { + /** + * map of FQNs to complete attributes and the one selected value + * + * @generated from field: map fqn_attribute_values = 1; + */ + fqnAttributeValues: { [key: string]: GetAttributeValuesByFqnsResponse_AttributeAndValue } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.GetAttributeValuesByFqnsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "fqn_attribute_values", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: GetAttributeValuesByFqnsResponse_AttributeAndValue} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAttributeValuesByFqnsResponse { + return new GetAttributeValuesByFqnsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAttributeValuesByFqnsResponse { + return new GetAttributeValuesByFqnsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAttributeValuesByFqnsResponse { + return new GetAttributeValuesByFqnsResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetAttributeValuesByFqnsResponse | PlainMessage | undefined, b: GetAttributeValuesByFqnsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAttributeValuesByFqnsResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.GetAttributeValuesByFqnsResponse.AttributeAndValue + */ +export class GetAttributeValuesByFqnsResponse_AttributeAndValue extends Message { + /** + * @generated from field: policy.Attribute attribute = 1; + */ + attribute?: Attribute; + + /** + * @generated from field: policy.Value value = 2; + */ + value?: Value; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.GetAttributeValuesByFqnsResponse.AttributeAndValue"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute", kind: "message", T: Attribute }, + { no: 2, name: "value", kind: "message", T: Value }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAttributeValuesByFqnsResponse_AttributeAndValue { + return new GetAttributeValuesByFqnsResponse_AttributeAndValue().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAttributeValuesByFqnsResponse_AttributeAndValue { + return new GetAttributeValuesByFqnsResponse_AttributeAndValue().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAttributeValuesByFqnsResponse_AttributeAndValue { + return new GetAttributeValuesByFqnsResponse_AttributeAndValue().fromJsonString(jsonString, options); + } + + static equals(a: GetAttributeValuesByFqnsResponse_AttributeAndValue | PlainMessage | undefined, b: GetAttributeValuesByFqnsResponse_AttributeAndValue | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAttributeValuesByFqnsResponse_AttributeAndValue, a, b); + } +} + +/** + * @generated from message policy.attributes.AssignKeyAccessServerToAttributeRequest + */ +export class AssignKeyAccessServerToAttributeRequest extends Message { + /** + * @generated from field: policy.attributes.AttributeKeyAccessServer attribute_key_access_server = 1; + */ + attributeKeyAccessServer?: AttributeKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.AssignKeyAccessServerToAttributeRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_key_access_server", kind: "message", T: AttributeKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssignKeyAccessServerToAttributeRequest { + return new AssignKeyAccessServerToAttributeRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssignKeyAccessServerToAttributeRequest { + return new AssignKeyAccessServerToAttributeRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssignKeyAccessServerToAttributeRequest { + return new AssignKeyAccessServerToAttributeRequest().fromJsonString(jsonString, options); + } + + static equals(a: AssignKeyAccessServerToAttributeRequest | PlainMessage | undefined, b: AssignKeyAccessServerToAttributeRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(AssignKeyAccessServerToAttributeRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.AssignKeyAccessServerToAttributeResponse + */ +export class AssignKeyAccessServerToAttributeResponse extends Message { + /** + * @generated from field: policy.attributes.AttributeKeyAccessServer attribute_key_access_server = 1; + */ + attributeKeyAccessServer?: AttributeKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.AssignKeyAccessServerToAttributeResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_key_access_server", kind: "message", T: AttributeKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssignKeyAccessServerToAttributeResponse { + return new AssignKeyAccessServerToAttributeResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssignKeyAccessServerToAttributeResponse { + return new AssignKeyAccessServerToAttributeResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssignKeyAccessServerToAttributeResponse { + return new AssignKeyAccessServerToAttributeResponse().fromJsonString(jsonString, options); + } + + static equals(a: AssignKeyAccessServerToAttributeResponse | PlainMessage | undefined, b: AssignKeyAccessServerToAttributeResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(AssignKeyAccessServerToAttributeResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.RemoveKeyAccessServerFromAttributeRequest + */ +export class RemoveKeyAccessServerFromAttributeRequest extends Message { + /** + * @generated from field: policy.attributes.AttributeKeyAccessServer attribute_key_access_server = 1; + */ + attributeKeyAccessServer?: AttributeKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.RemoveKeyAccessServerFromAttributeRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_key_access_server", kind: "message", T: AttributeKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RemoveKeyAccessServerFromAttributeRequest { + return new RemoveKeyAccessServerFromAttributeRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RemoveKeyAccessServerFromAttributeRequest { + return new RemoveKeyAccessServerFromAttributeRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RemoveKeyAccessServerFromAttributeRequest { + return new RemoveKeyAccessServerFromAttributeRequest().fromJsonString(jsonString, options); + } + + static equals(a: RemoveKeyAccessServerFromAttributeRequest | PlainMessage | undefined, b: RemoveKeyAccessServerFromAttributeRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RemoveKeyAccessServerFromAttributeRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.RemoveKeyAccessServerFromAttributeResponse + */ +export class RemoveKeyAccessServerFromAttributeResponse extends Message { + /** + * @generated from field: policy.attributes.AttributeKeyAccessServer attribute_key_access_server = 1; + */ + attributeKeyAccessServer?: AttributeKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.RemoveKeyAccessServerFromAttributeResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_key_access_server", kind: "message", T: AttributeKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RemoveKeyAccessServerFromAttributeResponse { + return new RemoveKeyAccessServerFromAttributeResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RemoveKeyAccessServerFromAttributeResponse { + return new RemoveKeyAccessServerFromAttributeResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RemoveKeyAccessServerFromAttributeResponse { + return new RemoveKeyAccessServerFromAttributeResponse().fromJsonString(jsonString, options); + } + + static equals(a: RemoveKeyAccessServerFromAttributeResponse | PlainMessage | undefined, b: RemoveKeyAccessServerFromAttributeResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RemoveKeyAccessServerFromAttributeResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.AssignKeyAccessServerToValueRequest + */ +export class AssignKeyAccessServerToValueRequest extends Message { + /** + * @generated from field: policy.attributes.ValueKeyAccessServer value_key_access_server = 1; + */ + valueKeyAccessServer?: ValueKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.AssignKeyAccessServerToValueRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value_key_access_server", kind: "message", T: ValueKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssignKeyAccessServerToValueRequest { + return new AssignKeyAccessServerToValueRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssignKeyAccessServerToValueRequest { + return new AssignKeyAccessServerToValueRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssignKeyAccessServerToValueRequest { + return new AssignKeyAccessServerToValueRequest().fromJsonString(jsonString, options); + } + + static equals(a: AssignKeyAccessServerToValueRequest | PlainMessage | undefined, b: AssignKeyAccessServerToValueRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(AssignKeyAccessServerToValueRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.AssignKeyAccessServerToValueResponse + */ +export class AssignKeyAccessServerToValueResponse extends Message { + /** + * @generated from field: policy.attributes.ValueKeyAccessServer value_key_access_server = 1; + */ + valueKeyAccessServer?: ValueKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.AssignKeyAccessServerToValueResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value_key_access_server", kind: "message", T: ValueKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AssignKeyAccessServerToValueResponse { + return new AssignKeyAccessServerToValueResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AssignKeyAccessServerToValueResponse { + return new AssignKeyAccessServerToValueResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AssignKeyAccessServerToValueResponse { + return new AssignKeyAccessServerToValueResponse().fromJsonString(jsonString, options); + } + + static equals(a: AssignKeyAccessServerToValueResponse | PlainMessage | undefined, b: AssignKeyAccessServerToValueResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(AssignKeyAccessServerToValueResponse, a, b); + } +} + +/** + * @generated from message policy.attributes.RemoveKeyAccessServerFromValueRequest + */ +export class RemoveKeyAccessServerFromValueRequest extends Message { + /** + * @generated from field: policy.attributes.ValueKeyAccessServer value_key_access_server = 1; + */ + valueKeyAccessServer?: ValueKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.RemoveKeyAccessServerFromValueRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value_key_access_server", kind: "message", T: ValueKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RemoveKeyAccessServerFromValueRequest { + return new RemoveKeyAccessServerFromValueRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RemoveKeyAccessServerFromValueRequest { + return new RemoveKeyAccessServerFromValueRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RemoveKeyAccessServerFromValueRequest { + return new RemoveKeyAccessServerFromValueRequest().fromJsonString(jsonString, options); + } + + static equals(a: RemoveKeyAccessServerFromValueRequest | PlainMessage | undefined, b: RemoveKeyAccessServerFromValueRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RemoveKeyAccessServerFromValueRequest, a, b); + } +} + +/** + * @generated from message policy.attributes.RemoveKeyAccessServerFromValueResponse + */ +export class RemoveKeyAccessServerFromValueResponse extends Message { + /** + * @generated from field: policy.attributes.ValueKeyAccessServer value_key_access_server = 1; + */ + valueKeyAccessServer?: ValueKeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.attributes.RemoveKeyAccessServerFromValueResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value_key_access_server", kind: "message", T: ValueKeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RemoveKeyAccessServerFromValueResponse { + return new RemoveKeyAccessServerFromValueResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RemoveKeyAccessServerFromValueResponse { + return new RemoveKeyAccessServerFromValueResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RemoveKeyAccessServerFromValueResponse { + return new RemoveKeyAccessServerFromValueResponse().fromJsonString(jsonString, options); + } + + static equals(a: RemoveKeyAccessServerFromValueResponse | PlainMessage | undefined, b: RemoveKeyAccessServerFromValueResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RemoveKeyAccessServerFromValueResponse, a, b); + } +} + diff --git a/lib/gen/policy/kasregistry/key_access_server_registry_connect.ts b/lib/gen/policy/kasregistry/key_access_server_registry_connect.ts new file mode 100644 index 00000000..3465a58a --- /dev/null +++ b/lib/gen/policy/kasregistry/key_access_server_registry_connect.ts @@ -0,0 +1,62 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file policy/kasregistry/key_access_server_registry.proto (package policy.kasregistry, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CreateKeyAccessServerRequest, CreateKeyAccessServerResponse, DeleteKeyAccessServerRequest, DeleteKeyAccessServerResponse, GetKeyAccessServerRequest, GetKeyAccessServerResponse, ListKeyAccessServersRequest, ListKeyAccessServersResponse, UpdateKeyAccessServerRequest, UpdateKeyAccessServerResponse } from "./key_access_server_registry_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service policy.kasregistry.KeyAccessServerRegistryService + */ +export const KeyAccessServerRegistryService = { + typeName: "policy.kasregistry.KeyAccessServerRegistryService", + methods: { + /** + * @generated from rpc policy.kasregistry.KeyAccessServerRegistryService.ListKeyAccessServers + */ + listKeyAccessServers: { + name: "ListKeyAccessServers", + I: ListKeyAccessServersRequest, + O: ListKeyAccessServersResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.kasregistry.KeyAccessServerRegistryService.GetKeyAccessServer + */ + getKeyAccessServer: { + name: "GetKeyAccessServer", + I: GetKeyAccessServerRequest, + O: GetKeyAccessServerResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.kasregistry.KeyAccessServerRegistryService.CreateKeyAccessServer + */ + createKeyAccessServer: { + name: "CreateKeyAccessServer", + I: CreateKeyAccessServerRequest, + O: CreateKeyAccessServerResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.kasregistry.KeyAccessServerRegistryService.UpdateKeyAccessServer + */ + updateKeyAccessServer: { + name: "UpdateKeyAccessServer", + I: UpdateKeyAccessServerRequest, + O: UpdateKeyAccessServerResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.kasregistry.KeyAccessServerRegistryService.DeleteKeyAccessServer + */ + deleteKeyAccessServer: { + name: "DeleteKeyAccessServer", + I: DeleteKeyAccessServerRequest, + O: DeleteKeyAccessServerResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/policy/kasregistry/key_access_server_registry_pb.ts b/lib/gen/policy/kasregistry/key_access_server_registry_pb.ts new file mode 100644 index 00000000..327cc85c --- /dev/null +++ b/lib/gen/policy/kasregistry/key_access_server_registry_pb.ts @@ -0,0 +1,418 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file policy/kasregistry/key_access_server_registry.proto (package policy.kasregistry, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { KeyAccessServer, PublicKey } from "../objects_pb.js"; +import { MetadataMutable, MetadataUpdateEnum } from "../../common/common_pb.js"; + +/** + * @generated from message policy.kasregistry.GetKeyAccessServerRequest + */ +export class GetKeyAccessServerRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.GetKeyAccessServerRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetKeyAccessServerRequest { + return new GetKeyAccessServerRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetKeyAccessServerRequest { + return new GetKeyAccessServerRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetKeyAccessServerRequest { + return new GetKeyAccessServerRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetKeyAccessServerRequest | PlainMessage | undefined, b: GetKeyAccessServerRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetKeyAccessServerRequest, a, b); + } +} + +/** + * @generated from message policy.kasregistry.GetKeyAccessServerResponse + */ +export class GetKeyAccessServerResponse extends Message { + /** + * @generated from field: policy.KeyAccessServer key_access_server = 1; + */ + keyAccessServer?: KeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.GetKeyAccessServerResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_access_server", kind: "message", T: KeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetKeyAccessServerResponse { + return new GetKeyAccessServerResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetKeyAccessServerResponse { + return new GetKeyAccessServerResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetKeyAccessServerResponse { + return new GetKeyAccessServerResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetKeyAccessServerResponse | PlainMessage | undefined, b: GetKeyAccessServerResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetKeyAccessServerResponse, a, b); + } +} + +/** + * @generated from message policy.kasregistry.ListKeyAccessServersRequest + */ +export class ListKeyAccessServersRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.ListKeyAccessServersRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListKeyAccessServersRequest { + return new ListKeyAccessServersRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListKeyAccessServersRequest { + return new ListKeyAccessServersRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListKeyAccessServersRequest { + return new ListKeyAccessServersRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListKeyAccessServersRequest | PlainMessage | undefined, b: ListKeyAccessServersRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListKeyAccessServersRequest, a, b); + } +} + +/** + * @generated from message policy.kasregistry.ListKeyAccessServersResponse + */ +export class ListKeyAccessServersResponse extends Message { + /** + * @generated from field: repeated policy.KeyAccessServer key_access_servers = 1; + */ + keyAccessServers: KeyAccessServer[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.ListKeyAccessServersResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_access_servers", kind: "message", T: KeyAccessServer, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListKeyAccessServersResponse { + return new ListKeyAccessServersResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListKeyAccessServersResponse { + return new ListKeyAccessServersResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListKeyAccessServersResponse { + return new ListKeyAccessServersResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListKeyAccessServersResponse | PlainMessage | undefined, b: ListKeyAccessServersResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListKeyAccessServersResponse, a, b); + } +} + +/** + * @generated from message policy.kasregistry.CreateKeyAccessServerRequest + */ +export class CreateKeyAccessServerRequest extends Message { + /** + * Required + * + * @generated from field: string uri = 1; + */ + uri = ""; + + /** + * @generated from field: policy.PublicKey public_key = 2; + */ + publicKey?: PublicKey; + + /** + * Common metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.CreateKeyAccessServerRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "uri", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "public_key", kind: "message", T: PublicKey }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateKeyAccessServerRequest { + return new CreateKeyAccessServerRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateKeyAccessServerRequest { + return new CreateKeyAccessServerRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateKeyAccessServerRequest { + return new CreateKeyAccessServerRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateKeyAccessServerRequest | PlainMessage | undefined, b: CreateKeyAccessServerRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateKeyAccessServerRequest, a, b); + } +} + +/** + * @generated from message policy.kasregistry.CreateKeyAccessServerResponse + */ +export class CreateKeyAccessServerResponse extends Message { + /** + * @generated from field: policy.KeyAccessServer key_access_server = 1; + */ + keyAccessServer?: KeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.CreateKeyAccessServerResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_access_server", kind: "message", T: KeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateKeyAccessServerResponse { + return new CreateKeyAccessServerResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateKeyAccessServerResponse { + return new CreateKeyAccessServerResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateKeyAccessServerResponse { + return new CreateKeyAccessServerResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateKeyAccessServerResponse | PlainMessage | undefined, b: CreateKeyAccessServerResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateKeyAccessServerResponse, a, b); + } +} + +/** + * @generated from message policy.kasregistry.UpdateKeyAccessServerRequest + */ +export class UpdateKeyAccessServerRequest extends Message { + /** + * Required + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string uri = 2; + */ + uri = ""; + + /** + * @generated from field: policy.PublicKey public_key = 3; + */ + publicKey?: PublicKey; + + /** + * Common metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + /** + * @generated from field: common.MetadataUpdateEnum metadata_update_behavior = 101; + */ + metadataUpdateBehavior = MetadataUpdateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.UpdateKeyAccessServerRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "uri", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "public_key", kind: "message", T: PublicKey }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + { no: 101, name: "metadata_update_behavior", kind: "enum", T: proto3.getEnumType(MetadataUpdateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateKeyAccessServerRequest { + return new UpdateKeyAccessServerRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateKeyAccessServerRequest { + return new UpdateKeyAccessServerRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateKeyAccessServerRequest { + return new UpdateKeyAccessServerRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateKeyAccessServerRequest | PlainMessage | undefined, b: UpdateKeyAccessServerRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateKeyAccessServerRequest, a, b); + } +} + +/** + * @generated from message policy.kasregistry.UpdateKeyAccessServerResponse + */ +export class UpdateKeyAccessServerResponse extends Message { + /** + * @generated from field: policy.KeyAccessServer key_access_server = 1; + */ + keyAccessServer?: KeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.UpdateKeyAccessServerResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_access_server", kind: "message", T: KeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateKeyAccessServerResponse { + return new UpdateKeyAccessServerResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateKeyAccessServerResponse { + return new UpdateKeyAccessServerResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateKeyAccessServerResponse { + return new UpdateKeyAccessServerResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateKeyAccessServerResponse | PlainMessage | undefined, b: UpdateKeyAccessServerResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateKeyAccessServerResponse, a, b); + } +} + +/** + * @generated from message policy.kasregistry.DeleteKeyAccessServerRequest + */ +export class DeleteKeyAccessServerRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.DeleteKeyAccessServerRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteKeyAccessServerRequest { + return new DeleteKeyAccessServerRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteKeyAccessServerRequest { + return new DeleteKeyAccessServerRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteKeyAccessServerRequest { + return new DeleteKeyAccessServerRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteKeyAccessServerRequest | PlainMessage | undefined, b: DeleteKeyAccessServerRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteKeyAccessServerRequest, a, b); + } +} + +/** + * @generated from message policy.kasregistry.DeleteKeyAccessServerResponse + */ +export class DeleteKeyAccessServerResponse extends Message { + /** + * @generated from field: policy.KeyAccessServer key_access_server = 1; + */ + keyAccessServer?: KeyAccessServer; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.kasregistry.DeleteKeyAccessServerResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_access_server", kind: "message", T: KeyAccessServer }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteKeyAccessServerResponse { + return new DeleteKeyAccessServerResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteKeyAccessServerResponse { + return new DeleteKeyAccessServerResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteKeyAccessServerResponse { + return new DeleteKeyAccessServerResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteKeyAccessServerResponse | PlainMessage | undefined, b: DeleteKeyAccessServerResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteKeyAccessServerResponse, a, b); + } +} + diff --git a/lib/gen/policy/namespaces/namespaces_connect.ts b/lib/gen/policy/namespaces/namespaces_connect.ts new file mode 100644 index 00000000..1518b39c --- /dev/null +++ b/lib/gen/policy/namespaces/namespaces_connect.ts @@ -0,0 +1,62 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file policy/namespaces/namespaces.proto (package policy.namespaces, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CreateNamespaceRequest, CreateNamespaceResponse, DeactivateNamespaceRequest, DeactivateNamespaceResponse, GetNamespaceRequest, GetNamespaceResponse, ListNamespacesRequest, ListNamespacesResponse, UpdateNamespaceRequest, UpdateNamespaceResponse } from "./namespaces_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service policy.namespaces.NamespaceService + */ +export const NamespaceService = { + typeName: "policy.namespaces.NamespaceService", + methods: { + /** + * @generated from rpc policy.namespaces.NamespaceService.GetNamespace + */ + getNamespace: { + name: "GetNamespace", + I: GetNamespaceRequest, + O: GetNamespaceResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.namespaces.NamespaceService.ListNamespaces + */ + listNamespaces: { + name: "ListNamespaces", + I: ListNamespacesRequest, + O: ListNamespacesResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.namespaces.NamespaceService.CreateNamespace + */ + createNamespace: { + name: "CreateNamespace", + I: CreateNamespaceRequest, + O: CreateNamespaceResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.namespaces.NamespaceService.UpdateNamespace + */ + updateNamespace: { + name: "UpdateNamespace", + I: UpdateNamespaceRequest, + O: UpdateNamespaceResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.namespaces.NamespaceService.DeactivateNamespace + */ + deactivateNamespace: { + name: "DeactivateNamespace", + I: DeactivateNamespaceRequest, + O: DeactivateNamespaceResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/policy/namespaces/namespaces_pb.ts b/lib/gen/policy/namespaces/namespaces_pb.ts new file mode 100644 index 00000000..e0c74f13 --- /dev/null +++ b/lib/gen/policy/namespaces/namespaces_pb.ts @@ -0,0 +1,402 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file policy/namespaces/namespaces.proto (package policy.namespaces, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { Namespace } from "../objects_pb.js"; +import { ActiveStateEnum, MetadataMutable, MetadataUpdateEnum } from "../../common/common_pb.js"; + +/** + * @generated from message policy.namespaces.GetNamespaceRequest + */ +export class GetNamespaceRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.GetNamespaceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetNamespaceRequest { + return new GetNamespaceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetNamespaceRequest { + return new GetNamespaceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetNamespaceRequest { + return new GetNamespaceRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetNamespaceRequest | PlainMessage | undefined, b: GetNamespaceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetNamespaceRequest, a, b); + } +} + +/** + * @generated from message policy.namespaces.GetNamespaceResponse + */ +export class GetNamespaceResponse extends Message { + /** + * @generated from field: policy.Namespace namespace = 1; + */ + namespace?: Namespace; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.GetNamespaceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "namespace", kind: "message", T: Namespace }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetNamespaceResponse { + return new GetNamespaceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetNamespaceResponse { + return new GetNamespaceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetNamespaceResponse { + return new GetNamespaceResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetNamespaceResponse | PlainMessage | undefined, b: GetNamespaceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetNamespaceResponse, a, b); + } +} + +/** + * @generated from message policy.namespaces.ListNamespacesRequest + */ +export class ListNamespacesRequest extends Message { + /** + * ACTIVE by default when not specified + * + * @generated from field: common.ActiveStateEnum state = 1; + */ + state = ActiveStateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.ListNamespacesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(ActiveStateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListNamespacesRequest { + return new ListNamespacesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListNamespacesRequest { + return new ListNamespacesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListNamespacesRequest { + return new ListNamespacesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListNamespacesRequest | PlainMessage | undefined, b: ListNamespacesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListNamespacesRequest, a, b); + } +} + +/** + * @generated from message policy.namespaces.ListNamespacesResponse + */ +export class ListNamespacesResponse extends Message { + /** + * @generated from field: repeated policy.Namespace namespaces = 1; + */ + namespaces: Namespace[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.ListNamespacesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "namespaces", kind: "message", T: Namespace, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListNamespacesResponse { + return new ListNamespacesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListNamespacesResponse { + return new ListNamespacesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListNamespacesResponse { + return new ListNamespacesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListNamespacesResponse | PlainMessage | undefined, b: ListNamespacesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListNamespacesResponse, a, b); + } +} + +/** + * @generated from message policy.namespaces.CreateNamespaceRequest + */ +export class CreateNamespaceRequest extends Message { + /** + * Required + * + * @generated from field: string name = 1; + */ + name = ""; + + /** + * Optional + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.CreateNamespaceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateNamespaceRequest { + return new CreateNamespaceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateNamespaceRequest { + return new CreateNamespaceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateNamespaceRequest { + return new CreateNamespaceRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateNamespaceRequest | PlainMessage | undefined, b: CreateNamespaceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateNamespaceRequest, a, b); + } +} + +/** + * @generated from message policy.namespaces.CreateNamespaceResponse + */ +export class CreateNamespaceResponse extends Message { + /** + * @generated from field: policy.Namespace namespace = 1; + */ + namespace?: Namespace; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.CreateNamespaceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "namespace", kind: "message", T: Namespace }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateNamespaceResponse { + return new CreateNamespaceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateNamespaceResponse { + return new CreateNamespaceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateNamespaceResponse { + return new CreateNamespaceResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateNamespaceResponse | PlainMessage | undefined, b: CreateNamespaceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateNamespaceResponse, a, b); + } +} + +/** + * @generated from message policy.namespaces.UpdateNamespaceRequest + */ +export class UpdateNamespaceRequest extends Message { + /** + * Required + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Optional + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + /** + * @generated from field: common.MetadataUpdateEnum metadata_update_behavior = 101; + */ + metadataUpdateBehavior = MetadataUpdateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.UpdateNamespaceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + { no: 101, name: "metadata_update_behavior", kind: "enum", T: proto3.getEnumType(MetadataUpdateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateNamespaceRequest { + return new UpdateNamespaceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateNamespaceRequest { + return new UpdateNamespaceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateNamespaceRequest { + return new UpdateNamespaceRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateNamespaceRequest | PlainMessage | undefined, b: UpdateNamespaceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateNamespaceRequest, a, b); + } +} + +/** + * @generated from message policy.namespaces.UpdateNamespaceResponse + */ +export class UpdateNamespaceResponse extends Message { + /** + * @generated from field: policy.Namespace namespace = 1; + */ + namespace?: Namespace; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.UpdateNamespaceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "namespace", kind: "message", T: Namespace }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateNamespaceResponse { + return new UpdateNamespaceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateNamespaceResponse { + return new UpdateNamespaceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateNamespaceResponse { + return new UpdateNamespaceResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateNamespaceResponse | PlainMessage | undefined, b: UpdateNamespaceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateNamespaceResponse, a, b); + } +} + +/** + * @generated from message policy.namespaces.DeactivateNamespaceRequest + */ +export class DeactivateNamespaceRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.DeactivateNamespaceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeactivateNamespaceRequest { + return new DeactivateNamespaceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeactivateNamespaceRequest { + return new DeactivateNamespaceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeactivateNamespaceRequest { + return new DeactivateNamespaceRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeactivateNamespaceRequest | PlainMessage | undefined, b: DeactivateNamespaceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeactivateNamespaceRequest, a, b); + } +} + +/** + * @generated from message policy.namespaces.DeactivateNamespaceResponse + */ +export class DeactivateNamespaceResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.namespaces.DeactivateNamespaceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeactivateNamespaceResponse { + return new DeactivateNamespaceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeactivateNamespaceResponse { + return new DeactivateNamespaceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeactivateNamespaceResponse { + return new DeactivateNamespaceResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeactivateNamespaceResponse | PlainMessage | undefined, b: DeactivateNamespaceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeactivateNamespaceResponse, a, b); + } +} + diff --git a/lib/gen/policy/objects_pb.ts b/lib/gen/policy/objects_pb.ts new file mode 100644 index 00000000..5f6ecc15 --- /dev/null +++ b/lib/gen/policy/objects_pb.ts @@ -0,0 +1,957 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file policy/objects.proto (package policy, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { BoolValue, Message, proto3 } from "@bufbuild/protobuf"; +import { Metadata } from "../common/common_pb.js"; + +/** + * buflint ENUM_VALUE_PREFIX: to make sure that C++ scoping rules aren't violated when users add new enum values to an enum in a given package + * + * @generated from enum policy.AttributeRuleTypeEnum + */ +export enum AttributeRuleTypeEnum { + /** + * @generated from enum value: ATTRIBUTE_RULE_TYPE_ENUM_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF = 1; + */ + ALL_OF = 1, + + /** + * @generated from enum value: ATTRIBUTE_RULE_TYPE_ENUM_ANY_OF = 2; + */ + ANY_OF = 2, + + /** + * @generated from enum value: ATTRIBUTE_RULE_TYPE_ENUM_HIERARCHY = 3; + */ + HIERARCHY = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(AttributeRuleTypeEnum) +proto3.util.setEnumType(AttributeRuleTypeEnum, "policy.AttributeRuleTypeEnum", [ + { no: 0, name: "ATTRIBUTE_RULE_TYPE_ENUM_UNSPECIFIED" }, + { no: 1, name: "ATTRIBUTE_RULE_TYPE_ENUM_ALL_OF" }, + { no: 2, name: "ATTRIBUTE_RULE_TYPE_ENUM_ANY_OF" }, + { no: 3, name: "ATTRIBUTE_RULE_TYPE_ENUM_HIERARCHY" }, +]); + +/** + * buflint ENUM_VALUE_PREFIX: to make sure that C++ scoping rules aren't violated when users add new enum values to an enum in a given package + * + * @generated from enum policy.SubjectMappingOperatorEnum + */ +export enum SubjectMappingOperatorEnum { + /** + * @generated from enum value: SUBJECT_MAPPING_OPERATOR_ENUM_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SUBJECT_MAPPING_OPERATOR_ENUM_IN = 1; + */ + IN = 1, + + /** + * @generated from enum value: SUBJECT_MAPPING_OPERATOR_ENUM_NOT_IN = 2; + */ + NOT_IN = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SubjectMappingOperatorEnum) +proto3.util.setEnumType(SubjectMappingOperatorEnum, "policy.SubjectMappingOperatorEnum", [ + { no: 0, name: "SUBJECT_MAPPING_OPERATOR_ENUM_UNSPECIFIED" }, + { no: 1, name: "SUBJECT_MAPPING_OPERATOR_ENUM_IN" }, + { no: 2, name: "SUBJECT_MAPPING_OPERATOR_ENUM_NOT_IN" }, +]); + +/** + * buflint ENUM_VALUE_PREFIX: to make sure that C++ scoping rules aren't violated when users add new enum values to an enum in a given package + * + * @generated from enum policy.ConditionBooleanTypeEnum + */ +export enum ConditionBooleanTypeEnum { + /** + * @generated from enum value: CONDITION_BOOLEAN_TYPE_ENUM_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CONDITION_BOOLEAN_TYPE_ENUM_AND = 1; + */ + AND = 1, + + /** + * @generated from enum value: CONDITION_BOOLEAN_TYPE_ENUM_OR = 2; + */ + OR = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(ConditionBooleanTypeEnum) +proto3.util.setEnumType(ConditionBooleanTypeEnum, "policy.ConditionBooleanTypeEnum", [ + { no: 0, name: "CONDITION_BOOLEAN_TYPE_ENUM_UNSPECIFIED" }, + { no: 1, name: "CONDITION_BOOLEAN_TYPE_ENUM_AND" }, + { no: 2, name: "CONDITION_BOOLEAN_TYPE_ENUM_OR" }, +]); + +/** + * @generated from message policy.Namespace + */ +export class Namespace extends Message { + /** + * generated uuid in database + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * used to partition Attribute Definitions, support by namespace AuthN and enable federation + * + * @generated from field: string name = 2; + */ + name = ""; + + /** + * @generated from field: string fqn = 3; + */ + fqn = ""; + + /** + * active by default until explicitly deactivated + * + * @generated from field: google.protobuf.BoolValue active = 4; + */ + active?: boolean; + + /** + * @generated from field: common.Metadata metadata = 5; + */ + metadata?: Metadata; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.Namespace"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "fqn", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "active", kind: "message", T: BoolValue }, + { no: 5, name: "metadata", kind: "message", T: Metadata }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Namespace { + return new Namespace().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Namespace { + return new Namespace().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Namespace { + return new Namespace().fromJsonString(jsonString, options); + } + + static equals(a: Namespace | PlainMessage | undefined, b: Namespace | PlainMessage | undefined): boolean { + return proto3.util.equals(Namespace, a, b); + } +} + +/** + * @generated from message policy.Attribute + */ +export class Attribute extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * namespace of the attribute + * + * @generated from field: policy.Namespace namespace = 2; + */ + namespace?: Namespace; + + /** + * attribute name + * + * @generated from field: string name = 3; + */ + name = ""; + + /** + * attribute rule enum + * + * @generated from field: policy.AttributeRuleTypeEnum rule = 4; + */ + rule = AttributeRuleTypeEnum.UNSPECIFIED; + + /** + * @generated from field: repeated policy.Value values = 5; + */ + values: Value[] = []; + + /** + * @generated from field: repeated policy.KeyAccessServer grants = 6; + */ + grants: KeyAccessServer[] = []; + + /** + * @generated from field: string fqn = 7; + */ + fqn = ""; + + /** + * active by default until explicitly deactivated + * + * @generated from field: google.protobuf.BoolValue active = 8; + */ + active?: boolean; + + /** + * Common metadata + * + * @generated from field: common.Metadata metadata = 100; + */ + metadata?: Metadata; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.Attribute"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "namespace", kind: "message", T: Namespace }, + { no: 3, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "rule", kind: "enum", T: proto3.getEnumType(AttributeRuleTypeEnum) }, + { no: 5, name: "values", kind: "message", T: Value, repeated: true }, + { no: 6, name: "grants", kind: "message", T: KeyAccessServer, repeated: true }, + { no: 7, name: "fqn", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "active", kind: "message", T: BoolValue }, + { no: 100, name: "metadata", kind: "message", T: Metadata }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Attribute { + return new Attribute().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Attribute { + return new Attribute().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Attribute { + return new Attribute().fromJsonString(jsonString, options); + } + + static equals(a: Attribute | PlainMessage | undefined, b: Attribute | PlainMessage | undefined): boolean { + return proto3.util.equals(Attribute, a, b); + } +} + +/** + * @generated from message policy.Value + */ +export class Value extends Message { + /** + * generated uuid in database + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: policy.Attribute attribute = 2; + */ + attribute?: Attribute; + + /** + * @generated from field: string value = 3; + */ + value = ""; + + /** + * list of attribute values that this value is related to (attribute group) + * + * @generated from field: repeated policy.Value members = 4; + */ + members: Value[] = []; + + /** + * list of key access servers + * + * @generated from field: repeated policy.KeyAccessServer grants = 5; + */ + grants: KeyAccessServer[] = []; + + /** + * @generated from field: string fqn = 6; + */ + fqn = ""; + + /** + * active by default until explicitly deactivated + * + * @generated from field: google.protobuf.BoolValue active = 7; + */ + active?: boolean; + + /** + * subject mapping + * + * @generated from field: repeated policy.SubjectMapping subject_mappings = 8; + */ + subjectMappings: SubjectMapping[] = []; + + /** + * Common metadata + * + * @generated from field: common.Metadata metadata = 100; + */ + metadata?: Metadata; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.Value"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "attribute", kind: "message", T: Attribute }, + { no: 3, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "members", kind: "message", T: Value, repeated: true }, + { no: 5, name: "grants", kind: "message", T: KeyAccessServer, repeated: true }, + { no: 6, name: "fqn", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "active", kind: "message", T: BoolValue }, + { no: 8, name: "subject_mappings", kind: "message", T: SubjectMapping, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: Metadata }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Value { + return new Value().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Value { + return new Value().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Value { + return new Value().fromJsonString(jsonString, options); + } + + static equals(a: Value | PlainMessage | undefined, b: Value | PlainMessage | undefined): boolean { + return proto3.util.equals(Value, a, b); + } +} + +/** + * An action an entity can take + * + * @generated from message policy.Action + */ +export class Action extends Message { + /** + * @generated from oneof policy.Action.value + */ + value: { + /** + * @generated from field: policy.Action.StandardAction standard = 1; + */ + value: Action_StandardAction; + case: "standard"; + } | { + /** + * @generated from field: string custom = 2; + */ + value: string; + case: "custom"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.Action"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "standard", kind: "enum", T: proto3.getEnumType(Action_StandardAction), oneof: "value" }, + { no: 2, name: "custom", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "value" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Action { + return new Action().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Action { + return new Action().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Action { + return new Action().fromJsonString(jsonString, options); + } + + static equals(a: Action | PlainMessage | undefined, b: Action | PlainMessage | undefined): boolean { + return proto3.util.equals(Action, a, b); + } +} + +/** + * Standard actions supported by the platform + * + * @generated from enum policy.Action.StandardAction + */ +export enum Action_StandardAction { + /** + * @generated from enum value: STANDARD_ACTION_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: STANDARD_ACTION_DECRYPT = 1; + */ + DECRYPT = 1, + + /** + * @generated from enum value: STANDARD_ACTION_TRANSMIT = 2; + */ + TRANSMIT = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(Action_StandardAction) +proto3.util.setEnumType(Action_StandardAction, "policy.Action.StandardAction", [ + { no: 0, name: "STANDARD_ACTION_UNSPECIFIED" }, + { no: 1, name: "STANDARD_ACTION_DECRYPT" }, + { no: 2, name: "STANDARD_ACTION_TRANSMIT" }, +]); + +/** + * + * Subject Mapping: A Policy assigning Subject Set(s) to a permitted attribute value + action(s) combination + * + * Example: Subjects in sets 1 and 2 are entitled attribute value http://wwww.example.org/attr/example/value/one + * with permitted actions TRANSMIT and DECRYPT + * { + * "id": "someid", + * "attribute_value": {example_one_attribute_value...}, + * "subject_condition_set": {"subject_sets":[{subject_set_1},{subject_set_2}]...}, + * "actions": [{"standard": "STANDARD_ACTION_DECRYPT"}", {"standard": "STANDARD_ACTION_TRANSMIT"}] + * } + * + * @generated from message policy.SubjectMapping + */ +export class SubjectMapping extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * the Attribute Value mapped to; aka: "The Entity Entitlement Attribute" + * + * @generated from field: policy.Value attribute_value = 2; + */ + attributeValue?: Value; + + /** + * the reusable SubjectConditionSet mapped to the given Attribute Value + * + * @generated from field: policy.SubjectConditionSet subject_condition_set = 3; + */ + subjectConditionSet?: SubjectConditionSet; + + /** + * The actions permitted by subjects in this mapping + * + * @generated from field: repeated policy.Action actions = 4; + */ + actions: Action[] = []; + + /** + * @generated from field: common.Metadata metadata = 100; + */ + metadata?: Metadata; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.SubjectMapping"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "attribute_value", kind: "message", T: Value }, + { no: 3, name: "subject_condition_set", kind: "message", T: SubjectConditionSet }, + { no: 4, name: "actions", kind: "message", T: Action, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: Metadata }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SubjectMapping { + return new SubjectMapping().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SubjectMapping { + return new SubjectMapping().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SubjectMapping { + return new SubjectMapping().fromJsonString(jsonString, options); + } + + static equals(a: SubjectMapping | PlainMessage | undefined, b: SubjectMapping | PlainMessage | undefined): boolean { + return proto3.util.equals(SubjectMapping, a, b); + } +} + +/** + * * + * A Condition defines a rule of + * + * Example: Subjects with a field selected by the flattened selector "'.division'" and a value of "Accounting" or "Marketing": + * { + * "subject_external_selector_value": "'.division'", + * "operator": "SUBJECT_MAPPING_OPERATOR_ENUM_IN", + * "subject_external_values" : ["Accounting", "Marketing"] + * } + * + * Example: Subjects that are not part of the Fantastic Four according to their alias field: + * { + * "subject_external_selector_value": "'.data[0].alias'", + * "operator": "SUBJECT_MAPPING_OPERATOR_ENUM_NOT_IN", + * "subject_external_values" : ["mister_fantastic", "the_thing", "human_torch", "invisible_woman"] + * } + * + * @generated from message policy.Condition + */ +export class Condition extends Message { + /** + * a selector for a field value on a flattened Entity Representation (such as from idP/LDAP) + * + * @generated from field: string subject_external_selector_value = 1; + */ + subjectExternalSelectorValue = ""; + + /** + * the evaluation operator of relation + * + * @generated from field: policy.SubjectMappingOperatorEnum operator = 2; + */ + operator = SubjectMappingOperatorEnum.UNSPECIFIED; + + /** + * list of comparison values for the result of applying the subject_external_selector_value on a flattened Entity Representation (Subject), evaluated by the operator + * + * @generated from field: repeated string subject_external_values = 3; + */ + subjectExternalValues: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.Condition"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_external_selector_value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "operator", kind: "enum", T: proto3.getEnumType(SubjectMappingOperatorEnum) }, + { no: 3, name: "subject_external_values", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Condition { + return new Condition().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Condition { + return new Condition().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Condition { + return new Condition().fromJsonString(jsonString, options); + } + + static equals(a: Condition | PlainMessage | undefined, b: Condition | PlainMessage | undefined): boolean { + return proto3.util.equals(Condition, a, b); + } +} + +/** + * A collection of Conditions evaluated by the boolean_operator provided + * + * @generated from message policy.ConditionGroup + */ +export class ConditionGroup extends Message { + /** + * @generated from field: repeated policy.Condition conditions = 1; + */ + conditions: Condition[] = []; + + /** + * the boolean evaluation type across the conditions + * + * @generated from field: policy.ConditionBooleanTypeEnum boolean_operator = 2; + */ + booleanOperator = ConditionBooleanTypeEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.ConditionGroup"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "conditions", kind: "message", T: Condition, repeated: true }, + { no: 2, name: "boolean_operator", kind: "enum", T: proto3.getEnumType(ConditionBooleanTypeEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConditionGroup { + return new ConditionGroup().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConditionGroup { + return new ConditionGroup().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConditionGroup { + return new ConditionGroup().fromJsonString(jsonString, options); + } + + static equals(a: ConditionGroup | PlainMessage | undefined, b: ConditionGroup | PlainMessage | undefined): boolean { + return proto3.util.equals(ConditionGroup, a, b); + } +} + +/** + * A collection of Condition Groups + * + * @generated from message policy.SubjectSet + */ +export class SubjectSet extends Message { + /** + * multiple Condition Groups are evaluated with AND logic + * + * @generated from field: repeated policy.ConditionGroup condition_groups = 1; + */ + conditionGroups: ConditionGroup[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.SubjectSet"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "condition_groups", kind: "message", T: ConditionGroup, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SubjectSet { + return new SubjectSet().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SubjectSet { + return new SubjectSet().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SubjectSet { + return new SubjectSet().fromJsonString(jsonString, options); + } + + static equals(a: SubjectSet | PlainMessage | undefined, b: SubjectSet | PlainMessage | undefined): boolean { + return proto3.util.equals(SubjectSet, a, b); + } +} + +/** + * + * A container for multiple Subject Sets, each containing Condition Groups, each containing Conditions. Multiple Subject Sets in a SubjectConditionSet + * are evaluated with AND logic. As each Subject Mapping has only one Attribute Value, the SubjectConditionSet is reusable across multiple + * Subject Mappings / Attribute Values and is an independent unit. + * + * @generated from message policy.SubjectConditionSet + */ +export class SubjectConditionSet extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: repeated policy.SubjectSet subject_sets = 3; + */ + subjectSets: SubjectSet[] = []; + + /** + * @generated from field: common.Metadata metadata = 100; + */ + metadata?: Metadata; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.SubjectConditionSet"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "subject_sets", kind: "message", T: SubjectSet, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: Metadata }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SubjectConditionSet { + return new SubjectConditionSet().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SubjectConditionSet { + return new SubjectConditionSet().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SubjectConditionSet { + return new SubjectConditionSet().fromJsonString(jsonString, options); + } + + static equals(a: SubjectConditionSet | PlainMessage | undefined, b: SubjectConditionSet | PlainMessage | undefined): boolean { + return proto3.util.equals(SubjectConditionSet, a, b); + } +} + +/** + * + * + * A property of a Subject/Entity as its selector expression -> value result pair. This would mirror external user attributes retrieved + * from an authoritative source such as an IDP (Identity Provider) or User Store. Examples include such ADFS/LDAP, OKTA, etc. + * For now, a valid property must contain both a selector expression & a resulting value. + * + * The external_selector_value is a specifier to select a value from a flattened external representation of an Entity (such as from idP/LDAP), + * and the external_value is the value selected by the external_selector_value on that Entity Representation (Subject Context). These mirror the Condition. + * + * @generated from message policy.SubjectProperty + */ +export class SubjectProperty extends Message { + /** + * @generated from field: string external_selector_value = 1; + */ + externalSelectorValue = ""; + + /** + * @generated from field: string external_value = 2; + */ + externalValue = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.SubjectProperty"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "external_selector_value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "external_value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SubjectProperty { + return new SubjectProperty().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SubjectProperty { + return new SubjectProperty().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SubjectProperty { + return new SubjectProperty().fromJsonString(jsonString, options); + } + + static equals(a: SubjectProperty | PlainMessage | undefined, b: SubjectProperty | PlainMessage | undefined): boolean { + return proto3.util.equals(SubjectProperty, a, b); + } +} + +/** + * + * Resource Mappings (aka Access Control Resource Encodings aka ACRE) are structures supporting the mapping of Resources and Attribute Values + * + * @generated from message policy.ResourceMapping + */ +export class ResourceMapping extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: common.Metadata metadata = 2; + */ + metadata?: Metadata; + + /** + * @generated from field: policy.Value attribute_value = 3; + */ + attributeValue?: Value; + + /** + * @generated from field: repeated string terms = 4; + */ + terms: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.ResourceMapping"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "metadata", kind: "message", T: Metadata }, + { no: 3, name: "attribute_value", kind: "message", T: Value }, + { no: 4, name: "terms", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResourceMapping { + return new ResourceMapping().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResourceMapping { + return new ResourceMapping().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResourceMapping { + return new ResourceMapping().fromJsonString(jsonString, options); + } + + static equals(a: ResourceMapping | PlainMessage | undefined, b: ResourceMapping | PlainMessage | undefined): boolean { + return proto3.util.equals(ResourceMapping, a, b); + } +} + +/** + * + * Key Access Server Registry + * + * @generated from message policy.KeyAccessServer + */ +export class KeyAccessServer extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Address of a KAS instance + * + * @generated from field: string uri = 2; + */ + uri = ""; + + /** + * @generated from field: policy.PublicKey public_key = 3; + */ + publicKey?: PublicKey; + + /** + * Common metadata + * + * @generated from field: common.Metadata metadata = 100; + */ + metadata?: Metadata; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.KeyAccessServer"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "uri", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "public_key", kind: "message", T: PublicKey }, + { no: 100, name: "metadata", kind: "message", T: Metadata }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): KeyAccessServer { + return new KeyAccessServer().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): KeyAccessServer { + return new KeyAccessServer().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): KeyAccessServer { + return new KeyAccessServer().fromJsonString(jsonString, options); + } + + static equals(a: KeyAccessServer | PlainMessage | undefined, b: KeyAccessServer | PlainMessage | undefined): boolean { + return proto3.util.equals(KeyAccessServer, a, b); + } +} + +/** + * @generated from message policy.PublicKey + */ +export class PublicKey extends Message { + /** + * @generated from oneof policy.PublicKey.public_key + */ + publicKey: { + /** + * kas public key url - optional since can also be retrieved via public key + * + * @generated from field: string remote = 1; + */ + value: string; + case: "remote"; + } | { + /** + * public key - optional since can also be retrieved via url + * + * @generated from field: string local = 2; + */ + value: string; + case: "local"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.PublicKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "remote", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "public_key" }, + { no: 2, name: "local", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "public_key" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PublicKey { + return new PublicKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PublicKey { + return new PublicKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PublicKey { + return new PublicKey().fromJsonString(jsonString, options); + } + + static equals(a: PublicKey | PlainMessage | undefined, b: PublicKey | PlainMessage | undefined): boolean { + return proto3.util.equals(PublicKey, a, b); + } +} + diff --git a/lib/gen/policy/resourcemapping/resource_mapping_connect.ts b/lib/gen/policy/resourcemapping/resource_mapping_connect.ts new file mode 100644 index 00000000..bf5a46e3 --- /dev/null +++ b/lib/gen/policy/resourcemapping/resource_mapping_connect.ts @@ -0,0 +1,259 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file policy/resourcemapping/resource_mapping.proto (package policy.resourcemapping, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CreateResourceMappingRequest, CreateResourceMappingResponse, DeleteResourceMappingRequest, DeleteResourceMappingResponse, GetResourceMappingRequest, GetResourceMappingResponse, ListResourceMappingsRequest, ListResourceMappingsResponse, UpdateResourceMappingRequest, UpdateResourceMappingResponse } from "./resource_mapping_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * + * Resource Mappings + * + * @generated from service policy.resourcemapping.ResourceMappingService + */ +export const ResourceMappingService = { + typeName: "policy.resourcemapping.ResourceMappingService", + methods: { + /** + * + * Request Example: + * - empty body + * + * Response Example: + * { + * "resource_mappings": [ + * { + * "terms": [ + * "TOPSECRET", + * "TS", + * ], + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e", + * "metadata": { + * "labels": [], + * "created_at": { + * "seconds": "1706103276", + * "nanos": 510718000 + * }, + * "updated_at": { + * "seconds": "1706107873", + * "nanos": 399786000 + * }, + * "description": "" + * }, + * "attribute_value": { + * "members": [], + * "id": "f0d1d4f6-bff9-45fd-8170-607b6b559349", + * "metadata": null, + * "attribute_id": "", + * "value": "value1" + * } + * } + * ] + * } + * + * @generated from rpc policy.resourcemapping.ResourceMappingService.ListResourceMappings + */ + listResourceMappings: { + name: "ListResourceMappings", + I: ListResourceMappingsRequest, + O: ListResourceMappingsResponse, + kind: MethodKind.Unary, + }, + /** + * + * Request Example: + * { + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e" + * } + * + * Response Example: + * { + * "resource_mapping": { + * "terms": [ + * "TOPSECRET", + * "TS", + * ], + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e", + * "metadata": { + * "labels": [], + * "created_at": { + * "seconds": "1706103276", + * "nanos": 510718000 + * }, + * "updated_at": { + * "seconds": "1706107873", + * "nanos": 399786000 + * }, + * "description": "" + * }, + * "attribute_value": { + * "members": [], + * "id": "f0d1d4f6-bff9-45fd-8170-607b6b559349", + * "metadata": null, + * "attribute_id": "", + * "value": "value1" + * } + * } + * } + * + * @generated from rpc policy.resourcemapping.ResourceMappingService.GetResourceMapping + */ + getResourceMapping: { + name: "GetResourceMapping", + I: GetResourceMappingRequest, + O: GetResourceMappingResponse, + kind: MethodKind.Unary, + }, + /** + * + * Request Example: + * { + * "resource_mapping": { + * "attribute_value_id": "f0d1d4f6-bff9-45fd-8170-607b6b559349", + * "terms": [ + * "TOPSECRET", + * "TS", + * ] + * } + * } + * + * Response Example: + * { + * "resource_mapping": { + * "terms": [ + * "TOPSECRET", + * "TS", + * ], + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e", + * "metadata": { + * "labels": [], + * "created_at": { + * "seconds": "1706103276", + * "nanos": 510718000 + * }, + * "updated_at": { + * "seconds": "1706107873", + * "nanos": 399786000 + * }, + * "description": "" + * }, + * "attribute_value": { + * "members": [], + * "id": "f0d1d4f6-bff9-45fd-8170-607b6b559349", + * "metadata": null, + * "attribute_id": "", + * "value": "value1" + * } + * } + * } + * + * @generated from rpc policy.resourcemapping.ResourceMappingService.CreateResourceMapping + */ + createResourceMapping: { + name: "CreateResourceMapping", + I: CreateResourceMappingRequest, + O: CreateResourceMappingResponse, + kind: MethodKind.Unary, + }, + /** + * + * Request Example: + * { + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e", + * "resource_mapping": { + * "attribute_value_id": "f0d1d4f6-bff9-45fd-8170-607b6b559349", + * "terms": [ + * "TOPSECRET", + * "TS", + * "NEWTERM" + * ] + * } + * } + * + * Response Example: + * { + * "resource_mapping": { + * "terms": [ + * "TOPSECRET", + * "TS", + * ], + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e", + * "metadata": { + * "labels": [], + * "created_at": { + * "seconds": "1706103276", + * "nanos": 510718000 + * }, + * "updated_at": { + * "seconds": "1706107873", + * "nanos": 399786000 + * }, + * "description": "" + * }, + * "attribute_value": { + * "members": [], + * "id": "f0d1d4f6-bff9-45fd-8170-607b6b559349", + * "metadata": null, + * "attribute_id": "", + * "value": "value1" + * } + * } + * } + * + * @generated from rpc policy.resourcemapping.ResourceMappingService.UpdateResourceMapping + */ + updateResourceMapping: { + name: "UpdateResourceMapping", + I: UpdateResourceMappingRequest, + O: UpdateResourceMappingResponse, + kind: MethodKind.Unary, + }, + /** + * + * Request Example: + * { + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e" + * } + * + * Response Example: + * { + * "resource_mapping": { + * "terms": [ + * "TOPSECRET", + * "TS", + * ], + * "id": "3c649464-95b4-4fe0-a09c-ca4b1fecbb0e", + * "metadata": { + * "labels": [], + * "created_at": { + * "seconds": "1706103276", + * "nanos": 510718000 + * }, + * "updated_at": { + * "seconds": "1706107873", + * "nanos": 399786000 + * }, + * "description": "" + * }, + * "attribute_value": { + * "members": [], + * "id": "f0d1d4f6-bff9-45fd-8170-607b6b559349", + * "metadata": null, + * "attribute_id": "", + * "value": "value1" + * } + * } + * } + * + * @generated from rpc policy.resourcemapping.ResourceMappingService.DeleteResourceMapping + */ + deleteResourceMapping: { + name: "DeleteResourceMapping", + I: DeleteResourceMappingRequest, + O: DeleteResourceMappingResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/policy/resourcemapping/resource_mapping_pb.ts b/lib/gen/policy/resourcemapping/resource_mapping_pb.ts new file mode 100644 index 00000000..300167b5 --- /dev/null +++ b/lib/gen/policy/resourcemapping/resource_mapping_pb.ts @@ -0,0 +1,449 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file policy/resourcemapping/resource_mapping.proto (package policy.resourcemapping, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { ResourceMapping } from "../objects_pb.js"; +import { MetadataMutable, MetadataUpdateEnum } from "../../common/common_pb.js"; + +/** + * @generated from message policy.resourcemapping.ListResourceMappingsRequest + */ +export class ListResourceMappingsRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.ListResourceMappingsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListResourceMappingsRequest { + return new ListResourceMappingsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListResourceMappingsRequest { + return new ListResourceMappingsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListResourceMappingsRequest { + return new ListResourceMappingsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListResourceMappingsRequest | PlainMessage | undefined, b: ListResourceMappingsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListResourceMappingsRequest, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.ListResourceMappingsResponse + */ +export class ListResourceMappingsResponse extends Message { + /** + * @generated from field: repeated policy.ResourceMapping resource_mappings = 1; + */ + resourceMappings: ResourceMapping[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.ListResourceMappingsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource_mappings", kind: "message", T: ResourceMapping, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListResourceMappingsResponse { + return new ListResourceMappingsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListResourceMappingsResponse { + return new ListResourceMappingsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListResourceMappingsResponse { + return new ListResourceMappingsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListResourceMappingsResponse | PlainMessage | undefined, b: ListResourceMappingsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListResourceMappingsResponse, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.GetResourceMappingRequest + */ +export class GetResourceMappingRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.GetResourceMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetResourceMappingRequest { + return new GetResourceMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetResourceMappingRequest { + return new GetResourceMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetResourceMappingRequest { + return new GetResourceMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetResourceMappingRequest | PlainMessage | undefined, b: GetResourceMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetResourceMappingRequest, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.GetResourceMappingResponse + */ +export class GetResourceMappingResponse extends Message { + /** + * @generated from field: policy.ResourceMapping resource_mapping = 1; + */ + resourceMapping?: ResourceMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.GetResourceMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource_mapping", kind: "message", T: ResourceMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetResourceMappingResponse { + return new GetResourceMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetResourceMappingResponse { + return new GetResourceMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetResourceMappingResponse { + return new GetResourceMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetResourceMappingResponse | PlainMessage | undefined, b: GetResourceMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetResourceMappingResponse, a, b); + } +} + +/** + * + * ### Request + * + * grpcurl -plaintext -d @ localhost:8080 policy.resourcemapping.ResourceMappingService/CreateResourceMapping < { + /** + * Required + * + * @generated from field: string attribute_value_id = 1; + */ + attributeValueId = ""; + + /** + * @generated from field: repeated string terms = 2; + */ + terms: string[] = []; + + /** + * Optional + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.CreateResourceMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_value_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "terms", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateResourceMappingRequest { + return new CreateResourceMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateResourceMappingRequest { + return new CreateResourceMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateResourceMappingRequest { + return new CreateResourceMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateResourceMappingRequest | PlainMessage | undefined, b: CreateResourceMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateResourceMappingRequest, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.CreateResourceMappingResponse + */ +export class CreateResourceMappingResponse extends Message { + /** + * @generated from field: policy.ResourceMapping resource_mapping = 1; + */ + resourceMapping?: ResourceMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.CreateResourceMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource_mapping", kind: "message", T: ResourceMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateResourceMappingResponse { + return new CreateResourceMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateResourceMappingResponse { + return new CreateResourceMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateResourceMappingResponse { + return new CreateResourceMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateResourceMappingResponse | PlainMessage | undefined, b: CreateResourceMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateResourceMappingResponse, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.UpdateResourceMappingRequest + */ +export class UpdateResourceMappingRequest extends Message { + /** + * Required + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Optional + * + * @generated from field: string attribute_value_id = 4; + */ + attributeValueId = ""; + + /** + * @generated from field: repeated string terms = 5; + */ + terms: string[] = []; + + /** + * Common Metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + /** + * @generated from field: common.MetadataUpdateEnum metadata_update_behavior = 101; + */ + metadataUpdateBehavior = MetadataUpdateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.UpdateResourceMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "attribute_value_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "terms", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + { no: 101, name: "metadata_update_behavior", kind: "enum", T: proto3.getEnumType(MetadataUpdateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateResourceMappingRequest { + return new UpdateResourceMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateResourceMappingRequest { + return new UpdateResourceMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateResourceMappingRequest { + return new UpdateResourceMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateResourceMappingRequest | PlainMessage | undefined, b: UpdateResourceMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateResourceMappingRequest, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.UpdateResourceMappingResponse + */ +export class UpdateResourceMappingResponse extends Message { + /** + * @generated from field: policy.ResourceMapping resource_mapping = 1; + */ + resourceMapping?: ResourceMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.UpdateResourceMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource_mapping", kind: "message", T: ResourceMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateResourceMappingResponse { + return new UpdateResourceMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateResourceMappingResponse { + return new UpdateResourceMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateResourceMappingResponse { + return new UpdateResourceMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateResourceMappingResponse | PlainMessage | undefined, b: UpdateResourceMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateResourceMappingResponse, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.DeleteResourceMappingRequest + */ +export class DeleteResourceMappingRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.DeleteResourceMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteResourceMappingRequest { + return new DeleteResourceMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteResourceMappingRequest { + return new DeleteResourceMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteResourceMappingRequest { + return new DeleteResourceMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteResourceMappingRequest | PlainMessage | undefined, b: DeleteResourceMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteResourceMappingRequest, a, b); + } +} + +/** + * @generated from message policy.resourcemapping.DeleteResourceMappingResponse + */ +export class DeleteResourceMappingResponse extends Message { + /** + * @generated from field: policy.ResourceMapping resource_mapping = 1; + */ + resourceMapping?: ResourceMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.resourcemapping.DeleteResourceMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "resource_mapping", kind: "message", T: ResourceMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteResourceMappingResponse { + return new DeleteResourceMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteResourceMappingResponse { + return new DeleteResourceMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteResourceMappingResponse { + return new DeleteResourceMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteResourceMappingResponse | PlainMessage | undefined, b: DeleteResourceMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteResourceMappingResponse, a, b); + } +} + diff --git a/lib/gen/policy/selectors_pb.ts b/lib/gen/policy/selectors_pb.ts new file mode 100644 index 00000000..758316e4 --- /dev/null +++ b/lib/gen/policy/selectors_pb.ts @@ -0,0 +1,395 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file policy/selectors.proto (package policy, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message policy.AttributeNamespaceSelector + */ +export class AttributeNamespaceSelector extends Message { + /** + * @generated from field: policy.AttributeNamespaceSelector.AttributeSelector with_attributes = 10; + */ + withAttributes?: AttributeNamespaceSelector_AttributeSelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeNamespaceSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 10, name: "with_attributes", kind: "message", T: AttributeNamespaceSelector_AttributeSelector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeNamespaceSelector { + return new AttributeNamespaceSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeNamespaceSelector { + return new AttributeNamespaceSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeNamespaceSelector { + return new AttributeNamespaceSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeNamespaceSelector | PlainMessage | undefined, b: AttributeNamespaceSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeNamespaceSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeNamespaceSelector.AttributeSelector + */ +export class AttributeNamespaceSelector_AttributeSelector extends Message { + /** + * @generated from field: bool with_key_access_grants = 1; + */ + withKeyAccessGrants = false; + + /** + * @generated from field: policy.AttributeNamespaceSelector.AttributeSelector.ValueSelector with_values = 10; + */ + withValues?: AttributeNamespaceSelector_AttributeSelector_ValueSelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeNamespaceSelector.AttributeSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "with_key_access_grants", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "with_values", kind: "message", T: AttributeNamespaceSelector_AttributeSelector_ValueSelector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeNamespaceSelector_AttributeSelector { + return new AttributeNamespaceSelector_AttributeSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeNamespaceSelector_AttributeSelector { + return new AttributeNamespaceSelector_AttributeSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeNamespaceSelector_AttributeSelector { + return new AttributeNamespaceSelector_AttributeSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeNamespaceSelector_AttributeSelector | PlainMessage | undefined, b: AttributeNamespaceSelector_AttributeSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeNamespaceSelector_AttributeSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeNamespaceSelector.AttributeSelector.ValueSelector + */ +export class AttributeNamespaceSelector_AttributeSelector_ValueSelector extends Message { + /** + * @generated from field: bool with_key_access_grants = 1; + */ + withKeyAccessGrants = false; + + /** + * @generated from field: bool with_subject_maps = 2; + */ + withSubjectMaps = false; + + /** + * @generated from field: bool with_resource_maps = 3; + */ + withResourceMaps = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeNamespaceSelector.AttributeSelector.ValueSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "with_key_access_grants", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "with_subject_maps", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "with_resource_maps", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeNamespaceSelector_AttributeSelector_ValueSelector { + return new AttributeNamespaceSelector_AttributeSelector_ValueSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeNamespaceSelector_AttributeSelector_ValueSelector { + return new AttributeNamespaceSelector_AttributeSelector_ValueSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeNamespaceSelector_AttributeSelector_ValueSelector { + return new AttributeNamespaceSelector_AttributeSelector_ValueSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeNamespaceSelector_AttributeSelector_ValueSelector | PlainMessage | undefined, b: AttributeNamespaceSelector_AttributeSelector_ValueSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeNamespaceSelector_AttributeSelector_ValueSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeDefinitionSelector + */ +export class AttributeDefinitionSelector extends Message { + /** + * @generated from field: bool with_key_access_grants = 1; + */ + withKeyAccessGrants = false; + + /** + * @generated from field: policy.AttributeDefinitionSelector.NamespaceSelector with_namespace = 10; + */ + withNamespace?: AttributeDefinitionSelector_NamespaceSelector; + + /** + * @generated from field: policy.AttributeDefinitionSelector.ValueSelector with_values = 11; + */ + withValues?: AttributeDefinitionSelector_ValueSelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeDefinitionSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "with_key_access_grants", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "with_namespace", kind: "message", T: AttributeDefinitionSelector_NamespaceSelector }, + { no: 11, name: "with_values", kind: "message", T: AttributeDefinitionSelector_ValueSelector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeDefinitionSelector { + return new AttributeDefinitionSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeDefinitionSelector { + return new AttributeDefinitionSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeDefinitionSelector { + return new AttributeDefinitionSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeDefinitionSelector | PlainMessage | undefined, b: AttributeDefinitionSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeDefinitionSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeDefinitionSelector.NamespaceSelector + */ +export class AttributeDefinitionSelector_NamespaceSelector extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeDefinitionSelector.NamespaceSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeDefinitionSelector_NamespaceSelector { + return new AttributeDefinitionSelector_NamespaceSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeDefinitionSelector_NamespaceSelector { + return new AttributeDefinitionSelector_NamespaceSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeDefinitionSelector_NamespaceSelector { + return new AttributeDefinitionSelector_NamespaceSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeDefinitionSelector_NamespaceSelector | PlainMessage | undefined, b: AttributeDefinitionSelector_NamespaceSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeDefinitionSelector_NamespaceSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeDefinitionSelector.ValueSelector + */ +export class AttributeDefinitionSelector_ValueSelector extends Message { + /** + * @generated from field: bool with_key_access_grants = 1; + */ + withKeyAccessGrants = false; + + /** + * @generated from field: bool with_subject_maps = 2; + */ + withSubjectMaps = false; + + /** + * @generated from field: bool with_resource_maps = 3; + */ + withResourceMaps = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeDefinitionSelector.ValueSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "with_key_access_grants", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "with_subject_maps", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "with_resource_maps", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeDefinitionSelector_ValueSelector { + return new AttributeDefinitionSelector_ValueSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeDefinitionSelector_ValueSelector { + return new AttributeDefinitionSelector_ValueSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeDefinitionSelector_ValueSelector { + return new AttributeDefinitionSelector_ValueSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeDefinitionSelector_ValueSelector | PlainMessage | undefined, b: AttributeDefinitionSelector_ValueSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeDefinitionSelector_ValueSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeValueSelector + */ +export class AttributeValueSelector extends Message { + /** + * @generated from field: bool with_key_access_grants = 1; + */ + withKeyAccessGrants = false; + + /** + * @generated from field: bool with_subject_maps = 2; + */ + withSubjectMaps = false; + + /** + * @generated from field: bool with_resource_maps = 3; + */ + withResourceMaps = false; + + /** + * @generated from field: policy.AttributeValueSelector.AttributeSelector with_attribute = 10; + */ + withAttribute?: AttributeValueSelector_AttributeSelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeValueSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "with_key_access_grants", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "with_subject_maps", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "with_resource_maps", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "with_attribute", kind: "message", T: AttributeValueSelector_AttributeSelector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeValueSelector { + return new AttributeValueSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeValueSelector { + return new AttributeValueSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeValueSelector { + return new AttributeValueSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeValueSelector | PlainMessage | undefined, b: AttributeValueSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeValueSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeValueSelector.AttributeSelector + */ +export class AttributeValueSelector_AttributeSelector extends Message { + /** + * @generated from field: bool with_key_access_grants = 1; + */ + withKeyAccessGrants = false; + + /** + * @generated from field: policy.AttributeValueSelector.AttributeSelector.NamespaceSelector with_namespace = 10; + */ + withNamespace?: AttributeValueSelector_AttributeSelector_NamespaceSelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeValueSelector.AttributeSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "with_key_access_grants", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "with_namespace", kind: "message", T: AttributeValueSelector_AttributeSelector_NamespaceSelector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeValueSelector_AttributeSelector { + return new AttributeValueSelector_AttributeSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeValueSelector_AttributeSelector { + return new AttributeValueSelector_AttributeSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeValueSelector_AttributeSelector { + return new AttributeValueSelector_AttributeSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeValueSelector_AttributeSelector | PlainMessage | undefined, b: AttributeValueSelector_AttributeSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeValueSelector_AttributeSelector, a, b); + } +} + +/** + * @generated from message policy.AttributeValueSelector.AttributeSelector.NamespaceSelector + */ +export class AttributeValueSelector_AttributeSelector_NamespaceSelector extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.AttributeValueSelector.AttributeSelector.NamespaceSelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AttributeValueSelector_AttributeSelector_NamespaceSelector { + return new AttributeValueSelector_AttributeSelector_NamespaceSelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AttributeValueSelector_AttributeSelector_NamespaceSelector { + return new AttributeValueSelector_AttributeSelector_NamespaceSelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AttributeValueSelector_AttributeSelector_NamespaceSelector { + return new AttributeValueSelector_AttributeSelector_NamespaceSelector().fromJsonString(jsonString, options); + } + + static equals(a: AttributeValueSelector_AttributeSelector_NamespaceSelector | PlainMessage | undefined, b: AttributeValueSelector_AttributeSelector_NamespaceSelector | PlainMessage | undefined): boolean { + return proto3.util.equals(AttributeValueSelector_AttributeSelector_NamespaceSelector, a, b); + } +} + diff --git a/lib/gen/policy/subjectmapping/subject_mapping_connect.ts b/lib/gen/policy/subjectmapping/subject_mapping_connect.ts new file mode 100644 index 00000000..a5b668e0 --- /dev/null +++ b/lib/gen/policy/subjectmapping/subject_mapping_connect.ts @@ -0,0 +1,118 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file policy/subjectmapping/subject_mapping.proto (package policy.subjectmapping, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CreateSubjectConditionSetRequest, CreateSubjectConditionSetResponse, CreateSubjectMappingRequest, CreateSubjectMappingResponse, DeleteSubjectConditionSetRequest, DeleteSubjectConditionSetResponse, DeleteSubjectMappingRequest, DeleteSubjectMappingResponse, GetSubjectConditionSetRequest, GetSubjectConditionSetResponse, GetSubjectMappingRequest, GetSubjectMappingResponse, ListSubjectConditionSetsRequest, ListSubjectConditionSetsResponse, ListSubjectMappingsRequest, ListSubjectMappingsResponse, MatchSubjectMappingsRequest, MatchSubjectMappingsResponse, UpdateSubjectConditionSetRequest, UpdateSubjectConditionSetResponse, UpdateSubjectMappingRequest, UpdateSubjectMappingResponse } from "./subject_mapping_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service policy.subjectmapping.SubjectMappingService + */ +export const SubjectMappingService = { + typeName: "policy.subjectmapping.SubjectMappingService", + methods: { + /** + * Find matching Subject Mappings for a given Subject + * + * @generated from rpc policy.subjectmapping.SubjectMappingService.MatchSubjectMappings + */ + matchSubjectMappings: { + name: "MatchSubjectMappings", + I: MatchSubjectMappingsRequest, + O: MatchSubjectMappingsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.ListSubjectMappings + */ + listSubjectMappings: { + name: "ListSubjectMappings", + I: ListSubjectMappingsRequest, + O: ListSubjectMappingsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.GetSubjectMapping + */ + getSubjectMapping: { + name: "GetSubjectMapping", + I: GetSubjectMappingRequest, + O: GetSubjectMappingResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.CreateSubjectMapping + */ + createSubjectMapping: { + name: "CreateSubjectMapping", + I: CreateSubjectMappingRequest, + O: CreateSubjectMappingResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.UpdateSubjectMapping + */ + updateSubjectMapping: { + name: "UpdateSubjectMapping", + I: UpdateSubjectMappingRequest, + O: UpdateSubjectMappingResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.DeleteSubjectMapping + */ + deleteSubjectMapping: { + name: "DeleteSubjectMapping", + I: DeleteSubjectMappingRequest, + O: DeleteSubjectMappingResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.ListSubjectConditionSets + */ + listSubjectConditionSets: { + name: "ListSubjectConditionSets", + I: ListSubjectConditionSetsRequest, + O: ListSubjectConditionSetsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.GetSubjectConditionSet + */ + getSubjectConditionSet: { + name: "GetSubjectConditionSet", + I: GetSubjectConditionSetRequest, + O: GetSubjectConditionSetResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.CreateSubjectConditionSet + */ + createSubjectConditionSet: { + name: "CreateSubjectConditionSet", + I: CreateSubjectConditionSetRequest, + O: CreateSubjectConditionSetResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.UpdateSubjectConditionSet + */ + updateSubjectConditionSet: { + name: "UpdateSubjectConditionSet", + I: UpdateSubjectConditionSetRequest, + O: UpdateSubjectConditionSetResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc policy.subjectmapping.SubjectMappingService.DeleteSubjectConditionSet + */ + deleteSubjectConditionSet: { + name: "DeleteSubjectConditionSet", + I: DeleteSubjectConditionSetRequest, + O: DeleteSubjectConditionSetResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/policy/subjectmapping/subject_mapping_pb.ts b/lib/gen/policy/subjectmapping/subject_mapping_pb.ts new file mode 100644 index 00000000..304ae675 --- /dev/null +++ b/lib/gen/policy/subjectmapping/subject_mapping_pb.ts @@ -0,0 +1,982 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file policy/subjectmapping/subject_mapping.proto (package policy.subjectmapping, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { Action, SubjectConditionSet, SubjectMapping, SubjectProperty, SubjectSet } from "../objects_pb.js"; +import { MetadataMutable, MetadataUpdateEnum } from "../../common/common_pb.js"; + +/** + * MatchSubjectMappingsRequest liberally returns a list of SubjectMappings based on the provided SubjectProperties. The SubjectMappings are returned + * if there is any single condition found among the structures that matches for one of the provided properties: + * 1. The external selector value, external value, and an IN operator + * 2. The external selector value, _no_ external value, and a NOT_IN operator + * + * Without this filtering, if a selector value was something like '.emailAddress' or '.username', every Subject is probably going to relate to that mapping + * in some way or another, potentially matching every single attribute in the DB if a policy admin has relied heavily on that field. There is no + * logic applied beyond a single condition within the query to avoid business logic interpreting the supplied conditions beyond the bare minimum + * initial filter. + * + * NOTE: if you have any issues, debug logs are available within the service to help identify why a mapping was or was not returned. + * + * @generated from message policy.subjectmapping.MatchSubjectMappingsRequest + */ +export class MatchSubjectMappingsRequest extends Message { + /** + * @generated from field: repeated policy.SubjectProperty subject_properties = 1; + */ + subjectProperties: SubjectProperty[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.MatchSubjectMappingsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_properties", kind: "message", T: SubjectProperty, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MatchSubjectMappingsRequest { + return new MatchSubjectMappingsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MatchSubjectMappingsRequest { + return new MatchSubjectMappingsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MatchSubjectMappingsRequest { + return new MatchSubjectMappingsRequest().fromJsonString(jsonString, options); + } + + static equals(a: MatchSubjectMappingsRequest | PlainMessage | undefined, b: MatchSubjectMappingsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(MatchSubjectMappingsRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.MatchSubjectMappingsResponse + */ +export class MatchSubjectMappingsResponse extends Message { + /** + * @generated from field: repeated policy.SubjectMapping subject_mappings = 1; + */ + subjectMappings: SubjectMapping[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.MatchSubjectMappingsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_mappings", kind: "message", T: SubjectMapping, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MatchSubjectMappingsResponse { + return new MatchSubjectMappingsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MatchSubjectMappingsResponse { + return new MatchSubjectMappingsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MatchSubjectMappingsResponse { + return new MatchSubjectMappingsResponse().fromJsonString(jsonString, options); + } + + static equals(a: MatchSubjectMappingsResponse | PlainMessage | undefined, b: MatchSubjectMappingsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(MatchSubjectMappingsResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.GetSubjectMappingRequest + */ +export class GetSubjectMappingRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.GetSubjectMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSubjectMappingRequest { + return new GetSubjectMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSubjectMappingRequest { + return new GetSubjectMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSubjectMappingRequest { + return new GetSubjectMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetSubjectMappingRequest | PlainMessage | undefined, b: GetSubjectMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSubjectMappingRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.GetSubjectMappingResponse + */ +export class GetSubjectMappingResponse extends Message { + /** + * @generated from field: policy.SubjectMapping subject_mapping = 1; + */ + subjectMapping?: SubjectMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.GetSubjectMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_mapping", kind: "message", T: SubjectMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSubjectMappingResponse { + return new GetSubjectMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSubjectMappingResponse { + return new GetSubjectMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSubjectMappingResponse { + return new GetSubjectMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetSubjectMappingResponse | PlainMessage | undefined, b: GetSubjectMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSubjectMappingResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.ListSubjectMappingsRequest + */ +export class ListSubjectMappingsRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.ListSubjectMappingsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListSubjectMappingsRequest { + return new ListSubjectMappingsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListSubjectMappingsRequest { + return new ListSubjectMappingsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListSubjectMappingsRequest { + return new ListSubjectMappingsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListSubjectMappingsRequest | PlainMessage | undefined, b: ListSubjectMappingsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListSubjectMappingsRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.ListSubjectMappingsResponse + */ +export class ListSubjectMappingsResponse extends Message { + /** + * @generated from field: repeated policy.SubjectMapping subject_mappings = 1; + */ + subjectMappings: SubjectMapping[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.ListSubjectMappingsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_mappings", kind: "message", T: SubjectMapping, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListSubjectMappingsResponse { + return new ListSubjectMappingsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListSubjectMappingsResponse { + return new ListSubjectMappingsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListSubjectMappingsResponse { + return new ListSubjectMappingsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListSubjectMappingsResponse | PlainMessage | undefined, b: ListSubjectMappingsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListSubjectMappingsResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.CreateSubjectMappingRequest + */ +export class CreateSubjectMappingRequest extends Message { + /** + * Required + * Attribute Value to be mapped to + * + * @generated from field: string attribute_value_id = 1; + */ + attributeValueId = ""; + + /** + * The actions permitted by subjects in this mapping + * + * @generated from field: repeated policy.Action actions = 2; + */ + actions: Action[] = []; + + /** + * Either of the following: + * Reuse existing SubjectConditionSet (NOTE: prioritized over new_subject_condition_set) + * + * @generated from field: string existing_subject_condition_set_id = 3; + */ + existingSubjectConditionSetId = ""; + + /** + * Create new SubjectConditionSet (NOTE: ignored if existing_subject_condition_set_id is provided) + * + * @generated from field: policy.subjectmapping.SubjectConditionSetCreate new_subject_condition_set = 4; + */ + newSubjectConditionSet?: SubjectConditionSetCreate; + + /** + * Optional + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.CreateSubjectMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "attribute_value_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "actions", kind: "message", T: Action, repeated: true }, + { no: 3, name: "existing_subject_condition_set_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "new_subject_condition_set", kind: "message", T: SubjectConditionSetCreate }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateSubjectMappingRequest { + return new CreateSubjectMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateSubjectMappingRequest { + return new CreateSubjectMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateSubjectMappingRequest { + return new CreateSubjectMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateSubjectMappingRequest | PlainMessage | undefined, b: CreateSubjectMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateSubjectMappingRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.CreateSubjectMappingResponse + */ +export class CreateSubjectMappingResponse extends Message { + /** + * @generated from field: policy.SubjectMapping subject_mapping = 1; + */ + subjectMapping?: SubjectMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.CreateSubjectMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_mapping", kind: "message", T: SubjectMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateSubjectMappingResponse { + return new CreateSubjectMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateSubjectMappingResponse { + return new CreateSubjectMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateSubjectMappingResponse { + return new CreateSubjectMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateSubjectMappingResponse | PlainMessage | undefined, b: CreateSubjectMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateSubjectMappingResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.UpdateSubjectMappingRequest + */ +export class UpdateSubjectMappingRequest extends Message { + /** + * Required + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Optional + * Replaces the existing SubjectConditionSet id with a new one + * + * @generated from field: string subject_condition_set_id = 2; + */ + subjectConditionSetId = ""; + + /** + * Replaces entire list of actions permitted by subjects + * + * @generated from field: repeated policy.Action actions = 3; + */ + actions: Action[] = []; + + /** + * Common metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + /** + * @generated from field: common.MetadataUpdateEnum metadata_update_behavior = 101; + */ + metadataUpdateBehavior = MetadataUpdateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.UpdateSubjectMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "subject_condition_set_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "actions", kind: "message", T: Action, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + { no: 101, name: "metadata_update_behavior", kind: "enum", T: proto3.getEnumType(MetadataUpdateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateSubjectMappingRequest { + return new UpdateSubjectMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateSubjectMappingRequest { + return new UpdateSubjectMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateSubjectMappingRequest { + return new UpdateSubjectMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateSubjectMappingRequest | PlainMessage | undefined, b: UpdateSubjectMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateSubjectMappingRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.UpdateSubjectMappingResponse + */ +export class UpdateSubjectMappingResponse extends Message { + /** + * Only ID of the updated Subject Mapping provided + * + * @generated from field: policy.SubjectMapping subject_mapping = 1; + */ + subjectMapping?: SubjectMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.UpdateSubjectMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_mapping", kind: "message", T: SubjectMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateSubjectMappingResponse { + return new UpdateSubjectMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateSubjectMappingResponse { + return new UpdateSubjectMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateSubjectMappingResponse { + return new UpdateSubjectMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateSubjectMappingResponse | PlainMessage | undefined, b: UpdateSubjectMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateSubjectMappingResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.DeleteSubjectMappingRequest + */ +export class DeleteSubjectMappingRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.DeleteSubjectMappingRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteSubjectMappingRequest { + return new DeleteSubjectMappingRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteSubjectMappingRequest { + return new DeleteSubjectMappingRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteSubjectMappingRequest { + return new DeleteSubjectMappingRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteSubjectMappingRequest | PlainMessage | undefined, b: DeleteSubjectMappingRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteSubjectMappingRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.DeleteSubjectMappingResponse + */ +export class DeleteSubjectMappingResponse extends Message { + /** + * Only ID of the updated Subject Mapping provided + * + * @generated from field: policy.SubjectMapping subject_mapping = 1; + */ + subjectMapping?: SubjectMapping; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.DeleteSubjectMappingResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_mapping", kind: "message", T: SubjectMapping }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteSubjectMappingResponse { + return new DeleteSubjectMappingResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteSubjectMappingResponse { + return new DeleteSubjectMappingResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteSubjectMappingResponse { + return new DeleteSubjectMappingResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteSubjectMappingResponse | PlainMessage | undefined, b: DeleteSubjectMappingResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteSubjectMappingResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.GetSubjectConditionSetRequest + */ +export class GetSubjectConditionSetRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.GetSubjectConditionSetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSubjectConditionSetRequest { + return new GetSubjectConditionSetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSubjectConditionSetRequest { + return new GetSubjectConditionSetRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSubjectConditionSetRequest { + return new GetSubjectConditionSetRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetSubjectConditionSetRequest | PlainMessage | undefined, b: GetSubjectConditionSetRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSubjectConditionSetRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.GetSubjectConditionSetResponse + */ +export class GetSubjectConditionSetResponse extends Message { + /** + * @generated from field: policy.SubjectConditionSet subject_condition_set = 1; + */ + subjectConditionSet?: SubjectConditionSet; + + /** + * contextualized Subject Mappings associated with this SubjectConditionSet + * + * @generated from field: repeated policy.SubjectMapping associated_subject_mappings = 2; + */ + associatedSubjectMappings: SubjectMapping[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.GetSubjectConditionSetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_condition_set", kind: "message", T: SubjectConditionSet }, + { no: 2, name: "associated_subject_mappings", kind: "message", T: SubjectMapping, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSubjectConditionSetResponse { + return new GetSubjectConditionSetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSubjectConditionSetResponse { + return new GetSubjectConditionSetResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSubjectConditionSetResponse { + return new GetSubjectConditionSetResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetSubjectConditionSetResponse | PlainMessage | undefined, b: GetSubjectConditionSetResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSubjectConditionSetResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.ListSubjectConditionSetsRequest + */ +export class ListSubjectConditionSetsRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.ListSubjectConditionSetsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListSubjectConditionSetsRequest { + return new ListSubjectConditionSetsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListSubjectConditionSetsRequest { + return new ListSubjectConditionSetsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListSubjectConditionSetsRequest { + return new ListSubjectConditionSetsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListSubjectConditionSetsRequest | PlainMessage | undefined, b: ListSubjectConditionSetsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListSubjectConditionSetsRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.ListSubjectConditionSetsResponse + */ +export class ListSubjectConditionSetsResponse extends Message { + /** + * @generated from field: repeated policy.SubjectConditionSet subject_condition_sets = 1; + */ + subjectConditionSets: SubjectConditionSet[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.ListSubjectConditionSetsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_condition_sets", kind: "message", T: SubjectConditionSet, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListSubjectConditionSetsResponse { + return new ListSubjectConditionSetsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListSubjectConditionSetsResponse { + return new ListSubjectConditionSetsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListSubjectConditionSetsResponse { + return new ListSubjectConditionSetsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListSubjectConditionSetsResponse | PlainMessage | undefined, b: ListSubjectConditionSetsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListSubjectConditionSetsResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.SubjectConditionSetCreate + */ +export class SubjectConditionSetCreate extends Message { + /** + * Required + * + * @generated from field: repeated policy.SubjectSet subject_sets = 1; + */ + subjectSets: SubjectSet[] = []; + + /** + * Optional + * Common metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.SubjectConditionSetCreate"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_sets", kind: "message", T: SubjectSet, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SubjectConditionSetCreate { + return new SubjectConditionSetCreate().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SubjectConditionSetCreate { + return new SubjectConditionSetCreate().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SubjectConditionSetCreate { + return new SubjectConditionSetCreate().fromJsonString(jsonString, options); + } + + static equals(a: SubjectConditionSetCreate | PlainMessage | undefined, b: SubjectConditionSetCreate | PlainMessage | undefined): boolean { + return proto3.util.equals(SubjectConditionSetCreate, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.CreateSubjectConditionSetRequest + */ +export class CreateSubjectConditionSetRequest extends Message { + /** + * @generated from field: policy.subjectmapping.SubjectConditionSetCreate subject_condition_set = 1; + */ + subjectConditionSet?: SubjectConditionSetCreate; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.CreateSubjectConditionSetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_condition_set", kind: "message", T: SubjectConditionSetCreate }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateSubjectConditionSetRequest { + return new CreateSubjectConditionSetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateSubjectConditionSetRequest { + return new CreateSubjectConditionSetRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateSubjectConditionSetRequest { + return new CreateSubjectConditionSetRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateSubjectConditionSetRequest | PlainMessage | undefined, b: CreateSubjectConditionSetRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateSubjectConditionSetRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.CreateSubjectConditionSetResponse + */ +export class CreateSubjectConditionSetResponse extends Message { + /** + * @generated from field: policy.SubjectConditionSet subject_condition_set = 1; + */ + subjectConditionSet?: SubjectConditionSet; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.CreateSubjectConditionSetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_condition_set", kind: "message", T: SubjectConditionSet }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateSubjectConditionSetResponse { + return new CreateSubjectConditionSetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateSubjectConditionSetResponse { + return new CreateSubjectConditionSetResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateSubjectConditionSetResponse { + return new CreateSubjectConditionSetResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateSubjectConditionSetResponse | PlainMessage | undefined, b: CreateSubjectConditionSetResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateSubjectConditionSetResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.UpdateSubjectConditionSetRequest + */ +export class UpdateSubjectConditionSetRequest extends Message { + /** + * Required + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Optional + * If provided, replaces entire existing structure of Subject Sets, Condition Groups, & Conditions + * + * @generated from field: repeated policy.SubjectSet subject_sets = 2; + */ + subjectSets: SubjectSet[] = []; + + /** + * Common metadata + * + * @generated from field: common.MetadataMutable metadata = 100; + */ + metadata?: MetadataMutable; + + /** + * @generated from field: common.MetadataUpdateEnum metadata_update_behavior = 101; + */ + metadataUpdateBehavior = MetadataUpdateEnum.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.UpdateSubjectConditionSetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "subject_sets", kind: "message", T: SubjectSet, repeated: true }, + { no: 100, name: "metadata", kind: "message", T: MetadataMutable }, + { no: 101, name: "metadata_update_behavior", kind: "enum", T: proto3.getEnumType(MetadataUpdateEnum) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateSubjectConditionSetRequest { + return new UpdateSubjectConditionSetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateSubjectConditionSetRequest { + return new UpdateSubjectConditionSetRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateSubjectConditionSetRequest { + return new UpdateSubjectConditionSetRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateSubjectConditionSetRequest | PlainMessage | undefined, b: UpdateSubjectConditionSetRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateSubjectConditionSetRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.UpdateSubjectConditionSetResponse + */ +export class UpdateSubjectConditionSetResponse extends Message { + /** + * Only ID of updated Subject Condition Set provided + * + * @generated from field: policy.SubjectConditionSet subject_condition_set = 1; + */ + subjectConditionSet?: SubjectConditionSet; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.UpdateSubjectConditionSetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_condition_set", kind: "message", T: SubjectConditionSet }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateSubjectConditionSetResponse { + return new UpdateSubjectConditionSetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateSubjectConditionSetResponse { + return new UpdateSubjectConditionSetResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateSubjectConditionSetResponse { + return new UpdateSubjectConditionSetResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateSubjectConditionSetResponse | PlainMessage | undefined, b: UpdateSubjectConditionSetResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateSubjectConditionSetResponse, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.DeleteSubjectConditionSetRequest + */ +export class DeleteSubjectConditionSetRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.DeleteSubjectConditionSetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteSubjectConditionSetRequest { + return new DeleteSubjectConditionSetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteSubjectConditionSetRequest { + return new DeleteSubjectConditionSetRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteSubjectConditionSetRequest { + return new DeleteSubjectConditionSetRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteSubjectConditionSetRequest | PlainMessage | undefined, b: DeleteSubjectConditionSetRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteSubjectConditionSetRequest, a, b); + } +} + +/** + * @generated from message policy.subjectmapping.DeleteSubjectConditionSetResponse + */ +export class DeleteSubjectConditionSetResponse extends Message { + /** + * Only ID of deleted Subject Condition Set provided + * + * @generated from field: policy.SubjectConditionSet subject_condition_set = 1; + */ + subjectConditionSet?: SubjectConditionSet; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "policy.subjectmapping.DeleteSubjectConditionSetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "subject_condition_set", kind: "message", T: SubjectConditionSet }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteSubjectConditionSetResponse { + return new DeleteSubjectConditionSetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteSubjectConditionSetResponse { + return new DeleteSubjectConditionSetResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteSubjectConditionSetResponse { + return new DeleteSubjectConditionSetResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteSubjectConditionSetResponse | PlainMessage | undefined, b: DeleteSubjectConditionSetResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteSubjectConditionSetResponse, a, b); + } +} + diff --git a/lib/gen/wellknownconfiguration/wellknown_configuration_connect.ts b/lib/gen/wellknownconfiguration/wellknown_configuration_connect.ts new file mode 100644 index 00000000..ebe82859 --- /dev/null +++ b/lib/gen/wellknownconfiguration/wellknown_configuration_connect.ts @@ -0,0 +1,26 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file wellknownconfiguration/wellknown_configuration.proto (package wellknownconfiguration, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { GetWellKnownConfigurationRequest, GetWellKnownConfigurationResponse } from "./wellknown_configuration_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service wellknownconfiguration.WellKnownService + */ +export const WellKnownService = { + typeName: "wellknownconfiguration.WellKnownService", + methods: { + /** + * @generated from rpc wellknownconfiguration.WellKnownService.GetWellKnownConfiguration + */ + getWellKnownConfiguration: { + name: "GetWellKnownConfiguration", + I: GetWellKnownConfigurationRequest, + O: GetWellKnownConfigurationResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/lib/gen/wellknownconfiguration/wellknown_configuration_pb.ts b/lib/gen/wellknownconfiguration/wellknown_configuration_pb.ts new file mode 100644 index 00000000..65ebbecd --- /dev/null +++ b/lib/gen/wellknownconfiguration/wellknown_configuration_pb.ts @@ -0,0 +1,113 @@ +// @generated by protoc-gen-es v1.9.0 with parameter "target=ts" +// @generated from file wellknownconfiguration/wellknown_configuration.proto (package wellknownconfiguration, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Struct } from "@bufbuild/protobuf"; + +/** + * @generated from message wellknownconfiguration.WellKnownConfig + */ +export class WellKnownConfig extends Message { + /** + * @generated from field: map configuration = 1; + */ + configuration: { [key: string]: Struct } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wellknownconfiguration.WellKnownConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "configuration", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Struct} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): WellKnownConfig { + return new WellKnownConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): WellKnownConfig { + return new WellKnownConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): WellKnownConfig { + return new WellKnownConfig().fromJsonString(jsonString, options); + } + + static equals(a: WellKnownConfig | PlainMessage | undefined, b: WellKnownConfig | PlainMessage | undefined): boolean { + return proto3.util.equals(WellKnownConfig, a, b); + } +} + +/** + * @generated from message wellknownconfiguration.GetWellKnownConfigurationRequest + */ +export class GetWellKnownConfigurationRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wellknownconfiguration.GetWellKnownConfigurationRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetWellKnownConfigurationRequest { + return new GetWellKnownConfigurationRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetWellKnownConfigurationRequest { + return new GetWellKnownConfigurationRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetWellKnownConfigurationRequest { + return new GetWellKnownConfigurationRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetWellKnownConfigurationRequest | PlainMessage | undefined, b: GetWellKnownConfigurationRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetWellKnownConfigurationRequest, a, b); + } +} + +/** + * @generated from message wellknownconfiguration.GetWellKnownConfigurationResponse + */ +export class GetWellKnownConfigurationResponse extends Message { + /** + * @generated from field: google.protobuf.Struct configuration = 1; + */ + configuration?: Struct; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "wellknownconfiguration.GetWellKnownConfigurationResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "configuration", kind: "message", T: Struct }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetWellKnownConfigurationResponse { + return new GetWellKnownConfigurationResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetWellKnownConfigurationResponse { + return new GetWellKnownConfigurationResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetWellKnownConfigurationResponse { + return new GetWellKnownConfigurationResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetWellKnownConfigurationResponse | PlainMessage | undefined, b: GetWellKnownConfigurationResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetWellKnownConfigurationResponse, a, b); + } +} + diff --git a/lib/package-lock.json b/lib/package-lock.json index b31dadf0..d174bc3d 100644 --- a/lib/package-lock.json +++ b/lib/package-lock.json @@ -9,6 +9,11 @@ "version": "2.0.0", "license": "BSD-3-Clause-Clear", "dependencies": { + "@bufbuild/buf": "^1.31.0", + "@bufbuild/protobuf": "^1.9.0", + "@bufbuild/protoc-gen-es": "^1.9.0", + "@connectrpc/connect": "^1.4.0", + "@connectrpc/protoc-gen-connect-es": "^1.4.0", "ajv": "^8.12.0", "axios": "^1.6.1", "axios-retry": "^3.9.0", @@ -443,6 +448,168 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@bufbuild/buf": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.31.0.tgz", + "integrity": "sha512-kM/eueGkp0NDo8p8B6GXr1MdCzf4w8zEV1gbEiDlaLYDoyeHGLtlf5jF/hrb6MsvCccy3x7cc+cj4Wn/DmoR2g==", + "hasInstallScript": true, + "bin": { + "buf": "bin/buf", + "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", + "protoc-gen-buf-lint": "bin/protoc-gen-buf-lint" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@bufbuild/buf-darwin-arm64": "1.31.0", + "@bufbuild/buf-darwin-x64": "1.31.0", + "@bufbuild/buf-linux-aarch64": "1.31.0", + "@bufbuild/buf-linux-x64": "1.31.0", + "@bufbuild/buf-win32-arm64": "1.31.0", + "@bufbuild/buf-win32-x64": "1.31.0" + } + }, + "node_modules/@bufbuild/buf-darwin-arm64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.31.0.tgz", + "integrity": "sha512-C0jArGS/SW0jfpBBmG6xEhUBWQTsGInnPr7y44WYWNS/U5OnnWPJtYQ7xbH0mzYDMx7sZVRV0FKvPO0FPKS+hA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-darwin-x64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.31.0.tgz", + "integrity": "sha512-oBTe1T4l2WSukAG+9YS7VHID4N1CuSvAxGBfuzpFQrjjiQZaaTfYuLqqVP6408MyCN7X/LOjfCekR1QToVweNw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-aarch64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.31.0.tgz", + "integrity": "sha512-UN9KsTuO9YS5Vefj/CaqX1wO+hvc3AyGElxzOHMc7S3MWEuqSAFOhxu5I7CyOr2/yoZO2qZPPR29HuzmQsb2+w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-x64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.31.0.tgz", + "integrity": "sha512-4uKq5Iu5tNEFE3Mz9a52KFCaywg5xLqwhN6Kf4kAk34kxWJgQ8D3WFe9ZpXHzH7Lj00u3Q+V/3vKCVATHR3tkw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-arm64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.31.0.tgz", + "integrity": "sha512-jz7GenlNsqwbC3qaHcBHBO35MycZ1gV8OUSRp/wTXGgZsEZzAyw335JA2NWL+5LaI8cF+CsYd6/uuWzKkdCKTQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-x64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.31.0.tgz", + "integrity": "sha512-gw7p3PYam0g7hNwIhNphua5P8GBZczginoWNK3jk5sGVv0TzWOdHrjkVVhkc3DJbRZEg10ExGI3qRfCqiX1IHw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/protobuf": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.9.0.tgz", + "integrity": "sha512-W7gp8Q/v1NlCZLsv8pQ3Y0uCu/SHgXOVFK+eUluUKWXmsb6VHkpNx0apdOWWcDbB9sJoKeP8uPrjmehJz6xETQ==" + }, + "node_modules/@bufbuild/protoc-gen-es": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-es/-/protoc-gen-es-1.9.0.tgz", + "integrity": "sha512-LJy1nC3Jsfdhs9v48P7qF6YXIqh+usFhXSVzJDTmw0yKjxQ3CKBNISRtaMql/g9hb1MLRU6unHCcFfdz4HSO/Q==", + "dependencies": { + "@bufbuild/protobuf": "^1.9.0", + "@bufbuild/protoplugin": "1.9.0" + }, + "bin": { + "protoc-gen-es": "bin/protoc-gen-es" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@bufbuild/protobuf": "1.9.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protobuf": { + "optional": true + } + } + }, + "node_modules/@bufbuild/protoplugin": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-1.9.0.tgz", + "integrity": "sha512-/mxMiGs5h78RUHT7v4+mv0Wt0gyRf/SOS5PLzKEg2sclEAlFPbXfZ8HjlvxJpXZP/YpP3HvsW/mil3E69G0mXg==", + "dependencies": { + "@bufbuild/protobuf": "1.9.0", + "@typescript/vfs": "^1.4.0", + "typescript": "4.5.2" + } + }, + "node_modules/@bufbuild/protoplugin/node_modules/typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -452,6 +619,41 @@ "node": ">=0.1.90" } }, + "node_modules/@connectrpc/connect": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-1.4.0.tgz", + "integrity": "sha512-vZeOkKaAjyV4+RH3+rJZIfDFJAfr+7fyYr6sLDKbYX3uuTVszhFe9/YKf5DNqrDb5cKdKVlYkGn6DTDqMitAnA==", + "peerDependencies": { + "@bufbuild/protobuf": "^1.4.2" + } + }, + "node_modules/@connectrpc/protoc-gen-connect-es": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/protoc-gen-connect-es/-/protoc-gen-connect-es-1.4.0.tgz", + "integrity": "sha512-/7vQ8Q7mEBhV8qEVh/eifRQlQnf8EJ6weMwCD2DljVAQRlZYcW9SLxjYZhV1uM1ZZqQC7Cw2vvgXRg2XQswHBg==", + "dependencies": { + "@bufbuild/protobuf": "^1.7.2", + "@bufbuild/protoplugin": "^1.7.2" + }, + "bin": { + "protoc-gen-connect-es": "bin/protoc-gen-connect-es" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@bufbuild/protoc-gen-es": "^1.7.2", + "@connectrpc/connect": "1.4.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protoc-gen-es": { + "optional": true + }, + "@connectrpc/connect": { + "optional": true + } + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -2222,6 +2424,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript/vfs": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.5.0.tgz", + "integrity": "sha512-AJS307bPgbsZZ9ggCT3wwpg3VbTKMFNHfaY/uF0ahSkYYrPF2dSSKDNIDIQAHm9qJqbLvCsSJH7yN4Vs/CsMMg==", + "dependencies": { + "debug": "^4.1.1" + } + }, "node_modules/@web/browser-logs": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@web/browser-logs/-/browser-logs-0.3.3.tgz", @@ -4021,7 +4231,6 @@ }, "node_modules/debug": { "version": "4.3.4", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -7793,7 +8002,6 @@ }, "node_modules/ms": { "version": "2.1.2", - "dev": true, "license": "MIT" }, "node_modules/nanocolors": { @@ -11465,12 +11673,107 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@bufbuild/buf": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.31.0.tgz", + "integrity": "sha512-kM/eueGkp0NDo8p8B6GXr1MdCzf4w8zEV1gbEiDlaLYDoyeHGLtlf5jF/hrb6MsvCccy3x7cc+cj4Wn/DmoR2g==", + "requires": { + "@bufbuild/buf-darwin-arm64": "1.31.0", + "@bufbuild/buf-darwin-x64": "1.31.0", + "@bufbuild/buf-linux-aarch64": "1.31.0", + "@bufbuild/buf-linux-x64": "1.31.0", + "@bufbuild/buf-win32-arm64": "1.31.0", + "@bufbuild/buf-win32-x64": "1.31.0" + } + }, + "@bufbuild/buf-darwin-arm64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.31.0.tgz", + "integrity": "sha512-C0jArGS/SW0jfpBBmG6xEhUBWQTsGInnPr7y44WYWNS/U5OnnWPJtYQ7xbH0mzYDMx7sZVRV0FKvPO0FPKS+hA==", + "optional": true + }, + "@bufbuild/buf-darwin-x64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.31.0.tgz", + "integrity": "sha512-oBTe1T4l2WSukAG+9YS7VHID4N1CuSvAxGBfuzpFQrjjiQZaaTfYuLqqVP6408MyCN7X/LOjfCekR1QToVweNw==", + "optional": true + }, + "@bufbuild/buf-linux-aarch64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.31.0.tgz", + "integrity": "sha512-UN9KsTuO9YS5Vefj/CaqX1wO+hvc3AyGElxzOHMc7S3MWEuqSAFOhxu5I7CyOr2/yoZO2qZPPR29HuzmQsb2+w==", + "optional": true + }, + "@bufbuild/buf-linux-x64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.31.0.tgz", + "integrity": "sha512-4uKq5Iu5tNEFE3Mz9a52KFCaywg5xLqwhN6Kf4kAk34kxWJgQ8D3WFe9ZpXHzH7Lj00u3Q+V/3vKCVATHR3tkw==", + "optional": true + }, + "@bufbuild/buf-win32-arm64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.31.0.tgz", + "integrity": "sha512-jz7GenlNsqwbC3qaHcBHBO35MycZ1gV8OUSRp/wTXGgZsEZzAyw335JA2NWL+5LaI8cF+CsYd6/uuWzKkdCKTQ==", + "optional": true + }, + "@bufbuild/buf-win32-x64": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.31.0.tgz", + "integrity": "sha512-gw7p3PYam0g7hNwIhNphua5P8GBZczginoWNK3jk5sGVv0TzWOdHrjkVVhkc3DJbRZEg10ExGI3qRfCqiX1IHw==", + "optional": true + }, + "@bufbuild/protobuf": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.9.0.tgz", + "integrity": "sha512-W7gp8Q/v1NlCZLsv8pQ3Y0uCu/SHgXOVFK+eUluUKWXmsb6VHkpNx0apdOWWcDbB9sJoKeP8uPrjmehJz6xETQ==" + }, + "@bufbuild/protoc-gen-es": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-es/-/protoc-gen-es-1.9.0.tgz", + "integrity": "sha512-LJy1nC3Jsfdhs9v48P7qF6YXIqh+usFhXSVzJDTmw0yKjxQ3CKBNISRtaMql/g9hb1MLRU6unHCcFfdz4HSO/Q==", + "requires": { + "@bufbuild/protobuf": "^1.9.0", + "@bufbuild/protoplugin": "1.9.0" + } + }, + "@bufbuild/protoplugin": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-1.9.0.tgz", + "integrity": "sha512-/mxMiGs5h78RUHT7v4+mv0Wt0gyRf/SOS5PLzKEg2sclEAlFPbXfZ8HjlvxJpXZP/YpP3HvsW/mil3E69G0mXg==", + "requires": { + "@bufbuild/protobuf": "1.9.0", + "@typescript/vfs": "^1.4.0", + "typescript": "4.5.2" + }, + "dependencies": { + "typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==" + } + } + }, "@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true }, + "@connectrpc/connect": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-1.4.0.tgz", + "integrity": "sha512-vZeOkKaAjyV4+RH3+rJZIfDFJAfr+7fyYr6sLDKbYX3uuTVszhFe9/YKf5DNqrDb5cKdKVlYkGn6DTDqMitAnA==", + "requires": {} + }, + "@connectrpc/protoc-gen-connect-es": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/protoc-gen-connect-es/-/protoc-gen-connect-es-1.4.0.tgz", + "integrity": "sha512-/7vQ8Q7mEBhV8qEVh/eifRQlQnf8EJ6weMwCD2DljVAQRlZYcW9SLxjYZhV1uM1ZZqQC7Cw2vvgXRg2XQswHBg==", + "requires": { + "@bufbuild/protobuf": "^1.7.2", + "@bufbuild/protoplugin": "^1.7.2" + } + }, "@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -12732,6 +13035,14 @@ "eslint-visitor-keys": "^3.4.1" } }, + "@typescript/vfs": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.5.0.tgz", + "integrity": "sha512-AJS307bPgbsZZ9ggCT3wwpg3VbTKMFNHfaY/uF0ahSkYYrPF2dSSKDNIDIQAHm9qJqbLvCsSJH7yN4Vs/CsMMg==", + "requires": { + "debug": "^4.1.1" + } + }, "@web/browser-logs": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@web/browser-logs/-/browser-logs-0.3.3.tgz", @@ -14099,7 +14410,6 @@ }, "debug": { "version": "4.3.4", - "dev": true, "requires": { "ms": "2.1.2" } @@ -16811,8 +17121,7 @@ } }, "ms": { - "version": "2.1.2", - "dev": true + "version": "2.1.2" }, "nanocolors": { "version": "0.2.13", diff --git a/lib/package.json b/lib/package.json index ade6bfb1..4c725222 100644 --- a/lib/package.json +++ b/lib/package.json @@ -59,6 +59,11 @@ "watch": "(trap 'kill 0' SIGINT; npm run build && (npm run build:watch & npm run test -- --watch))" }, "dependencies": { + "@bufbuild/buf": "^1.31.0", + "@bufbuild/protobuf": "^1.9.0", + "@bufbuild/protoc-gen-es": "^1.9.0", + "@connectrpc/connect": "^1.4.0", + "@connectrpc/protoc-gen-connect-es": "^1.4.0", "ajv": "^8.12.0", "axios": "^1.6.1", "axios-retry": "^3.9.0", diff --git a/remote-store/package-lock.json b/remote-store/package-lock.json index 1a795b12..04a8e49d 100644 --- a/remote-store/package-lock.json +++ b/remote-store/package-lock.json @@ -1649,7 +1649,7 @@ "node_modules/@opentdf/client": { "version": "2.0.0", "resolved": "file:../lib/opentdf-client-2.0.0.tgz", - "integrity": "sha512-o0Dhfj6sgBH7G/Fyov0m0oyZHLoWC7c7Fgarrbq5u/R+iODUzo4QHaOzmcBjTMG0rJhBjJTnLxWtNASoIhXbAQ==", + "integrity": "sha512-LqH1FK17EryhKS1Gg3EIe4+Tgk9fbQ7O040UllhVG8AO6lHjqCfffQN1pCxIVu1e0yMYslYdyIB2Hot/QHxNoA==", "license": "BSD-3-Clause-Clear", "dependencies": { "ajv": "^8.12.0", diff --git a/web-app/package-lock.json b/web-app/package-lock.json index 9ec0923d..211e59aa 100644 --- a/web-app/package-lock.json +++ b/web-app/package-lock.json @@ -602,7 +602,7 @@ "node_modules/@opentdf/client": { "version": "2.0.0", "resolved": "file:../lib/opentdf-client-2.0.0.tgz", - "integrity": "sha512-o0Dhfj6sgBH7G/Fyov0m0oyZHLoWC7c7Fgarrbq5u/R+iODUzo4QHaOzmcBjTMG0rJhBjJTnLxWtNASoIhXbAQ==", + "integrity": "sha512-LqH1FK17EryhKS1Gg3EIe4+Tgk9fbQ7O040UllhVG8AO6lHjqCfffQN1pCxIVu1e0yMYslYdyIB2Hot/QHxNoA==", "license": "BSD-3-Clause-Clear", "dependencies": { "ajv": "^8.12.0", @@ -4098,7 +4098,7 @@ }, "@opentdf/client": { "version": "file:../lib/opentdf-client-2.0.0.tgz", - "integrity": "sha512-o0Dhfj6sgBH7G/Fyov0m0oyZHLoWC7c7Fgarrbq5u/R+iODUzo4QHaOzmcBjTMG0rJhBjJTnLxWtNASoIhXbAQ==", + "integrity": "sha512-LqH1FK17EryhKS1Gg3EIe4+Tgk9fbQ7O040UllhVG8AO6lHjqCfffQN1pCxIVu1e0yMYslYdyIB2Hot/QHxNoA==", "requires": { "ajv": "^8.12.0", "axios": "^1.6.1",