UNPKG

ts-spiffe

Version:
72 lines (71 loc) 4.78 kB
// @generated by protobuf-ts 2.9.1 with parameter output_legacy_commonjs,client_grpc1,server_none,output_javascript_es2019 // @generated from protobuf file "spire/api/agent/delegatedidentity.proto" (package "spire.api.agent.delegatedidentity.v1", syntax proto3) // tslint:disable "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DelegatedIdentityClient = void 0; // @generated by protobuf-ts 2.9.1 with parameter output_legacy_commonjs,client_grpc1,server_none,output_javascript_es2019 // @generated from protobuf file "spire/api/agent/delegatedidentity.proto" (package "spire.api.agent.delegatedidentity.v1", syntax proto3) // tslint:disable const delegatedidentity_1 = require("./delegatedidentity"); const grpc = require("@grpc/grpc-js"); /** * The delegatedIdentity service provides an interface to get the SVIDs of other * workloads on the host. This service is intended for use cases where a process * (different than the workload one) should access the workload's SVID to * perform actions on behalf of the workload. One example of is using a single * node instance of Envoy that upgrades TCP connections for different processes * running in such a node. * * The caller must be local and its identity must be listed in the allowed * clients on the spire-agent configuration. * * @generated from protobuf service spire.api.agent.delegatedidentity.v1.DelegatedIdentity */ class DelegatedIdentityClient extends grpc.Client { constructor(address, credentials, options = {}, binaryOptions = {}) { super(address, credentials, options); this._binaryOptions = binaryOptions; } /** * Subscribe to get X.509-SVIDs for workloads that match the given selectors. * The lifetime of the subscription aligns to the lifetime of the stream. * * @generated from protobuf rpc: SubscribeToX509SVIDs(spire.api.agent.delegatedidentity.v1.SubscribeToX509SVIDsRequest) returns (stream spire.api.agent.delegatedidentity.v1.SubscribeToX509SVIDsResponse); */ subscribeToX509SVIDs(input, metadata, options) { const method = delegatedidentity_1.DelegatedIdentity.methods[0]; return this.makeServerStreamRequest(`/${delegatedidentity_1.DelegatedIdentity.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options); } /** * Subscribe to get local and all federated bundles. * The lifetime of the subscription aligns to the lifetime of the stream. * * @generated from protobuf rpc: SubscribeToX509Bundles(spire.api.agent.delegatedidentity.v1.SubscribeToX509BundlesRequest) returns (stream spire.api.agent.delegatedidentity.v1.SubscribeToX509BundlesResponse); */ subscribeToX509Bundles(input, metadata, options) { const method = delegatedidentity_1.DelegatedIdentity.methods[1]; return this.makeServerStreamRequest(`/${delegatedidentity_1.DelegatedIdentity.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options); } /** * Fetch JWT-SVIDs for workloads that match the given selectors, and * for the requested audience. * * @generated from protobuf rpc: FetchJWTSVIDs(spire.api.agent.delegatedidentity.v1.FetchJWTSVIDsRequest) returns (spire.api.agent.delegatedidentity.v1.FetchJWTSVIDsResponse); */ fetchJWTSVIDs(input, metadata, options, callback) { const method = delegatedidentity_1.DelegatedIdentity.methods[2]; return this.makeUnaryRequest(`/${delegatedidentity_1.DelegatedIdentity.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } /** * Subscribe to get local and all federated JWKS bundles. * The lifetime of the subscription aligns to the lifetime of the stream. * * @generated from protobuf rpc: SubscribeToJWTBundles(spire.api.agent.delegatedidentity.v1.SubscribeToJWTBundlesRequest) returns (stream spire.api.agent.delegatedidentity.v1.SubscribeToJWTBundlesResponse); */ subscribeToJWTBundles(input, metadata, options) { const method = delegatedidentity_1.DelegatedIdentity.methods[3]; return this.makeServerStreamRequest(`/${delegatedidentity_1.DelegatedIdentity.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options); } } exports.DelegatedIdentityClient = DelegatedIdentityClient;