From d0e4deff31ec912180c74844e7c18d886e88a1df Mon Sep 17 00:00:00 2001 From: Caleb Doxsey Date: Mon, 11 Nov 2024 20:07:07 -0700 Subject: [PATCH] upgrade to v0.28.0 --- scripts/update.bash | 6 +- src/pomerium-console/changesets.client.ts | 86 ++ src/pomerium-console/changesets.ts | 987 ++++++++++++++++++ src/pomerium-console/databroker_svc.client.ts | 13 + src/pomerium-console/databroker_svc.ts | 253 ++++- src/pomerium-console/external_data_sources.ts | 2 +- src/pomerium-console/routes.ts | 42 + src/pomerium-console/settings.ts | 14 +- 8 files changed, 1392 insertions(+), 11 deletions(-) create mode 100644 src/pomerium-console/changesets.client.ts create mode 100644 src/pomerium-console/changesets.ts diff --git a/scripts/update.bash b/scripts/update.bash index 3ef8414..bb0b5a1 100755 --- a/scripts/update.bash +++ b/scripts/update.bash @@ -6,8 +6,8 @@ _root_dir="$(dirname "$_scripts_dir")" _deps_dir="$_root_dir/deps" readonly _git_deps=( - "pomerium/pomerium|v0.27.0" - "pomerium/pomerium-console|v0.27.0" + "pomerium/pomerium|v0.28.0" + "pomerium/pomerium-console|v0.28.0" 'envoyproxy/protoc-gen-validate|v1.0.2' 'envoyproxy/data-plane-api|d525ab36724d6a94477f7642e02418b50a8c4043' 'cncf/xds|e9ce68804cb4e64cab5a52e3c8baf840d4ff87b7' @@ -40,7 +40,7 @@ function clone-all() { done } -# clone-all +clone-all for _f in "$_deps_dir/github.com/pomerium/pomerium-console/pkg/pb/"*.proto; do ( diff --git a/src/pomerium-console/changesets.client.ts b/src/pomerium-console/changesets.client.ts new file mode 100644 index 0000000..3e76bb5 --- /dev/null +++ b/src/pomerium-console/changesets.client.ts @@ -0,0 +1,86 @@ +// @generated by protobuf-ts 2.9.4 with parameter generate_dependencies +// @generated from protobuf file "changesets.proto" (package "pomerium.dashboard", syntax proto3) +// tslint:disable +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import { ChangesetService } from "./changesets"; +import type { ListChangesetsResponse } from "./changesets"; +import type { ListChangesetsRequest } from "./changesets"; +import type { DiffChangesetResponse } from "./changesets"; +import type { DiffChangesetRequest } from "./changesets"; +import type { DeployChangesetRequest } from "./changesets"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +import type { Empty } from "./google/protobuf/empty"; +import type { ApproveChangesetRequest } from "./changesets"; +import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +/** + * @generated from protobuf service pomerium.dashboard.ChangesetService + */ +export interface IChangesetServiceClient { + /** + * @generated from protobuf rpc: ApproveChangeset(pomerium.dashboard.ApproveChangesetRequest) returns (google.protobuf.Empty); + */ + approveChangeset(input: ApproveChangesetRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: DeployChangeset(pomerium.dashboard.DeployChangesetRequest) returns (google.protobuf.Empty); + */ + deployChangeset(input: DeployChangesetRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: DiffChangeset(pomerium.dashboard.DiffChangesetRequest) returns (pomerium.dashboard.DiffChangesetResponse); + */ + diffChangeset(input: DiffChangesetRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: ListChangesets(pomerium.dashboard.ListChangesetsRequest) returns (pomerium.dashboard.ListChangesetsResponse); + */ + listChangesets(input: ListChangesetsRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: RollbackChangeset(google.protobuf.Empty) returns (google.protobuf.Empty); + */ + rollbackChangeset(input: Empty, options?: RpcOptions): UnaryCall; +} +/** + * @generated from protobuf service pomerium.dashboard.ChangesetService + */ +export class ChangesetServiceClient implements IChangesetServiceClient, ServiceInfo { + typeName = ChangesetService.typeName; + methods = ChangesetService.methods; + options = ChangesetService.options; + constructor(private readonly _transport: RpcTransport) { + } + /** + * @generated from protobuf rpc: ApproveChangeset(pomerium.dashboard.ApproveChangesetRequest) returns (google.protobuf.Empty); + */ + approveChangeset(input: ApproveChangesetRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: DeployChangeset(pomerium.dashboard.DeployChangesetRequest) returns (google.protobuf.Empty); + */ + deployChangeset(input: DeployChangesetRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[1], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: DiffChangeset(pomerium.dashboard.DiffChangesetRequest) returns (pomerium.dashboard.DiffChangesetResponse); + */ + diffChangeset(input: DiffChangesetRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: ListChangesets(pomerium.dashboard.ListChangesetsRequest) returns (pomerium.dashboard.ListChangesetsResponse); + */ + listChangesets(input: ListChangesetsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[3], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: RollbackChangeset(google.protobuf.Empty) returns (google.protobuf.Empty); + */ + rollbackChangeset(input: Empty, options?: RpcOptions): UnaryCall { + const method = this.methods[4], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } +} diff --git a/src/pomerium-console/changesets.ts b/src/pomerium-console/changesets.ts new file mode 100644 index 0000000..1777bf1 --- /dev/null +++ b/src/pomerium-console/changesets.ts @@ -0,0 +1,987 @@ +// @generated by protobuf-ts 2.9.4 with parameter generate_dependencies +// @generated from protobuf file "changesets.proto" (package "pomerium.dashboard", syntax proto3) +// tslint:disable +import { Empty } from "./google/protobuf/empty"; +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { ActivityLogEntry } from "./activity_log"; +import { Timestamp } from "./google/protobuf/timestamp"; +/** + * @generated from protobuf message pomerium.dashboard.Changeset + */ +export interface Changeset { + /** + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * @generated from protobuf field: google.protobuf.Timestamp created_at = 2; + */ + createdAt?: Timestamp; + /** + * @generated from protobuf field: google.protobuf.Timestamp modified_at = 3; + */ + modifiedAt?: Timestamp; + /** + * @generated from protobuf field: google.protobuf.Timestamp deployed_at = 4; + */ + deployedAt?: Timestamp; +} +/** + * @generated from protobuf message pomerium.dashboard.ChangesetRecord + */ +export interface ChangesetRecord { + /** + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * @generated from protobuf field: string record_id = 2; + */ + recordId: string; + /** + * @generated from protobuf field: string record_proto_md5 = 3; + */ + recordProtoMd5: string; + /** + * @generated from protobuf field: bytes record_proto = 4; + */ + recordProto: Uint8Array; +} +/** + * @generated from protobuf message pomerium.dashboard.ChangesetWithRecords + */ +export interface ChangesetWithRecords { + /** + * @generated from protobuf field: pomerium.dashboard.Changeset changeset = 1; + */ + changeset?: Changeset; + /** + * @generated from protobuf field: repeated pomerium.dashboard.ChangesetRecord records = 2; + */ + records: ChangesetRecord[]; +} +/** + * @generated from protobuf message pomerium.dashboard.ChangesetDetails + */ +export interface ChangesetDetails { + /** + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * @generated from protobuf field: google.protobuf.Timestamp created_at = 2; + */ + createdAt?: Timestamp; + /** + * @generated from protobuf field: google.protobuf.Timestamp modified_at = 3; + */ + modifiedAt?: Timestamp; + /** + * @generated from protobuf field: google.protobuf.Timestamp deployed_at = 4; + */ + deployedAt?: Timestamp; + /** + * @generated from protobuf field: repeated pomerium.dashboard.ChangesetDetails.Approver approvers = 5; + */ + approvers: ChangesetDetails_Approver[]; + /** + * @generated from protobuf field: int64 required_approval_count = 10; + */ + requiredApprovalCount: bigint; + /** + * @generated from protobuf field: bool can_approve = 6; + */ + canApprove: boolean; + /** + * @generated from protobuf field: bool can_deploy = 7; + */ + canDeploy: boolean; + /** + * @generated from protobuf field: bool can_rollback = 8; + */ + canRollback: boolean; + /** + * @generated from protobuf field: optional pomerium.dashboard.ActivityLogEntry last_change = 9; + */ + lastChange?: ActivityLogEntry; + /** + * @generated from protobuf field: string status = 11; + */ + status: string; +} +/** + * @generated from protobuf message pomerium.dashboard.ChangesetDetails.Approver + */ +export interface ChangesetDetails_Approver { + /** + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * @generated from protobuf field: string display_name = 2; + */ + displayName: string; + /** + * @generated from protobuf field: string email = 3; + */ + email: string; + /** + * @generated from protobuf field: google.protobuf.Timestamp approved_at = 4; + */ + approvedAt?: Timestamp; +} +/** + * @generated from protobuf message pomerium.dashboard.ApproveChangesetRequest + */ +export interface ApproveChangesetRequest { + /** + * @generated from protobuf field: string changeset_id = 1; + */ + changesetId: string; +} +/** + * @generated from protobuf message pomerium.dashboard.DeployChangesetRequest + */ +export interface DeployChangesetRequest { + /** + * @generated from protobuf field: string changeset_id = 1; + */ + changesetId: string; +} +/** + * @generated from protobuf message pomerium.dashboard.DiffChangesetRequest + */ +export interface DiffChangesetRequest { + /** + * @generated from protobuf field: string changeset_id = 1; + */ + changesetId: string; +} +/** + * @generated from protobuf message pomerium.dashboard.DiffChangesetResponse + */ +export interface DiffChangesetResponse { + /** + * @generated from protobuf field: repeated pomerium.dashboard.DiffChangesetResponse.Record changeset_records = 1; + */ + changesetRecords: DiffChangesetResponse_Record[]; + /** + * @generated from protobuf field: repeated pomerium.dashboard.DiffChangesetResponse.Record currently_deployed_changeset_records = 2; + */ + currentlyDeployedChangesetRecords: DiffChangesetResponse_Record[]; +} +/** + * @generated from protobuf message pomerium.dashboard.DiffChangesetResponse.Record + */ +export interface DiffChangesetResponse_Record { + /** + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * @generated from protobuf field: string json = 2; + */ + json: string; +} +/** + * @generated from protobuf message pomerium.dashboard.ListChangesetsRequest + */ +export interface ListChangesetsRequest { + /** + * @generated from protobuf field: int64 limit = 1; + */ + limit: bigint; + /** + * @generated from protobuf field: string order_by = 2; + */ + orderBy: string; +} +/** + * @generated from protobuf message pomerium.dashboard.ListChangesetsResponse + */ +export interface ListChangesetsResponse { + /** + * @generated from protobuf field: repeated pomerium.dashboard.ChangesetDetails changesets = 1; + */ + changesets: ChangesetDetails[]; + /** + * @generated from protobuf field: optional string currently_deployed_changeset_id = 2; + */ + currentlyDeployedChangesetId?: string; + /** + * @generated from protobuf field: optional string previously_deployed_changeset_id = 3; + */ + previouslyDeployedChangesetId?: string; +} +// @generated message type with reflection information, may provide speed optimized methods +class Changeset$Type extends MessageType { + constructor() { + super("pomerium.dashboard.Changeset", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "created_at", kind: "message", T: () => Timestamp }, + { no: 3, name: "modified_at", kind: "message", T: () => Timestamp }, + { no: 4, name: "deployed_at", kind: "message", T: () => Timestamp } + ]); + } + create(value?: PartialMessage): Changeset { + const message = globalThis.Object.create((this.messagePrototype!)); + message.id = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Changeset): Changeset { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* google.protobuf.Timestamp created_at */ 2: + message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt); + break; + case /* google.protobuf.Timestamp modified_at */ 3: + message.modifiedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.modifiedAt); + break; + case /* google.protobuf.Timestamp deployed_at */ 4: + message.deployedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.deployedAt); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Changeset, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* google.protobuf.Timestamp created_at = 2; */ + if (message.createdAt) + Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Timestamp modified_at = 3; */ + if (message.modifiedAt) + Timestamp.internalBinaryWrite(message.modifiedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Timestamp deployed_at = 4; */ + if (message.deployedAt) + Timestamp.internalBinaryWrite(message.deployedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.Changeset + */ +export const Changeset = new Changeset$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChangesetRecord$Type extends MessageType { + constructor() { + super("pomerium.dashboard.ChangesetRecord", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "record_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "record_proto_md5", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "record_proto", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): ChangesetRecord { + const message = globalThis.Object.create((this.messagePrototype!)); + message.id = ""; + message.recordId = ""; + message.recordProtoMd5 = ""; + message.recordProto = new Uint8Array(0); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChangesetRecord): ChangesetRecord { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* string record_id */ 2: + message.recordId = reader.string(); + break; + case /* string record_proto_md5 */ 3: + message.recordProtoMd5 = reader.string(); + break; + case /* bytes record_proto */ 4: + message.recordProto = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChangesetRecord, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* string record_id = 2; */ + if (message.recordId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.recordId); + /* string record_proto_md5 = 3; */ + if (message.recordProtoMd5 !== "") + writer.tag(3, WireType.LengthDelimited).string(message.recordProtoMd5); + /* bytes record_proto = 4; */ + if (message.recordProto.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.recordProto); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.ChangesetRecord + */ +export const ChangesetRecord = new ChangesetRecord$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChangesetWithRecords$Type extends MessageType { + constructor() { + super("pomerium.dashboard.ChangesetWithRecords", [ + { no: 1, name: "changeset", kind: "message", T: () => Changeset }, + { no: 2, name: "records", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChangesetRecord } + ]); + } + create(value?: PartialMessage): ChangesetWithRecords { + const message = globalThis.Object.create((this.messagePrototype!)); + message.records = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChangesetWithRecords): ChangesetWithRecords { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* pomerium.dashboard.Changeset changeset */ 1: + message.changeset = Changeset.internalBinaryRead(reader, reader.uint32(), options, message.changeset); + break; + case /* repeated pomerium.dashboard.ChangesetRecord records */ 2: + message.records.push(ChangesetRecord.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChangesetWithRecords, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* pomerium.dashboard.Changeset changeset = 1; */ + if (message.changeset) + Changeset.internalBinaryWrite(message.changeset, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated pomerium.dashboard.ChangesetRecord records = 2; */ + for (let i = 0; i < message.records.length; i++) + ChangesetRecord.internalBinaryWrite(message.records[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.ChangesetWithRecords + */ +export const ChangesetWithRecords = new ChangesetWithRecords$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChangesetDetails$Type extends MessageType { + constructor() { + super("pomerium.dashboard.ChangesetDetails", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "created_at", kind: "message", T: () => Timestamp }, + { no: 3, name: "modified_at", kind: "message", T: () => Timestamp }, + { no: 4, name: "deployed_at", kind: "message", T: () => Timestamp }, + { no: 5, name: "approvers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChangesetDetails_Approver }, + { no: 10, name: "required_approval_count", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "can_approve", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "can_deploy", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 8, name: "can_rollback", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "last_change", kind: "message", T: () => ActivityLogEntry }, + { no: 11, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ChangesetDetails { + const message = globalThis.Object.create((this.messagePrototype!)); + message.id = ""; + message.approvers = []; + message.requiredApprovalCount = 0n; + message.canApprove = false; + message.canDeploy = false; + message.canRollback = false; + message.status = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChangesetDetails): ChangesetDetails { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* google.protobuf.Timestamp created_at */ 2: + message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt); + break; + case /* google.protobuf.Timestamp modified_at */ 3: + message.modifiedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.modifiedAt); + break; + case /* google.protobuf.Timestamp deployed_at */ 4: + message.deployedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.deployedAt); + break; + case /* repeated pomerium.dashboard.ChangesetDetails.Approver approvers */ 5: + message.approvers.push(ChangesetDetails_Approver.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* int64 required_approval_count */ 10: + message.requiredApprovalCount = reader.int64().toBigInt(); + break; + case /* bool can_approve */ 6: + message.canApprove = reader.bool(); + break; + case /* bool can_deploy */ 7: + message.canDeploy = reader.bool(); + break; + case /* bool can_rollback */ 8: + message.canRollback = reader.bool(); + break; + case /* optional pomerium.dashboard.ActivityLogEntry last_change */ 9: + message.lastChange = ActivityLogEntry.internalBinaryRead(reader, reader.uint32(), options, message.lastChange); + break; + case /* string status */ 11: + message.status = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChangesetDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* google.protobuf.Timestamp created_at = 2; */ + if (message.createdAt) + Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Timestamp modified_at = 3; */ + if (message.modifiedAt) + Timestamp.internalBinaryWrite(message.modifiedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Timestamp deployed_at = 4; */ + if (message.deployedAt) + Timestamp.internalBinaryWrite(message.deployedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated pomerium.dashboard.ChangesetDetails.Approver approvers = 5; */ + for (let i = 0; i < message.approvers.length; i++) + ChangesetDetails_Approver.internalBinaryWrite(message.approvers[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* int64 required_approval_count = 10; */ + if (message.requiredApprovalCount !== 0n) + writer.tag(10, WireType.Varint).int64(message.requiredApprovalCount); + /* bool can_approve = 6; */ + if (message.canApprove !== false) + writer.tag(6, WireType.Varint).bool(message.canApprove); + /* bool can_deploy = 7; */ + if (message.canDeploy !== false) + writer.tag(7, WireType.Varint).bool(message.canDeploy); + /* bool can_rollback = 8; */ + if (message.canRollback !== false) + writer.tag(8, WireType.Varint).bool(message.canRollback); + /* optional pomerium.dashboard.ActivityLogEntry last_change = 9; */ + if (message.lastChange) + ActivityLogEntry.internalBinaryWrite(message.lastChange, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + /* string status = 11; */ + if (message.status !== "") + writer.tag(11, WireType.LengthDelimited).string(message.status); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.ChangesetDetails + */ +export const ChangesetDetails = new ChangesetDetails$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChangesetDetails_Approver$Type extends MessageType { + constructor() { + super("pomerium.dashboard.ChangesetDetails.Approver", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "display_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "email", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "approved_at", kind: "message", T: () => Timestamp } + ]); + } + create(value?: PartialMessage): ChangesetDetails_Approver { + const message = globalThis.Object.create((this.messagePrototype!)); + message.id = ""; + message.displayName = ""; + message.email = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChangesetDetails_Approver): ChangesetDetails_Approver { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* string display_name */ 2: + message.displayName = reader.string(); + break; + case /* string email */ 3: + message.email = reader.string(); + break; + case /* google.protobuf.Timestamp approved_at */ 4: + message.approvedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.approvedAt); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChangesetDetails_Approver, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* string display_name = 2; */ + if (message.displayName !== "") + writer.tag(2, WireType.LengthDelimited).string(message.displayName); + /* string email = 3; */ + if (message.email !== "") + writer.tag(3, WireType.LengthDelimited).string(message.email); + /* google.protobuf.Timestamp approved_at = 4; */ + if (message.approvedAt) + Timestamp.internalBinaryWrite(message.approvedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.ChangesetDetails.Approver + */ +export const ChangesetDetails_Approver = new ChangesetDetails_Approver$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ApproveChangesetRequest$Type extends MessageType { + constructor() { + super("pomerium.dashboard.ApproveChangesetRequest", [ + { no: 1, name: "changeset_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ApproveChangesetRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.changesetId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ApproveChangesetRequest): ApproveChangesetRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string changeset_id */ 1: + message.changesetId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ApproveChangesetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string changeset_id = 1; */ + if (message.changesetId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.changesetId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.ApproveChangesetRequest + */ +export const ApproveChangesetRequest = new ApproveChangesetRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeployChangesetRequest$Type extends MessageType { + constructor() { + super("pomerium.dashboard.DeployChangesetRequest", [ + { no: 1, name: "changeset_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DeployChangesetRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.changesetId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeployChangesetRequest): DeployChangesetRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string changeset_id */ 1: + message.changesetId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeployChangesetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string changeset_id = 1; */ + if (message.changesetId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.changesetId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.DeployChangesetRequest + */ +export const DeployChangesetRequest = new DeployChangesetRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DiffChangesetRequest$Type extends MessageType { + constructor() { + super("pomerium.dashboard.DiffChangesetRequest", [ + { no: 1, name: "changeset_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DiffChangesetRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.changesetId = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffChangesetRequest): DiffChangesetRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string changeset_id */ 1: + message.changesetId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DiffChangesetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string changeset_id = 1; */ + if (message.changesetId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.changesetId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.DiffChangesetRequest + */ +export const DiffChangesetRequest = new DiffChangesetRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DiffChangesetResponse$Type extends MessageType { + constructor() { + super("pomerium.dashboard.DiffChangesetResponse", [ + { no: 1, name: "changeset_records", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DiffChangesetResponse_Record }, + { no: 2, name: "currently_deployed_changeset_records", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DiffChangesetResponse_Record } + ]); + } + create(value?: PartialMessage): DiffChangesetResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + message.changesetRecords = []; + message.currentlyDeployedChangesetRecords = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffChangesetResponse): DiffChangesetResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated pomerium.dashboard.DiffChangesetResponse.Record changeset_records */ 1: + message.changesetRecords.push(DiffChangesetResponse_Record.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated pomerium.dashboard.DiffChangesetResponse.Record currently_deployed_changeset_records */ 2: + message.currentlyDeployedChangesetRecords.push(DiffChangesetResponse_Record.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DiffChangesetResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated pomerium.dashboard.DiffChangesetResponse.Record changeset_records = 1; */ + for (let i = 0; i < message.changesetRecords.length; i++) + DiffChangesetResponse_Record.internalBinaryWrite(message.changesetRecords[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated pomerium.dashboard.DiffChangesetResponse.Record currently_deployed_changeset_records = 2; */ + for (let i = 0; i < message.currentlyDeployedChangesetRecords.length; i++) + DiffChangesetResponse_Record.internalBinaryWrite(message.currentlyDeployedChangesetRecords[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.DiffChangesetResponse + */ +export const DiffChangesetResponse = new DiffChangesetResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DiffChangesetResponse_Record$Type extends MessageType { + constructor() { + super("pomerium.dashboard.DiffChangesetResponse.Record", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "json", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DiffChangesetResponse_Record { + const message = globalThis.Object.create((this.messagePrototype!)); + message.id = ""; + message.json = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiffChangesetResponse_Record): DiffChangesetResponse_Record { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* string json */ 2: + message.json = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DiffChangesetResponse_Record, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* string json = 2; */ + if (message.json !== "") + writer.tag(2, WireType.LengthDelimited).string(message.json); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.DiffChangesetResponse.Record + */ +export const DiffChangesetResponse_Record = new DiffChangesetResponse_Record$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListChangesetsRequest$Type extends MessageType { + constructor() { + super("pomerium.dashboard.ListChangesetsRequest", [ + { no: 1, name: "limit", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "order_by", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ListChangesetsRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.limit = 0n; + message.orderBy = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChangesetsRequest): ListChangesetsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 limit */ 1: + message.limit = reader.int64().toBigInt(); + break; + case /* string order_by */ 2: + message.orderBy = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListChangesetsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 limit = 1; */ + if (message.limit !== 0n) + writer.tag(1, WireType.Varint).int64(message.limit); + /* string order_by = 2; */ + if (message.orderBy !== "") + writer.tag(2, WireType.LengthDelimited).string(message.orderBy); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.ListChangesetsRequest + */ +export const ListChangesetsRequest = new ListChangesetsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListChangesetsResponse$Type extends MessageType { + constructor() { + super("pomerium.dashboard.ListChangesetsResponse", [ + { no: 1, name: "changesets", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChangesetDetails }, + { no: 2, name: "currently_deployed_changeset_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "previously_deployed_changeset_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ListChangesetsResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + message.changesets = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChangesetsResponse): ListChangesetsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated pomerium.dashboard.ChangesetDetails changesets */ 1: + message.changesets.push(ChangesetDetails.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional string currently_deployed_changeset_id */ 2: + message.currentlyDeployedChangesetId = reader.string(); + break; + case /* optional string previously_deployed_changeset_id */ 3: + message.previouslyDeployedChangesetId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListChangesetsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated pomerium.dashboard.ChangesetDetails changesets = 1; */ + for (let i = 0; i < message.changesets.length; i++) + ChangesetDetails.internalBinaryWrite(message.changesets[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* optional string currently_deployed_changeset_id = 2; */ + if (message.currentlyDeployedChangesetId !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.currentlyDeployedChangesetId); + /* optional string previously_deployed_changeset_id = 3; */ + if (message.previouslyDeployedChangesetId !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.previouslyDeployedChangesetId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.ListChangesetsResponse + */ +export const ListChangesetsResponse = new ListChangesetsResponse$Type(); +/** + * @generated ServiceType for protobuf service pomerium.dashboard.ChangesetService + */ +export const ChangesetService = new ServiceType("pomerium.dashboard.ChangesetService", [ + { name: "ApproveChangeset", options: {}, I: ApproveChangesetRequest, O: Empty }, + { name: "DeployChangeset", options: {}, I: DeployChangesetRequest, O: Empty }, + { name: "DiffChangeset", options: {}, I: DiffChangesetRequest, O: DiffChangesetResponse }, + { name: "ListChangesets", options: {}, I: ListChangesetsRequest, O: ListChangesetsResponse }, + { name: "RollbackChangeset", options: {}, I: Empty, O: Empty } +]); diff --git a/src/pomerium-console/databroker_svc.client.ts b/src/pomerium-console/databroker_svc.client.ts index 54471b3..aad14aa 100644 --- a/src/pomerium-console/databroker_svc.client.ts +++ b/src/pomerium-console/databroker_svc.client.ts @@ -4,6 +4,8 @@ import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; import { DataBroker } from "./databroker_svc"; +import type { QueryDataBrokerRecordsResponse } from "./databroker_svc"; +import type { QueryDataBrokerRecordsRequest } from "./databroker_svc"; import type { ListDataBrokerRecordTypesResponse } from "./databroker_svc"; import type { Empty } from "./google/protobuf/empty"; import { stackIntercept } from "@protobuf-ts/runtime-rpc"; @@ -23,6 +25,10 @@ export interface IDataBrokerClient { * @generated from protobuf rpc: ListDataBrokerRecordTypes(google.protobuf.Empty) returns (pomerium.dashboard.ListDataBrokerRecordTypesResponse); */ listDataBrokerRecordTypes(input: Empty, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: QueryDataBrokerRecords(pomerium.dashboard.QueryDataBrokerRecordsRequest) returns (pomerium.dashboard.QueryDataBrokerRecordsResponse); + */ + queryDataBrokerRecords(input: QueryDataBrokerRecordsRequest, options?: RpcOptions): UnaryCall; } /** * @generated from protobuf service pomerium.dashboard.DataBroker @@ -47,4 +53,11 @@ export class DataBrokerClient implements IDataBrokerClient, ServiceInfo { const method = this.methods[1], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } + /** + * @generated from protobuf rpc: QueryDataBrokerRecords(pomerium.dashboard.QueryDataBrokerRecordsRequest) returns (pomerium.dashboard.QueryDataBrokerRecordsResponse); + */ + queryDataBrokerRecords(input: QueryDataBrokerRecordsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } } diff --git a/src/pomerium-console/databroker_svc.ts b/src/pomerium-console/databroker_svc.ts index 7c5679c..3c4029c 100644 --- a/src/pomerium-console/databroker_svc.ts +++ b/src/pomerium-console/databroker_svc.ts @@ -12,7 +12,8 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; -import { Record } from "./github.com/pomerium/pomerium/pkg/grpc/databroker/databroker"; +import { Struct } from "./google/protobuf/struct"; +import { Record as Record$ } from "./github.com/pomerium/pomerium/pkg/grpc/databroker/databroker"; /** * @generated from protobuf message pomerium.dashboard.ListDataBrokerRecordsRequest */ @@ -29,7 +30,7 @@ export interface ListDataBrokerRecordsResponse { /** * @generated from protobuf field: repeated databroker.Record records = 1; */ - records: Record[]; + records: Record$[]; } /** * @generated from protobuf message pomerium.dashboard.ListDataBrokerRecordTypesResponse @@ -40,6 +41,65 @@ export interface ListDataBrokerRecordTypesResponse { */ recordTypes: string[]; } +/** + * @generated from protobuf message pomerium.dashboard.QueryDataBrokerRecordsRequest + */ +export interface QueryDataBrokerRecordsRequest { + /** + * @generated from protobuf field: string record_type = 1; + */ + recordType: string; + /** + * look up records with any fields that match the query + * + * @generated from protobuf field: string query = 2; + */ + query: string; + /** + * list records starting from an offset in the total list + * + * @generated from protobuf field: int64 offset = 3; + */ + offset: bigint; + /** + * list records up to a limit + * + * @generated from protobuf field: int64 limit = 4; + */ + limit: bigint; +} +/** + * @generated from protobuf message pomerium.dashboard.Record + */ +export interface Record { + /** + * Record ID + * + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * Record properties + * + * @generated from protobuf field: google.protobuf.Struct properties = 2; + */ + properties?: Struct; +} +/** + * @generated from protobuf message pomerium.dashboard.QueryDataBrokerRecordsResponse + */ +export interface QueryDataBrokerRecordsResponse { + /** + * Maps record IDs to record properties + * + * @generated from protobuf field: repeated pomerium.dashboard.Record records = 1; + */ + records: Record[]; + /** + * @generated from protobuf field: int64 total_count = 2; + */ + totalCount: bigint; +} // @generated message type with reflection information, may provide speed optimized methods class ListDataBrokerRecordsRequest$Type extends MessageType { constructor() { @@ -91,7 +151,7 @@ export const ListDataBrokerRecordsRequest = new ListDataBrokerRecordsRequest$Typ class ListDataBrokerRecordsResponse$Type extends MessageType { constructor() { super("pomerium.dashboard.ListDataBrokerRecordsResponse", [ - { no: 1, name: "records", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Record } + { no: 1, name: "records", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Record$ } ]); } create(value?: PartialMessage): ListDataBrokerRecordsResponse { @@ -107,7 +167,7 @@ class ListDataBrokerRecordsResponse$Type extends MessageType { + constructor() { + super("pomerium.dashboard.QueryDataBrokerRecordsRequest", [ + { no: 1, name: "record_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "query", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "offset", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "limit", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): QueryDataBrokerRecordsRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.recordType = ""; + message.query = ""; + message.offset = 0n; + message.limit = 0n; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryDataBrokerRecordsRequest): QueryDataBrokerRecordsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string record_type */ 1: + message.recordType = reader.string(); + break; + case /* string query */ 2: + message.query = reader.string(); + break; + case /* int64 offset */ 3: + message.offset = reader.int64().toBigInt(); + break; + case /* int64 limit */ 4: + message.limit = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: QueryDataBrokerRecordsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string record_type = 1; */ + if (message.recordType !== "") + writer.tag(1, WireType.LengthDelimited).string(message.recordType); + /* string query = 2; */ + if (message.query !== "") + writer.tag(2, WireType.LengthDelimited).string(message.query); + /* int64 offset = 3; */ + if (message.offset !== 0n) + writer.tag(3, WireType.Varint).int64(message.offset); + /* int64 limit = 4; */ + if (message.limit !== 0n) + writer.tag(4, WireType.Varint).int64(message.limit); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.QueryDataBrokerRecordsRequest + */ +export const QueryDataBrokerRecordsRequest = new QueryDataBrokerRecordsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Record$Type extends MessageType { + constructor() { + super("pomerium.dashboard.Record", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "properties", kind: "message", T: () => Struct } + ]); + } + create(value?: PartialMessage): Record { + const message = globalThis.Object.create((this.messagePrototype!)); + message.id = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Record): Record { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* google.protobuf.Struct properties */ 2: + message.properties = Struct.internalBinaryRead(reader, reader.uint32(), options, message.properties); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Record, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* google.protobuf.Struct properties = 2; */ + if (message.properties) + Struct.internalBinaryWrite(message.properties, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.Record + */ +export const Record = new Record$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryDataBrokerRecordsResponse$Type extends MessageType { + constructor() { + super("pomerium.dashboard.QueryDataBrokerRecordsResponse", [ + { no: 1, name: "records", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Record }, + { no: 2, name: "total_count", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): QueryDataBrokerRecordsResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + message.records = []; + message.totalCount = 0n; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryDataBrokerRecordsResponse): QueryDataBrokerRecordsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated pomerium.dashboard.Record records */ 1: + message.records.push(Record.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* int64 total_count */ 2: + message.totalCount = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: QueryDataBrokerRecordsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated pomerium.dashboard.Record records = 1; */ + for (let i = 0; i < message.records.length; i++) + Record.internalBinaryWrite(message.records[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* int64 total_count = 2; */ + if (message.totalCount !== 0n) + writer.tag(2, WireType.Varint).int64(message.totalCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message pomerium.dashboard.QueryDataBrokerRecordsResponse + */ +export const QueryDataBrokerRecordsResponse = new QueryDataBrokerRecordsResponse$Type(); /** * @generated ServiceType for protobuf service pomerium.dashboard.DataBroker */ export const DataBroker = new ServiceType("pomerium.dashboard.DataBroker", [ { name: "ListDataBrokerRecords", options: {}, I: ListDataBrokerRecordsRequest, O: ListDataBrokerRecordsResponse }, - { name: "ListDataBrokerRecordTypes", options: {}, I: Empty, O: ListDataBrokerRecordTypesResponse } + { name: "ListDataBrokerRecordTypes", options: {}, I: Empty, O: ListDataBrokerRecordTypesResponse }, + { name: "QueryDataBrokerRecords", options: {}, I: QueryDataBrokerRecordsRequest, O: QueryDataBrokerRecordsResponse } ]); diff --git a/src/pomerium-console/external_data_sources.ts b/src/pomerium-console/external_data_sources.ts index 86d3116..d69d5af 100644 --- a/src/pomerium-console/external_data_sources.ts +++ b/src/pomerium-console/external_data_sources.ts @@ -35,7 +35,7 @@ export interface ExternalDataSource { */ deletedAt?: Timestamp; /** - * Url is th URL to query for data. + * Url is the URL to query for data. * * @generated from protobuf field: string url = 5; */ diff --git a/src/pomerium-console/routes.ts b/src/pomerium-console/routes.ts index 8b228bf..4bf860b 100644 --- a/src/pomerium-console/routes.ts +++ b/src/pomerium-console/routes.ts @@ -226,6 +226,10 @@ export interface Route { * @generated from protobuf field: optional string kubernetes_service_account_token = 27; */ kubernetesServiceAccountToken?: string; + /** + * @generated from protobuf field: optional string kubernetes_service_account_token_file = 60; + */ + kubernetesServiceAccountTokenFile?: string; /** * @generated from protobuf field: envoy.config.cluster.v3.Cluster envoy_opts = 39; */ @@ -234,6 +238,10 @@ export interface Route { * @generated from protobuf field: bool enable_google_cloud_serverless_authentication = 46; */ enableGoogleCloudServerlessAuthentication: boolean; + /** + * @generated from protobuf field: pomerium.dashboard.IssuerFormat jwt_issuer_format = 61; + */ + jwtIssuerFormat: IssuerFormat; /** * @generated from protobuf field: optional string idp_client_id = 57; */ @@ -464,6 +472,25 @@ export interface MoveRoutesRequest { */ export interface MoveRoutesResponse { } +/** + * @generated from protobuf enum pomerium.dashboard.IssuerFormat + */ +export enum IssuerFormat { + /** + * Issuer strings will be the hostname of the route, with no scheme or + * trailing slash. + * + * @generated from protobuf enum value: IssuerHostOnly = 0; + */ + IssuerHostOnly = 0, + /** + * Issuer strings will be a complete URI, including the scheme and ending + * with a trailing slash. + * + * @generated from protobuf enum value: IssuerURI = 1; + */ + IssuerURI = 1 +} // @generated message type with reflection information, may provide speed optimized methods class RouteRewriteHeader$Type extends MessageType { constructor() { @@ -629,8 +656,10 @@ class Route$Type extends MessageType { { no: 25, name: "preserve_host_header", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, { no: 26, name: "pass_identity_headers", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, { no: 27, name: "kubernetes_service_account_token", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 60, name: "kubernetes_service_account_token_file", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 39, name: "envoy_opts", kind: "message", T: () => Cluster }, { no: 46, name: "enable_google_cloud_serverless_authentication", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 61, name: "jwt_issuer_format", kind: "enum", T: () => ["pomerium.dashboard.IssuerFormat", IssuerFormat] }, { no: 57, name: "idp_client_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 58, name: "idp_client_secret", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, { no: 53, name: "show_error_details", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, @@ -653,6 +682,7 @@ class Route$Type extends MessageType { message.setResponseHeaders = {}; message.rewriteResponseHeaders = []; message.enableGoogleCloudServerlessAuthentication = false; + message.jwtIssuerFormat = 0; message.showErrorDetails = false; message.originatorId = ""; message.policyIds = []; @@ -787,12 +817,18 @@ class Route$Type extends MessageType { case /* optional string kubernetes_service_account_token */ 27: message.kubernetesServiceAccountToken = reader.string(); break; + case /* optional string kubernetes_service_account_token_file */ 60: + message.kubernetesServiceAccountTokenFile = reader.string(); + break; case /* envoy.config.cluster.v3.Cluster envoy_opts */ 39: message.envoyOpts = Cluster.internalBinaryRead(reader, reader.uint32(), options, message.envoyOpts); break; case /* bool enable_google_cloud_serverless_authentication */ 46: message.enableGoogleCloudServerlessAuthentication = reader.bool(); break; + case /* pomerium.dashboard.IssuerFormat jwt_issuer_format */ 61: + message.jwtIssuerFormat = reader.int32(); + break; case /* optional string idp_client_id */ 57: message.idpClientId = reader.string(); break; @@ -978,12 +1014,18 @@ class Route$Type extends MessageType { /* optional string kubernetes_service_account_token = 27; */ if (message.kubernetesServiceAccountToken !== undefined) writer.tag(27, WireType.LengthDelimited).string(message.kubernetesServiceAccountToken); + /* optional string kubernetes_service_account_token_file = 60; */ + if (message.kubernetesServiceAccountTokenFile !== undefined) + writer.tag(60, WireType.LengthDelimited).string(message.kubernetesServiceAccountTokenFile); /* envoy.config.cluster.v3.Cluster envoy_opts = 39; */ if (message.envoyOpts) Cluster.internalBinaryWrite(message.envoyOpts, writer.tag(39, WireType.LengthDelimited).fork(), options).join(); /* bool enable_google_cloud_serverless_authentication = 46; */ if (message.enableGoogleCloudServerlessAuthentication !== false) writer.tag(46, WireType.Varint).bool(message.enableGoogleCloudServerlessAuthentication); + /* pomerium.dashboard.IssuerFormat jwt_issuer_format = 61; */ + if (message.jwtIssuerFormat !== 0) + writer.tag(61, WireType.Varint).int32(message.jwtIssuerFormat); /* optional string idp_client_id = 57; */ if (message.idpClientId !== undefined) writer.tag(57, WireType.LengthDelimited).string(message.idpClientId); diff --git a/src/pomerium-console/settings.ts b/src/pomerium-console/settings.ts index 5652c7a..d402cbe 100644 --- a/src/pomerium-console/settings.ts +++ b/src/pomerium-console/settings.ts @@ -22,6 +22,10 @@ export interface ConsoleSettings { * @generated from protobuf field: bool enable_feedback_widget = 1; */ enableFeedbackWidget: boolean; + /** + * @generated from protobuf field: bool use_changesets = 2; + */ + useChangesets: boolean; } /** * Settings defines the global pomerium settings @@ -405,12 +409,14 @@ export interface SetSettingsResponse { class ConsoleSettings$Type extends MessageType { constructor() { super("pomerium.dashboard.ConsoleSettings", [ - { no: 1, name: "enable_feedback_widget", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + { no: 1, name: "enable_feedback_widget", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "use_changesets", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): ConsoleSettings { const message = globalThis.Object.create((this.messagePrototype!)); message.enableFeedbackWidget = false; + message.useChangesets = false; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -423,6 +429,9 @@ class ConsoleSettings$Type extends MessageType { case /* bool enable_feedback_widget */ 1: message.enableFeedbackWidget = reader.bool(); break; + case /* bool use_changesets */ 2: + message.useChangesets = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -438,6 +447,9 @@ class ConsoleSettings$Type extends MessageType { /* bool enable_feedback_widget = 1; */ if (message.enableFeedbackWidget !== false) writer.tag(1, WireType.Varint).bool(message.enableFeedbackWidget); + /* bool use_changesets = 2; */ + if (message.useChangesets !== false) + writer.tag(2, WireType.Varint).bool(message.useChangesets); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);