svcv1

package
v0.35.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Overview

Package svcv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	CerbosService_CheckResourceSet_FullMethodName   = "/cerbos.svc.v1.CerbosService/CheckResourceSet"
	CerbosService_CheckResourceBatch_FullMethodName = "/cerbos.svc.v1.CerbosService/CheckResourceBatch"
	CerbosService_CheckResources_FullMethodName     = "/cerbos.svc.v1.CerbosService/CheckResources"
	CerbosService_ServerInfo_FullMethodName         = "/cerbos.svc.v1.CerbosService/ServerInfo"
	CerbosService_PlanResources_FullMethodName      = "/cerbos.svc.v1.CerbosService/PlanResources"
)
View Source
const (
	CerbosAdminService_AddOrUpdatePolicy_FullMethodName   = "/cerbos.svc.v1.CerbosAdminService/AddOrUpdatePolicy"
	CerbosAdminService_InspectPolicies_FullMethodName     = "/cerbos.svc.v1.CerbosAdminService/InspectPolicies"
	CerbosAdminService_ListPolicies_FullMethodName        = "/cerbos.svc.v1.CerbosAdminService/ListPolicies"
	CerbosAdminService_GetPolicy_FullMethodName           = "/cerbos.svc.v1.CerbosAdminService/GetPolicy"
	CerbosAdminService_DisablePolicy_FullMethodName       = "/cerbos.svc.v1.CerbosAdminService/DisablePolicy"
	CerbosAdminService_EnablePolicy_FullMethodName        = "/cerbos.svc.v1.CerbosAdminService/EnablePolicy"
	CerbosAdminService_ListAuditLogEntries_FullMethodName = "/cerbos.svc.v1.CerbosAdminService/ListAuditLogEntries"
	CerbosAdminService_AddOrUpdateSchema_FullMethodName   = "/cerbos.svc.v1.CerbosAdminService/AddOrUpdateSchema"
	CerbosAdminService_ListSchemas_FullMethodName         = "/cerbos.svc.v1.CerbosAdminService/ListSchemas"
	CerbosAdminService_GetSchema_FullMethodName           = "/cerbos.svc.v1.CerbosAdminService/GetSchema"
	CerbosAdminService_DeleteSchema_FullMethodName        = "/cerbos.svc.v1.CerbosAdminService/DeleteSchema"
	CerbosAdminService_ReloadStore_FullMethodName         = "/cerbos.svc.v1.CerbosAdminService/ReloadStore"
)
View Source
const (
	CerbosPlaygroundService_PlaygroundValidate_FullMethodName = "/cerbos.svc.v1.CerbosPlaygroundService/PlaygroundValidate"
	CerbosPlaygroundService_PlaygroundTest_FullMethodName     = "/cerbos.svc.v1.CerbosPlaygroundService/PlaygroundTest"
	CerbosPlaygroundService_PlaygroundEvaluate_FullMethodName = "/cerbos.svc.v1.CerbosPlaygroundService/PlaygroundEvaluate"
	CerbosPlaygroundService_PlaygroundProxy_FullMethodName    = "/cerbos.svc.v1.CerbosPlaygroundService/PlaygroundProxy"
)

Variables

View Source
var CerbosAdminService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cerbos.svc.v1.CerbosAdminService",
	HandlerType: (*CerbosAdminServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddOrUpdatePolicy",
			Handler:    _CerbosAdminService_AddOrUpdatePolicy_Handler,
		},
		{
			MethodName: "InspectPolicies",
			Handler:    _CerbosAdminService_InspectPolicies_Handler,
		},
		{
			MethodName: "ListPolicies",
			Handler:    _CerbosAdminService_ListPolicies_Handler,
		},
		{
			MethodName: "GetPolicy",
			Handler:    _CerbosAdminService_GetPolicy_Handler,
		},
		{
			MethodName: "DisablePolicy",
			Handler:    _CerbosAdminService_DisablePolicy_Handler,
		},
		{
			MethodName: "EnablePolicy",
			Handler:    _CerbosAdminService_EnablePolicy_Handler,
		},
		{
			MethodName: "AddOrUpdateSchema",
			Handler:    _CerbosAdminService_AddOrUpdateSchema_Handler,
		},
		{
			MethodName: "ListSchemas",
			Handler:    _CerbosAdminService_ListSchemas_Handler,
		},
		{
			MethodName: "GetSchema",
			Handler:    _CerbosAdminService_GetSchema_Handler,
		},
		{
			MethodName: "DeleteSchema",
			Handler:    _CerbosAdminService_DeleteSchema_Handler,
		},
		{
			MethodName: "ReloadStore",
			Handler:    _CerbosAdminService_ReloadStore_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListAuditLogEntries",
			Handler:       _CerbosAdminService_ListAuditLogEntries_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "cerbos/svc/v1/svc.proto",
}

CerbosAdminService_ServiceDesc is the grpc.ServiceDesc for CerbosAdminService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var CerbosPlaygroundService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cerbos.svc.v1.CerbosPlaygroundService",
	HandlerType: (*CerbosPlaygroundServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PlaygroundValidate",
			Handler:    _CerbosPlaygroundService_PlaygroundValidate_Handler,
		},
		{
			MethodName: "PlaygroundTest",
			Handler:    _CerbosPlaygroundService_PlaygroundTest_Handler,
		},
		{
			MethodName: "PlaygroundEvaluate",
			Handler:    _CerbosPlaygroundService_PlaygroundEvaluate_Handler,
		},
		{
			MethodName: "PlaygroundProxy",
			Handler:    _CerbosPlaygroundService_PlaygroundProxy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cerbos/svc/v1/svc.proto",
}

CerbosPlaygroundService_ServiceDesc is the grpc.ServiceDesc for CerbosPlaygroundService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var CerbosService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cerbos.svc.v1.CerbosService",
	HandlerType: (*CerbosServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CheckResourceSet",
			Handler:    _CerbosService_CheckResourceSet_Handler,
		},
		{
			MethodName: "CheckResourceBatch",
			Handler:    _CerbosService_CheckResourceBatch_Handler,
		},
		{
			MethodName: "CheckResources",
			Handler:    _CerbosService_CheckResources_Handler,
		},
		{
			MethodName: "ServerInfo",
			Handler:    _CerbosService_ServerInfo_Handler,
		},
		{
			MethodName: "PlanResources",
			Handler:    _CerbosService_PlanResources_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cerbos/svc/v1/svc.proto",
}

CerbosService_ServiceDesc is the grpc.ServiceDesc for CerbosService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_cerbos_svc_v1_svc_proto protoreflect.FileDescriptor

Functions

func RegisterCerbosAdminServiceHandler

func RegisterCerbosAdminServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCerbosAdminServiceHandler registers the http handlers for service CerbosAdminService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCerbosAdminServiceHandlerClient

func RegisterCerbosAdminServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CerbosAdminServiceClient) error

RegisterCerbosAdminServiceHandlerClient registers the http handlers for service CerbosAdminService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CerbosAdminServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CerbosAdminServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CerbosAdminServiceClient" to call the correct interceptors.

func RegisterCerbosAdminServiceHandlerFromEndpoint

func RegisterCerbosAdminServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCerbosAdminServiceHandlerFromEndpoint is same as RegisterCerbosAdminServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCerbosAdminServiceHandlerServer

func RegisterCerbosAdminServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CerbosAdminServiceServer) error

RegisterCerbosAdminServiceHandlerServer registers the http handlers for service CerbosAdminService to "mux". UnaryRPC :call CerbosAdminServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCerbosAdminServiceHandlerFromEndpoint instead.

func RegisterCerbosAdminServiceServer

func RegisterCerbosAdminServiceServer(s grpc.ServiceRegistrar, srv CerbosAdminServiceServer)

func RegisterCerbosPlaygroundServiceHandler

func RegisterCerbosPlaygroundServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCerbosPlaygroundServiceHandler registers the http handlers for service CerbosPlaygroundService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCerbosPlaygroundServiceHandlerClient

func RegisterCerbosPlaygroundServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CerbosPlaygroundServiceClient) error

RegisterCerbosPlaygroundServiceHandlerClient registers the http handlers for service CerbosPlaygroundService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CerbosPlaygroundServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CerbosPlaygroundServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CerbosPlaygroundServiceClient" to call the correct interceptors.

func RegisterCerbosPlaygroundServiceHandlerFromEndpoint

func RegisterCerbosPlaygroundServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCerbosPlaygroundServiceHandlerFromEndpoint is same as RegisterCerbosPlaygroundServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCerbosPlaygroundServiceHandlerServer

func RegisterCerbosPlaygroundServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CerbosPlaygroundServiceServer) error

RegisterCerbosPlaygroundServiceHandlerServer registers the http handlers for service CerbosPlaygroundService to "mux". UnaryRPC :call CerbosPlaygroundServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCerbosPlaygroundServiceHandlerFromEndpoint instead.

func RegisterCerbosPlaygroundServiceServer

func RegisterCerbosPlaygroundServiceServer(s grpc.ServiceRegistrar, srv CerbosPlaygroundServiceServer)

func RegisterCerbosServiceHandler

func RegisterCerbosServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCerbosServiceHandler registers the http handlers for service CerbosService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCerbosServiceHandlerClient

func RegisterCerbosServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CerbosServiceClient) error

RegisterCerbosServiceHandlerClient registers the http handlers for service CerbosService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CerbosServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CerbosServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CerbosServiceClient" to call the correct interceptors.

func RegisterCerbosServiceHandlerFromEndpoint

func RegisterCerbosServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCerbosServiceHandlerFromEndpoint is same as RegisterCerbosServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCerbosServiceHandlerServer

func RegisterCerbosServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CerbosServiceServer) error

RegisterCerbosServiceHandlerServer registers the http handlers for service CerbosService to "mux". UnaryRPC :call CerbosServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCerbosServiceHandlerFromEndpoint instead.

func RegisterCerbosServiceServer

func RegisterCerbosServiceServer(s grpc.ServiceRegistrar, srv CerbosServiceServer)

Types

type CerbosAdminServiceClient

type CerbosAdminServiceClient interface {
	AddOrUpdatePolicy(ctx context.Context, in *v1.AddOrUpdatePolicyRequest, opts ...grpc.CallOption) (*v11.AddOrUpdatePolicyResponse, error)
	InspectPolicies(ctx context.Context, in *v1.InspectPoliciesRequest, opts ...grpc.CallOption) (*v11.InspectPoliciesResponse, error)
	ListPolicies(ctx context.Context, in *v1.ListPoliciesRequest, opts ...grpc.CallOption) (*v11.ListPoliciesResponse, error)
	GetPolicy(ctx context.Context, in *v1.GetPolicyRequest, opts ...grpc.CallOption) (*v11.GetPolicyResponse, error)
	DisablePolicy(ctx context.Context, in *v1.DisablePolicyRequest, opts ...grpc.CallOption) (*v11.DisablePolicyResponse, error)
	EnablePolicy(ctx context.Context, in *v1.EnablePolicyRequest, opts ...grpc.CallOption) (*v11.EnablePolicyResponse, error)
	ListAuditLogEntries(ctx context.Context, in *v1.ListAuditLogEntriesRequest, opts ...grpc.CallOption) (CerbosAdminService_ListAuditLogEntriesClient, error)
	AddOrUpdateSchema(ctx context.Context, in *v1.AddOrUpdateSchemaRequest, opts ...grpc.CallOption) (*v11.AddOrUpdateSchemaResponse, error)
	ListSchemas(ctx context.Context, in *v1.ListSchemasRequest, opts ...grpc.CallOption) (*v11.ListSchemasResponse, error)
	GetSchema(ctx context.Context, in *v1.GetSchemaRequest, opts ...grpc.CallOption) (*v11.GetSchemaResponse, error)
	DeleteSchema(ctx context.Context, in *v1.DeleteSchemaRequest, opts ...grpc.CallOption) (*v11.DeleteSchemaResponse, error)
	ReloadStore(ctx context.Context, in *v1.ReloadStoreRequest, opts ...grpc.CallOption) (*v11.ReloadStoreResponse, error)
}

CerbosAdminServiceClient is the client API for CerbosAdminService 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 CerbosAdminServiceServer

CerbosAdminServiceServer is the server API for CerbosAdminService service. All implementations must embed UnimplementedCerbosAdminServiceServer for forward compatibility

type CerbosAdminService_ListAuditLogEntriesClient

type CerbosAdminService_ListAuditLogEntriesClient interface {
	Recv() (*v11.ListAuditLogEntriesResponse, error)
	grpc.ClientStream
}

type CerbosAdminService_ListAuditLogEntriesServer

type CerbosAdminService_ListAuditLogEntriesServer interface {
	Send(*v11.ListAuditLogEntriesResponse) error
	grpc.ServerStream
}

type CerbosPlaygroundServiceClient

type CerbosPlaygroundServiceClient interface {
	PlaygroundValidate(ctx context.Context, in *v1.PlaygroundValidateRequest, opts ...grpc.CallOption) (*v11.PlaygroundValidateResponse, error)
	PlaygroundTest(ctx context.Context, in *v1.PlaygroundTestRequest, opts ...grpc.CallOption) (*v11.PlaygroundTestResponse, error)
	PlaygroundEvaluate(ctx context.Context, in *v1.PlaygroundEvaluateRequest, opts ...grpc.CallOption) (*v11.PlaygroundEvaluateResponse, error)
	PlaygroundProxy(ctx context.Context, in *v1.PlaygroundProxyRequest, opts ...grpc.CallOption) (*v11.PlaygroundProxyResponse, error)
}

CerbosPlaygroundServiceClient is the client API for CerbosPlaygroundService 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 CerbosPlaygroundServiceServer

type CerbosPlaygroundServiceServer interface {
	PlaygroundValidate(context.Context, *v1.PlaygroundValidateRequest) (*v11.PlaygroundValidateResponse, error)
	PlaygroundTest(context.Context, *v1.PlaygroundTestRequest) (*v11.PlaygroundTestResponse, error)
	PlaygroundEvaluate(context.Context, *v1.PlaygroundEvaluateRequest) (*v11.PlaygroundEvaluateResponse, error)
	PlaygroundProxy(context.Context, *v1.PlaygroundProxyRequest) (*v11.PlaygroundProxyResponse, error)
	// contains filtered or unexported methods
}

CerbosPlaygroundServiceServer is the server API for CerbosPlaygroundService service. All implementations must embed UnimplementedCerbosPlaygroundServiceServer for forward compatibility

type CerbosServiceClient

type CerbosServiceClient interface {
	CheckResourceSet(ctx context.Context, in *v1.CheckResourceSetRequest, opts ...grpc.CallOption) (*v11.CheckResourceSetResponse, error)
	CheckResourceBatch(ctx context.Context, in *v1.CheckResourceBatchRequest, opts ...grpc.CallOption) (*v11.CheckResourceBatchResponse, error)
	CheckResources(ctx context.Context, in *v1.CheckResourcesRequest, opts ...grpc.CallOption) (*v11.CheckResourcesResponse, error)
	ServerInfo(ctx context.Context, in *v1.ServerInfoRequest, opts ...grpc.CallOption) (*v11.ServerInfoResponse, error)
	PlanResources(ctx context.Context, in *v1.PlanResourcesRequest, opts ...grpc.CallOption) (*v11.PlanResourcesResponse, error)
}

CerbosServiceClient is the client API for CerbosService 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 CerbosServiceServer

type CerbosServiceServer interface {
	CheckResourceSet(context.Context, *v1.CheckResourceSetRequest) (*v11.CheckResourceSetResponse, error)
	CheckResourceBatch(context.Context, *v1.CheckResourceBatchRequest) (*v11.CheckResourceBatchResponse, error)
	CheckResources(context.Context, *v1.CheckResourcesRequest) (*v11.CheckResourcesResponse, error)
	ServerInfo(context.Context, *v1.ServerInfoRequest) (*v11.ServerInfoResponse, error)
	PlanResources(context.Context, *v1.PlanResourcesRequest) (*v11.PlanResourcesResponse, error)
	// contains filtered or unexported methods
}

CerbosServiceServer is the server API for CerbosService service. All implementations must embed UnimplementedCerbosServiceServer for forward compatibility

type UnimplementedCerbosAdminServiceServer

type UnimplementedCerbosAdminServiceServer struct {
}

UnimplementedCerbosAdminServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCerbosAdminServiceServer) AddOrUpdatePolicy

func (UnimplementedCerbosAdminServiceServer) AddOrUpdateSchema

func (UnimplementedCerbosAdminServiceServer) DeleteSchema

func (UnimplementedCerbosAdminServiceServer) DisablePolicy

func (UnimplementedCerbosAdminServiceServer) EnablePolicy

func (UnimplementedCerbosAdminServiceServer) GetPolicy

func (UnimplementedCerbosAdminServiceServer) GetSchema

func (UnimplementedCerbosAdminServiceServer) InspectPolicies added in v0.35.0

func (UnimplementedCerbosAdminServiceServer) ListPolicies

func (UnimplementedCerbosAdminServiceServer) ListSchemas

func (UnimplementedCerbosAdminServiceServer) ReloadStore

type UnimplementedCerbosPlaygroundServiceServer

type UnimplementedCerbosPlaygroundServiceServer struct {
}

UnimplementedCerbosPlaygroundServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCerbosPlaygroundServiceServer) PlaygroundEvaluate

func (UnimplementedCerbosPlaygroundServiceServer) PlaygroundProxy

func (UnimplementedCerbosPlaygroundServiceServer) PlaygroundTest

func (UnimplementedCerbosPlaygroundServiceServer) PlaygroundValidate

type UnimplementedCerbosServiceServer

type UnimplementedCerbosServiceServer struct {
}

UnimplementedCerbosServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCerbosServiceServer) CheckResourceSet

func (UnimplementedCerbosServiceServer) CheckResources

func (UnimplementedCerbosServiceServer) PlanResources

func (UnimplementedCerbosServiceServer) ServerInfo

type UnsafeCerbosAdminServiceServer

type UnsafeCerbosAdminServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCerbosAdminServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CerbosAdminServiceServer will result in compilation errors.

type UnsafeCerbosPlaygroundServiceServer

type UnsafeCerbosPlaygroundServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCerbosPlaygroundServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CerbosPlaygroundServiceServer will result in compilation errors.

type UnsafeCerbosServiceServer

type UnsafeCerbosServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCerbosServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CerbosServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL