open-vault/sdk/plugin/pb/backend_grpc.pb.go

1136 lines
44 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package pb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// BackendClient is the client API for Backend service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type BackendClient interface {
// HandleRequest is used to handle a request and generate a response.
// The plugins must check the operation type and handle appropriately.
HandleRequest(ctx context.Context, in *HandleRequestArgs, opts ...grpc.CallOption) (*HandleRequestReply, error)
// SpecialPaths is a list of paths that are special in some way.
// See PathType for the types of special paths. The key is the type
// of the special path, and the value is a list of paths for this type.
// This is not a regular expression but is an exact match. If the path
// ends in '*' then it is a prefix-based match. The '*' can only appear
// at the end.
SpecialPaths(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SpecialPathsReply, error)
// HandleExistenceCheck is used to handle a request and generate a response
// indicating whether the given path exists or not; this is used to
// understand whether the request must have a Create or Update capability
// ACL applied. The first bool indicates whether an existence check
// function was found for the backend; the second indicates whether, if an
// existence check function was found, the item exists or not.
HandleExistenceCheck(ctx context.Context, in *HandleExistenceCheckArgs, opts ...grpc.CallOption) (*HandleExistenceCheckReply, error)
// Cleanup is invoked during an unmount of a backend to allow it to
// handle any cleanup like connection closing or releasing of file handles.
// Cleanup is called right before Vault closes the plugin process.
Cleanup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
// InvalidateKey may be invoked when an object is modified that belongs
// to the backend. The backend can use this to clear any caches or reset
// internal state as needed.
InvalidateKey(ctx context.Context, in *InvalidateKeyArgs, opts ...grpc.CallOption) (*Empty, error)
// Setup is used to set up the backend based on the provided backend
// configuration. The plugin's setup implementation should use the provided
// broker_id to create a connection back to Vault for use with the Storage
// and SystemView clients.
Setup(ctx context.Context, in *SetupArgs, opts ...grpc.CallOption) (*SetupReply, error)
// Initialize is invoked just after mounting a backend to allow it to
// handle any initialization tasks that need to be performed.
Initialize(ctx context.Context, in *InitializeArgs, opts ...grpc.CallOption) (*InitializeReply, error)
// Type returns the BackendType for the particular backend
Type(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TypeReply, error)
}
type backendClient struct {
cc grpc.ClientConnInterface
}
func NewBackendClient(cc grpc.ClientConnInterface) BackendClient {
return &backendClient{cc}
}
func (c *backendClient) HandleRequest(ctx context.Context, in *HandleRequestArgs, opts ...grpc.CallOption) (*HandleRequestReply, error) {
out := new(HandleRequestReply)
err := c.cc.Invoke(ctx, "/pb.Backend/HandleRequest", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) SpecialPaths(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SpecialPathsReply, error) {
out := new(SpecialPathsReply)
err := c.cc.Invoke(ctx, "/pb.Backend/SpecialPaths", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) HandleExistenceCheck(ctx context.Context, in *HandleExistenceCheckArgs, opts ...grpc.CallOption) (*HandleExistenceCheckReply, error) {
out := new(HandleExistenceCheckReply)
err := c.cc.Invoke(ctx, "/pb.Backend/HandleExistenceCheck", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) Cleanup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/pb.Backend/Cleanup", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) InvalidateKey(ctx context.Context, in *InvalidateKeyArgs, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/pb.Backend/InvalidateKey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) Setup(ctx context.Context, in *SetupArgs, opts ...grpc.CallOption) (*SetupReply, error) {
out := new(SetupReply)
err := c.cc.Invoke(ctx, "/pb.Backend/Setup", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) Initialize(ctx context.Context, in *InitializeArgs, opts ...grpc.CallOption) (*InitializeReply, error) {
out := new(InitializeReply)
err := c.cc.Invoke(ctx, "/pb.Backend/Initialize", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) Type(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TypeReply, error) {
out := new(TypeReply)
err := c.cc.Invoke(ctx, "/pb.Backend/Type", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BackendServer is the server API for Backend service.
// All implementations must embed UnimplementedBackendServer
// for forward compatibility
type BackendServer interface {
// HandleRequest is used to handle a request and generate a response.
// The plugins must check the operation type and handle appropriately.
HandleRequest(context.Context, *HandleRequestArgs) (*HandleRequestReply, error)
// SpecialPaths is a list of paths that are special in some way.
// See PathType for the types of special paths. The key is the type
// of the special path, and the value is a list of paths for this type.
// This is not a regular expression but is an exact match. If the path
// ends in '*' then it is a prefix-based match. The '*' can only appear
// at the end.
SpecialPaths(context.Context, *Empty) (*SpecialPathsReply, error)
// HandleExistenceCheck is used to handle a request and generate a response
// indicating whether the given path exists or not; this is used to
// understand whether the request must have a Create or Update capability
// ACL applied. The first bool indicates whether an existence check
// function was found for the backend; the second indicates whether, if an
// existence check function was found, the item exists or not.
HandleExistenceCheck(context.Context, *HandleExistenceCheckArgs) (*HandleExistenceCheckReply, error)
// Cleanup is invoked during an unmount of a backend to allow it to
// handle any cleanup like connection closing or releasing of file handles.
// Cleanup is called right before Vault closes the plugin process.
Cleanup(context.Context, *Empty) (*Empty, error)
// InvalidateKey may be invoked when an object is modified that belongs
// to the backend. The backend can use this to clear any caches or reset
// internal state as needed.
InvalidateKey(context.Context, *InvalidateKeyArgs) (*Empty, error)
// Setup is used to set up the backend based on the provided backend
// configuration. The plugin's setup implementation should use the provided
// broker_id to create a connection back to Vault for use with the Storage
// and SystemView clients.
Setup(context.Context, *SetupArgs) (*SetupReply, error)
// Initialize is invoked just after mounting a backend to allow it to
// handle any initialization tasks that need to be performed.
Initialize(context.Context, *InitializeArgs) (*InitializeReply, error)
// Type returns the BackendType for the particular backend
Type(context.Context, *Empty) (*TypeReply, error)
mustEmbedUnimplementedBackendServer()
}
// UnimplementedBackendServer must be embedded to have forward compatible implementations.
type UnimplementedBackendServer struct {
}
func (UnimplementedBackendServer) HandleRequest(context.Context, *HandleRequestArgs) (*HandleRequestReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleRequest not implemented")
}
func (UnimplementedBackendServer) SpecialPaths(context.Context, *Empty) (*SpecialPathsReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SpecialPaths not implemented")
}
func (UnimplementedBackendServer) HandleExistenceCheck(context.Context, *HandleExistenceCheckArgs) (*HandleExistenceCheckReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleExistenceCheck not implemented")
}
func (UnimplementedBackendServer) Cleanup(context.Context, *Empty) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Cleanup not implemented")
}
func (UnimplementedBackendServer) InvalidateKey(context.Context, *InvalidateKeyArgs) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method InvalidateKey not implemented")
}
func (UnimplementedBackendServer) Setup(context.Context, *SetupArgs) (*SetupReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Setup not implemented")
}
func (UnimplementedBackendServer) Initialize(context.Context, *InitializeArgs) (*InitializeReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented")
}
func (UnimplementedBackendServer) Type(context.Context, *Empty) (*TypeReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Type not implemented")
}
func (UnimplementedBackendServer) mustEmbedUnimplementedBackendServer() {}
// UnsafeBackendServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BackendServer will
// result in compilation errors.
type UnsafeBackendServer interface {
mustEmbedUnimplementedBackendServer()
}
func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer) {
s.RegisterService(&Backend_ServiceDesc, srv)
}
func _Backend_HandleRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HandleRequestArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).HandleRequest(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/HandleRequest",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).HandleRequest(ctx, req.(*HandleRequestArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_SpecialPaths_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).SpecialPaths(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/SpecialPaths",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).SpecialPaths(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_HandleExistenceCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HandleExistenceCheckArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).HandleExistenceCheck(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/HandleExistenceCheck",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).HandleExistenceCheck(ctx, req.(*HandleExistenceCheckArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_Cleanup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).Cleanup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/Cleanup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).Cleanup(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_InvalidateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InvalidateKeyArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).InvalidateKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/InvalidateKey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).InvalidateKey(ctx, req.(*InvalidateKeyArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_Setup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetupArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).Setup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/Setup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).Setup(ctx, req.(*SetupArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_Initialize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InitializeArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).Initialize(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/Initialize",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).Initialize(ctx, req.(*InitializeArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_Type_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).Type(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Backend/Type",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).Type(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
// Backend_ServiceDesc is the grpc.ServiceDesc for Backend service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Backend_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.Backend",
HandlerType: (*BackendServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "HandleRequest",
Handler: _Backend_HandleRequest_Handler,
},
{
MethodName: "SpecialPaths",
Handler: _Backend_SpecialPaths_Handler,
},
{
MethodName: "HandleExistenceCheck",
Handler: _Backend_HandleExistenceCheck_Handler,
},
{
MethodName: "Cleanup",
Handler: _Backend_Cleanup_Handler,
},
{
MethodName: "InvalidateKey",
Handler: _Backend_InvalidateKey_Handler,
},
{
MethodName: "Setup",
Handler: _Backend_Setup_Handler,
},
{
MethodName: "Initialize",
Handler: _Backend_Initialize_Handler,
},
{
MethodName: "Type",
Handler: _Backend_Type_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "sdk/plugin/pb/backend.proto",
}
// StorageClient is the client API for Storage service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type StorageClient interface {
List(ctx context.Context, in *StorageListArgs, opts ...grpc.CallOption) (*StorageListReply, error)
Get(ctx context.Context, in *StorageGetArgs, opts ...grpc.CallOption) (*StorageGetReply, error)
Put(ctx context.Context, in *StoragePutArgs, opts ...grpc.CallOption) (*StoragePutReply, error)
Delete(ctx context.Context, in *StorageDeleteArgs, opts ...grpc.CallOption) (*StorageDeleteReply, error)
}
type storageClient struct {
cc grpc.ClientConnInterface
}
func NewStorageClient(cc grpc.ClientConnInterface) StorageClient {
return &storageClient{cc}
}
func (c *storageClient) List(ctx context.Context, in *StorageListArgs, opts ...grpc.CallOption) (*StorageListReply, error) {
out := new(StorageListReply)
err := c.cc.Invoke(ctx, "/pb.Storage/List", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *storageClient) Get(ctx context.Context, in *StorageGetArgs, opts ...grpc.CallOption) (*StorageGetReply, error) {
out := new(StorageGetReply)
err := c.cc.Invoke(ctx, "/pb.Storage/Get", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *storageClient) Put(ctx context.Context, in *StoragePutArgs, opts ...grpc.CallOption) (*StoragePutReply, error) {
out := new(StoragePutReply)
err := c.cc.Invoke(ctx, "/pb.Storage/Put", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *storageClient) Delete(ctx context.Context, in *StorageDeleteArgs, opts ...grpc.CallOption) (*StorageDeleteReply, error) {
out := new(StorageDeleteReply)
err := c.cc.Invoke(ctx, "/pb.Storage/Delete", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// StorageServer is the server API for Storage service.
// All implementations must embed UnimplementedStorageServer
// for forward compatibility
type StorageServer interface {
List(context.Context, *StorageListArgs) (*StorageListReply, error)
Get(context.Context, *StorageGetArgs) (*StorageGetReply, error)
Put(context.Context, *StoragePutArgs) (*StoragePutReply, error)
Delete(context.Context, *StorageDeleteArgs) (*StorageDeleteReply, error)
mustEmbedUnimplementedStorageServer()
}
// UnimplementedStorageServer must be embedded to have forward compatible implementations.
type UnimplementedStorageServer struct {
}
func (UnimplementedStorageServer) List(context.Context, *StorageListArgs) (*StorageListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedStorageServer) Get(context.Context, *StorageGetArgs) (*StorageGetReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedStorageServer) Put(context.Context, *StoragePutArgs) (*StoragePutReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Put not implemented")
}
func (UnimplementedStorageServer) Delete(context.Context, *StorageDeleteArgs) (*StorageDeleteReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedStorageServer) mustEmbedUnimplementedStorageServer() {}
// UnsafeStorageServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to StorageServer will
// result in compilation errors.
type UnsafeStorageServer interface {
mustEmbedUnimplementedStorageServer()
}
func RegisterStorageServer(s grpc.ServiceRegistrar, srv StorageServer) {
s.RegisterService(&Storage_ServiceDesc, srv)
}
func _Storage_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StorageListArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StorageServer).List(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Storage/List",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(StorageServer).List(ctx, req.(*StorageListArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Storage_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StorageGetArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StorageServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Storage/Get",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(StorageServer).Get(ctx, req.(*StorageGetArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Storage_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StoragePutArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StorageServer).Put(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Storage/Put",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(StorageServer).Put(ctx, req.(*StoragePutArgs))
}
return interceptor(ctx, in, info, handler)
}
func _Storage_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StorageDeleteArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StorageServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Storage/Delete",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(StorageServer).Delete(ctx, req.(*StorageDeleteArgs))
}
return interceptor(ctx, in, info, handler)
}
// Storage_ServiceDesc is the grpc.ServiceDesc for Storage service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Storage_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.Storage",
HandlerType: (*StorageServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "List",
Handler: _Storage_List_Handler,
},
{
MethodName: "Get",
Handler: _Storage_Get_Handler,
},
{
MethodName: "Put",
Handler: _Storage_Put_Handler,
},
{
MethodName: "Delete",
Handler: _Storage_Delete_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "sdk/plugin/pb/backend.proto",
}
// SystemViewClient is the client API for SystemView service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SystemViewClient interface {
// DefaultLeaseTTL returns the default lease TTL set in Vault configuration
DefaultLeaseTTL(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TTLReply, error)
// MaxLeaseTTL returns the max lease TTL set in Vault configuration; backend
// authors should take care not to issue credentials that last longer than
// this value, as Vault will revoke them
MaxLeaseTTL(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TTLReply, error)
// Tainted, returns true if the mount is tainted. A mount is tainted if it is in the
// process of being unmounted. This should only be used in special
// circumstances; a primary use-case is as a guard in revocation functions.
// If revocation of a backend's leases fails it can keep the unmounting
// process from being successful. If the reason for this failure is not
// relevant when the mount is tainted (for instance, saving a CRL to disk
// when the stored CRL will be removed during the unmounting process
// anyways), we can ignore the errors to allow unmounting to complete.
Tainted(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TaintedReply, error)
// CachingDisabled returns true if caching is disabled. If true, no caches
// should be used, despite known slowdowns.
CachingDisabled(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CachingDisabledReply, error)
// ReplicationState indicates the state of cluster replication
ReplicationState(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ReplicationStateReply, error)
// ResponseWrapData wraps the given data in a cubbyhole and returns the
// token used to unwrap.
ResponseWrapData(ctx context.Context, in *ResponseWrapDataArgs, opts ...grpc.CallOption) (*ResponseWrapDataReply, error)
// MlockEnabled returns the configuration setting for enabling mlock on
// plugins.
MlockEnabled(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*MlockEnabledReply, error)
// LocalMount, when run from a system view attached to a request, indicates
// whether the request is affecting a local mount or not
LocalMount(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*LocalMountReply, error)
// EntityInfo returns the basic entity information for the given entity id
EntityInfo(ctx context.Context, in *EntityInfoArgs, opts ...grpc.CallOption) (*EntityInfoReply, error)
// PluginEnv returns Vault environment information used by plugins
PluginEnv(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PluginEnvReply, error)
// GroupsForEntity returns the group membership information for the given
// entity id
GroupsForEntity(ctx context.Context, in *EntityInfoArgs, opts ...grpc.CallOption) (*GroupsForEntityReply, error)
// GeneratePasswordFromPolicy generates a password from an existing password policy
GeneratePasswordFromPolicy(ctx context.Context, in *GeneratePasswordFromPolicyRequest, opts ...grpc.CallOption) (*GeneratePasswordFromPolicyReply, error)
}
type systemViewClient struct {
cc grpc.ClientConnInterface
}
func NewSystemViewClient(cc grpc.ClientConnInterface) SystemViewClient {
return &systemViewClient{cc}
}
func (c *systemViewClient) DefaultLeaseTTL(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TTLReply, error) {
out := new(TTLReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/DefaultLeaseTTL", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) MaxLeaseTTL(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TTLReply, error) {
out := new(TTLReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/MaxLeaseTTL", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) Tainted(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TaintedReply, error) {
out := new(TaintedReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/Tainted", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) CachingDisabled(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CachingDisabledReply, error) {
out := new(CachingDisabledReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/CachingDisabled", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) ReplicationState(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ReplicationStateReply, error) {
out := new(ReplicationStateReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/ReplicationState", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) ResponseWrapData(ctx context.Context, in *ResponseWrapDataArgs, opts ...grpc.CallOption) (*ResponseWrapDataReply, error) {
out := new(ResponseWrapDataReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/ResponseWrapData", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) MlockEnabled(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*MlockEnabledReply, error) {
out := new(MlockEnabledReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/MlockEnabled", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) LocalMount(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*LocalMountReply, error) {
out := new(LocalMountReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/LocalMount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) EntityInfo(ctx context.Context, in *EntityInfoArgs, opts ...grpc.CallOption) (*EntityInfoReply, error) {
out := new(EntityInfoReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/EntityInfo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) PluginEnv(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PluginEnvReply, error) {
out := new(PluginEnvReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/PluginEnv", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) GroupsForEntity(ctx context.Context, in *EntityInfoArgs, opts ...grpc.CallOption) (*GroupsForEntityReply, error) {
out := new(GroupsForEntityReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/GroupsForEntity", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *systemViewClient) GeneratePasswordFromPolicy(ctx context.Context, in *GeneratePasswordFromPolicyRequest, opts ...grpc.CallOption) (*GeneratePasswordFromPolicyReply, error) {
out := new(GeneratePasswordFromPolicyReply)
err := c.cc.Invoke(ctx, "/pb.SystemView/GeneratePasswordFromPolicy", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SystemViewServer is the server API for SystemView service.
// All implementations must embed UnimplementedSystemViewServer
// for forward compatibility
type SystemViewServer interface {
// DefaultLeaseTTL returns the default lease TTL set in Vault configuration
DefaultLeaseTTL(context.Context, *Empty) (*TTLReply, error)
// MaxLeaseTTL returns the max lease TTL set in Vault configuration; backend
// authors should take care not to issue credentials that last longer than
// this value, as Vault will revoke them
MaxLeaseTTL(context.Context, *Empty) (*TTLReply, error)
// Tainted, returns true if the mount is tainted. A mount is tainted if it is in the
// process of being unmounted. This should only be used in special
// circumstances; a primary use-case is as a guard in revocation functions.
// If revocation of a backend's leases fails it can keep the unmounting
// process from being successful. If the reason for this failure is not
// relevant when the mount is tainted (for instance, saving a CRL to disk
// when the stored CRL will be removed during the unmounting process
// anyways), we can ignore the errors to allow unmounting to complete.
Tainted(context.Context, *Empty) (*TaintedReply, error)
// CachingDisabled returns true if caching is disabled. If true, no caches
// should be used, despite known slowdowns.
CachingDisabled(context.Context, *Empty) (*CachingDisabledReply, error)
// ReplicationState indicates the state of cluster replication
ReplicationState(context.Context, *Empty) (*ReplicationStateReply, error)
// ResponseWrapData wraps the given data in a cubbyhole and returns the
// token used to unwrap.
ResponseWrapData(context.Context, *ResponseWrapDataArgs) (*ResponseWrapDataReply, error)
// MlockEnabled returns the configuration setting for enabling mlock on
// plugins.
MlockEnabled(context.Context, *Empty) (*MlockEnabledReply, error)
// LocalMount, when run from a system view attached to a request, indicates
// whether the request is affecting a local mount or not
LocalMount(context.Context, *Empty) (*LocalMountReply, error)
// EntityInfo returns the basic entity information for the given entity id
EntityInfo(context.Context, *EntityInfoArgs) (*EntityInfoReply, error)
// PluginEnv returns Vault environment information used by plugins
PluginEnv(context.Context, *Empty) (*PluginEnvReply, error)
// GroupsForEntity returns the group membership information for the given
// entity id
GroupsForEntity(context.Context, *EntityInfoArgs) (*GroupsForEntityReply, error)
// GeneratePasswordFromPolicy generates a password from an existing password policy
GeneratePasswordFromPolicy(context.Context, *GeneratePasswordFromPolicyRequest) (*GeneratePasswordFromPolicyReply, error)
mustEmbedUnimplementedSystemViewServer()
}
// UnimplementedSystemViewServer must be embedded to have forward compatible implementations.
type UnimplementedSystemViewServer struct {
}
func (UnimplementedSystemViewServer) DefaultLeaseTTL(context.Context, *Empty) (*TTLReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DefaultLeaseTTL not implemented")
}
func (UnimplementedSystemViewServer) MaxLeaseTTL(context.Context, *Empty) (*TTLReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method MaxLeaseTTL not implemented")
}
func (UnimplementedSystemViewServer) Tainted(context.Context, *Empty) (*TaintedReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Tainted not implemented")
}
func (UnimplementedSystemViewServer) CachingDisabled(context.Context, *Empty) (*CachingDisabledReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method CachingDisabled not implemented")
}
func (UnimplementedSystemViewServer) ReplicationState(context.Context, *Empty) (*ReplicationStateReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReplicationState not implemented")
}
func (UnimplementedSystemViewServer) ResponseWrapData(context.Context, *ResponseWrapDataArgs) (*ResponseWrapDataReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResponseWrapData not implemented")
}
func (UnimplementedSystemViewServer) MlockEnabled(context.Context, *Empty) (*MlockEnabledReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method MlockEnabled not implemented")
}
func (UnimplementedSystemViewServer) LocalMount(context.Context, *Empty) (*LocalMountReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method LocalMount not implemented")
}
func (UnimplementedSystemViewServer) EntityInfo(context.Context, *EntityInfoArgs) (*EntityInfoReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method EntityInfo not implemented")
}
func (UnimplementedSystemViewServer) PluginEnv(context.Context, *Empty) (*PluginEnvReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PluginEnv not implemented")
}
func (UnimplementedSystemViewServer) GroupsForEntity(context.Context, *EntityInfoArgs) (*GroupsForEntityReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GroupsForEntity not implemented")
}
func (UnimplementedSystemViewServer) GeneratePasswordFromPolicy(context.Context, *GeneratePasswordFromPolicyRequest) (*GeneratePasswordFromPolicyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GeneratePasswordFromPolicy not implemented")
}
func (UnimplementedSystemViewServer) mustEmbedUnimplementedSystemViewServer() {}
// UnsafeSystemViewServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SystemViewServer will
// result in compilation errors.
type UnsafeSystemViewServer interface {
mustEmbedUnimplementedSystemViewServer()
}
func RegisterSystemViewServer(s grpc.ServiceRegistrar, srv SystemViewServer) {
s.RegisterService(&SystemView_ServiceDesc, srv)
}
func _SystemView_DefaultLeaseTTL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).DefaultLeaseTTL(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/DefaultLeaseTTL",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).DefaultLeaseTTL(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_MaxLeaseTTL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).MaxLeaseTTL(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/MaxLeaseTTL",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).MaxLeaseTTL(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_Tainted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).Tainted(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/Tainted",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).Tainted(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_CachingDisabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).CachingDisabled(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/CachingDisabled",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).CachingDisabled(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_ReplicationState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).ReplicationState(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/ReplicationState",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).ReplicationState(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_ResponseWrapData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResponseWrapDataArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).ResponseWrapData(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/ResponseWrapData",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).ResponseWrapData(ctx, req.(*ResponseWrapDataArgs))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_MlockEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).MlockEnabled(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/MlockEnabled",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).MlockEnabled(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_LocalMount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).LocalMount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/LocalMount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).LocalMount(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_EntityInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EntityInfoArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).EntityInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/EntityInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).EntityInfo(ctx, req.(*EntityInfoArgs))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_PluginEnv_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).PluginEnv(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/PluginEnv",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).PluginEnv(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_GroupsForEntity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EntityInfoArgs)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).GroupsForEntity(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/GroupsForEntity",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).GroupsForEntity(ctx, req.(*EntityInfoArgs))
}
return interceptor(ctx, in, info, handler)
}
func _SystemView_GeneratePasswordFromPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GeneratePasswordFromPolicyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SystemViewServer).GeneratePasswordFromPolicy(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.SystemView/GeneratePasswordFromPolicy",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SystemViewServer).GeneratePasswordFromPolicy(ctx, req.(*GeneratePasswordFromPolicyRequest))
}
return interceptor(ctx, in, info, handler)
}
// SystemView_ServiceDesc is the grpc.ServiceDesc for SystemView service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SystemView_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.SystemView",
HandlerType: (*SystemViewServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "DefaultLeaseTTL",
Handler: _SystemView_DefaultLeaseTTL_Handler,
},
{
MethodName: "MaxLeaseTTL",
Handler: _SystemView_MaxLeaseTTL_Handler,
},
{
MethodName: "Tainted",
Handler: _SystemView_Tainted_Handler,
},
{
MethodName: "CachingDisabled",
Handler: _SystemView_CachingDisabled_Handler,
},
{
MethodName: "ReplicationState",
Handler: _SystemView_ReplicationState_Handler,
},
{
MethodName: "ResponseWrapData",
Handler: _SystemView_ResponseWrapData_Handler,
},
{
MethodName: "MlockEnabled",
Handler: _SystemView_MlockEnabled_Handler,
},
{
MethodName: "LocalMount",
Handler: _SystemView_LocalMount_Handler,
},
{
MethodName: "EntityInfo",
Handler: _SystemView_EntityInfo_Handler,
},
{
MethodName: "PluginEnv",
Handler: _SystemView_PluginEnv_Handler,
},
{
MethodName: "GroupsForEntity",
Handler: _SystemView_GroupsForEntity_Handler,
},
{
MethodName: "GeneratePasswordFromPolicy",
Handler: _SystemView_GeneratePasswordFromPolicy_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "sdk/plugin/pb/backend.proto",
}