UNPKG

ts-spiffe

Version:
102 lines (101 loc) 5.72 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/server/entry.proto" (package "spire.api.server.entry.v1", syntax proto3) // tslint:disable "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EntryClient = 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/server/entry.proto" (package "spire.api.server.entry.v1", syntax proto3) // tslint:disable const entry_1 = require("./entry"); const grpc = require("@grpc/grpc-js"); /** * Manages registration entries stored by the SPIRE Server. * * @generated from protobuf service spire.api.server.entry.v1.Entry */ class EntryClient extends grpc.Client { constructor(address, credentials, options = {}, binaryOptions = {}) { super(address, credentials, options); this._binaryOptions = binaryOptions; } /** * Count entries. * * The caller must be local or present an admin X509-SVID. * * @generated from protobuf rpc: CountEntries(spire.api.server.entry.v1.CountEntriesRequest) returns (spire.api.server.entry.v1.CountEntriesResponse); */ countEntries(input, metadata, options, callback) { const method = entry_1.Entry.methods[0]; return this.makeUnaryRequest(`/${entry_1.Entry.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } /** * Lists entries. * * The caller must be local or present an admin X509-SVID. * * @generated from protobuf rpc: ListEntries(spire.api.server.entry.v1.ListEntriesRequest) returns (spire.api.server.entry.v1.ListEntriesResponse); */ listEntries(input, metadata, options, callback) { const method = entry_1.Entry.methods[1]; return this.makeUnaryRequest(`/${entry_1.Entry.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } /** * Gets an entry. If the entry does not exist, NOT_FOUND is returned. * * The caller must be local or present an admin X509-SVID. * * @generated from protobuf rpc: GetEntry(spire.api.server.entry.v1.GetEntryRequest) returns (spire.api.types.Entry); */ getEntry(input, metadata, options, callback) { const method = entry_1.Entry.methods[2]; return this.makeUnaryRequest(`/${entry_1.Entry.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } /** * Batch creates one or more entries. * * The caller must be local or present an admin X509-SVID. * * @generated from protobuf rpc: BatchCreateEntry(spire.api.server.entry.v1.BatchCreateEntryRequest) returns (spire.api.server.entry.v1.BatchCreateEntryResponse); */ batchCreateEntry(input, metadata, options, callback) { const method = entry_1.Entry.methods[3]; return this.makeUnaryRequest(`/${entry_1.Entry.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } /** * Batch updates one or more entries. * * The caller must be local or present an admin X509-SVID. * * @generated from protobuf rpc: BatchUpdateEntry(spire.api.server.entry.v1.BatchUpdateEntryRequest) returns (spire.api.server.entry.v1.BatchUpdateEntryResponse); */ batchUpdateEntry(input, metadata, options, callback) { const method = entry_1.Entry.methods[4]; return this.makeUnaryRequest(`/${entry_1.Entry.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } /** * Batch deletes one or more entries. * * The caller must be local or present an admin X509-SVID. * * @generated from protobuf rpc: BatchDeleteEntry(spire.api.server.entry.v1.BatchDeleteEntryRequest) returns (spire.api.server.entry.v1.BatchDeleteEntryResponse); */ batchDeleteEntry(input, metadata, options, callback) { const method = entry_1.Entry.methods[5]; return this.makeUnaryRequest(`/${entry_1.Entry.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } /** * Gets the entries the caller is authorized for. * * The caller must present an active agent X509-SVID. See the Agent * AttestAgent/RenewAgent RPCs. * * @generated from protobuf rpc: GetAuthorizedEntries(spire.api.server.entry.v1.GetAuthorizedEntriesRequest) returns (spire.api.server.entry.v1.GetAuthorizedEntriesResponse); */ getAuthorizedEntries(input, metadata, options, callback) { const method = entry_1.Entry.methods[6]; return this.makeUnaryRequest(`/${entry_1.Entry.typeName}/${method.name}`, (value) => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value) => method.O.fromBinary(value, this._binaryOptions), input, metadata, options, callback); } } exports.EntryClient = EntryClient;