One gRPC service per domain in state.v1 (tasks, executions, accounts, identities, packages, captures, bindings, access, orgs, alerts and so on), each with its own server type in staterpc. RPC and message names and numbers are unchanged.
408 lines
17 KiB
Go
408 lines
17 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc (unknown)
|
|
// source: state/v1/access.proto
|
|
|
|
package statev1
|
|
|
|
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.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
AccessService_GetPrincipal_FullMethodName = "/state.v1.AccessService/GetPrincipal"
|
|
AccessService_ListPolicies_FullMethodName = "/state.v1.AccessService/ListPolicies"
|
|
AccessService_GetPoliciesVersion_FullMethodName = "/state.v1.AccessService/GetPoliciesVersion"
|
|
AccessService_PutPolicy_FullMethodName = "/state.v1.AccessService/PutPolicy"
|
|
AccessService_DeletePolicy_FullMethodName = "/state.v1.AccessService/DeletePolicy"
|
|
AccessService_EnsureShippedOrgPolicies_FullMethodName = "/state.v1.AccessService/EnsureShippedOrgPolicies"
|
|
AccessService_RecordDenial_FullMethodName = "/state.v1.AccessService/RecordDenial"
|
|
AccessService_ListDenials_FullMethodName = "/state.v1.AccessService/ListDenials"
|
|
)
|
|
|
|
// AccessServiceClient is the client API for AccessService 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.
|
|
//
|
|
// The stored policy chain and its denial records
|
|
// (docs/prds/orgs-and-access.md). ListPolicies is the engine's snapshot;
|
|
// the writes are administrative. RecordDenial is the dashboard's and
|
|
// dispatch's write path; ListDenials is the operator surface.
|
|
type AccessServiceClient interface {
|
|
// The principal assembly the Authorizer evaluates: an identity, the org
|
|
// it serves, and its memberships (internal/domain/access).
|
|
GetPrincipal(ctx context.Context, in *GetPrincipalRequest, opts ...grpc.CallOption) (*GetPrincipalResponse, error)
|
|
ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error)
|
|
// GetPoliciesVersion is the instance-wide policy version an authorizer reads
|
|
// before each decision to know whether the chain it holds is current. A
|
|
// caller must read it before ListPolicies, never after.
|
|
GetPoliciesVersion(ctx context.Context, in *GetPoliciesVersionRequest, opts ...grpc.CallOption) (*GetPoliciesVersionResponse, error)
|
|
PutPolicy(ctx context.Context, in *PutPolicyRequest, opts ...grpc.CallOption) (*PutPolicyResponse, error)
|
|
DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*DeletePolicyResponse, error)
|
|
EnsureShippedOrgPolicies(ctx context.Context, in *EnsureShippedOrgPoliciesRequest, opts ...grpc.CallOption) (*EnsureShippedOrgPoliciesResponse, error)
|
|
RecordDenial(ctx context.Context, in *RecordDenialRequest, opts ...grpc.CallOption) (*RecordDenialResponse, error)
|
|
ListDenials(ctx context.Context, in *ListDenialsRequest, opts ...grpc.CallOption) (*ListDenialsResponse, error)
|
|
}
|
|
|
|
type accessServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAccessServiceClient(cc grpc.ClientConnInterface) AccessServiceClient {
|
|
return &accessServiceClient{cc}
|
|
}
|
|
|
|
func (c *accessServiceClient) GetPrincipal(ctx context.Context, in *GetPrincipalRequest, opts ...grpc.CallOption) (*GetPrincipalResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetPrincipalResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_GetPrincipal_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accessServiceClient) ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListPoliciesResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_ListPolicies_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accessServiceClient) GetPoliciesVersion(ctx context.Context, in *GetPoliciesVersionRequest, opts ...grpc.CallOption) (*GetPoliciesVersionResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetPoliciesVersionResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_GetPoliciesVersion_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accessServiceClient) PutPolicy(ctx context.Context, in *PutPolicyRequest, opts ...grpc.CallOption) (*PutPolicyResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(PutPolicyResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_PutPolicy_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accessServiceClient) DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*DeletePolicyResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeletePolicyResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_DeletePolicy_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accessServiceClient) EnsureShippedOrgPolicies(ctx context.Context, in *EnsureShippedOrgPoliciesRequest, opts ...grpc.CallOption) (*EnsureShippedOrgPoliciesResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(EnsureShippedOrgPoliciesResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_EnsureShippedOrgPolicies_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accessServiceClient) RecordDenial(ctx context.Context, in *RecordDenialRequest, opts ...grpc.CallOption) (*RecordDenialResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(RecordDenialResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_RecordDenial_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accessServiceClient) ListDenials(ctx context.Context, in *ListDenialsRequest, opts ...grpc.CallOption) (*ListDenialsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListDenialsResponse)
|
|
err := c.cc.Invoke(ctx, AccessService_ListDenials_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AccessServiceServer is the server API for AccessService service.
|
|
// All implementations must embed UnimplementedAccessServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// The stored policy chain and its denial records
|
|
// (docs/prds/orgs-and-access.md). ListPolicies is the engine's snapshot;
|
|
// the writes are administrative. RecordDenial is the dashboard's and
|
|
// dispatch's write path; ListDenials is the operator surface.
|
|
type AccessServiceServer interface {
|
|
// The principal assembly the Authorizer evaluates: an identity, the org
|
|
// it serves, and its memberships (internal/domain/access).
|
|
GetPrincipal(context.Context, *GetPrincipalRequest) (*GetPrincipalResponse, error)
|
|
ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error)
|
|
// GetPoliciesVersion is the instance-wide policy version an authorizer reads
|
|
// before each decision to know whether the chain it holds is current. A
|
|
// caller must read it before ListPolicies, never after.
|
|
GetPoliciesVersion(context.Context, *GetPoliciesVersionRequest) (*GetPoliciesVersionResponse, error)
|
|
PutPolicy(context.Context, *PutPolicyRequest) (*PutPolicyResponse, error)
|
|
DeletePolicy(context.Context, *DeletePolicyRequest) (*DeletePolicyResponse, error)
|
|
EnsureShippedOrgPolicies(context.Context, *EnsureShippedOrgPoliciesRequest) (*EnsureShippedOrgPoliciesResponse, error)
|
|
RecordDenial(context.Context, *RecordDenialRequest) (*RecordDenialResponse, error)
|
|
ListDenials(context.Context, *ListDenialsRequest) (*ListDenialsResponse, error)
|
|
mustEmbedUnimplementedAccessServiceServer()
|
|
}
|
|
|
|
// UnimplementedAccessServiceServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedAccessServiceServer struct{}
|
|
|
|
func (UnimplementedAccessServiceServer) GetPrincipal(context.Context, *GetPrincipalRequest) (*GetPrincipalResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetPrincipal not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListPolicies not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) GetPoliciesVersion(context.Context, *GetPoliciesVersionRequest) (*GetPoliciesVersionResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetPoliciesVersion not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) PutPolicy(context.Context, *PutPolicyRequest) (*PutPolicyResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method PutPolicy not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) DeletePolicy(context.Context, *DeletePolicyRequest) (*DeletePolicyResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method DeletePolicy not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) EnsureShippedOrgPolicies(context.Context, *EnsureShippedOrgPoliciesRequest) (*EnsureShippedOrgPoliciesResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method EnsureShippedOrgPolicies not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) RecordDenial(context.Context, *RecordDenialRequest) (*RecordDenialResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method RecordDenial not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) ListDenials(context.Context, *ListDenialsRequest) (*ListDenialsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListDenials not implemented")
|
|
}
|
|
func (UnimplementedAccessServiceServer) mustEmbedUnimplementedAccessServiceServer() {}
|
|
func (UnimplementedAccessServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAccessServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AccessServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAccessServiceServer interface {
|
|
mustEmbedUnimplementedAccessServiceServer()
|
|
}
|
|
|
|
func RegisterAccessServiceServer(s grpc.ServiceRegistrar, srv AccessServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedAccessServiceServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&AccessService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AccessService_GetPrincipal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetPrincipalRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).GetPrincipal(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_GetPrincipal_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).GetPrincipal(ctx, req.(*GetPrincipalRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccessService_ListPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListPoliciesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).ListPolicies(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_ListPolicies_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).ListPolicies(ctx, req.(*ListPoliciesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccessService_GetPoliciesVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetPoliciesVersionRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).GetPoliciesVersion(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_GetPoliciesVersion_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).GetPoliciesVersion(ctx, req.(*GetPoliciesVersionRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccessService_PutPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PutPolicyRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).PutPolicy(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_PutPolicy_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).PutPolicy(ctx, req.(*PutPolicyRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccessService_DeletePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeletePolicyRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).DeletePolicy(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_DeletePolicy_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).DeletePolicy(ctx, req.(*DeletePolicyRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccessService_EnsureShippedOrgPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(EnsureShippedOrgPoliciesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).EnsureShippedOrgPolicies(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_EnsureShippedOrgPolicies_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).EnsureShippedOrgPolicies(ctx, req.(*EnsureShippedOrgPoliciesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccessService_RecordDenial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RecordDenialRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).RecordDenial(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_RecordDenial_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).RecordDenial(ctx, req.(*RecordDenialRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AccessService_ListDenials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListDenialsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AccessServiceServer).ListDenials(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AccessService_ListDenials_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AccessServiceServer).ListDenials(ctx, req.(*ListDenialsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// AccessService_ServiceDesc is the grpc.ServiceDesc for AccessService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AccessService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "state.v1.AccessService",
|
|
HandlerType: (*AccessServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetPrincipal",
|
|
Handler: _AccessService_GetPrincipal_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListPolicies",
|
|
Handler: _AccessService_ListPolicies_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetPoliciesVersion",
|
|
Handler: _AccessService_GetPoliciesVersion_Handler,
|
|
},
|
|
{
|
|
MethodName: "PutPolicy",
|
|
Handler: _AccessService_PutPolicy_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeletePolicy",
|
|
Handler: _AccessService_DeletePolicy_Handler,
|
|
},
|
|
{
|
|
MethodName: "EnsureShippedOrgPolicies",
|
|
Handler: _AccessService_EnsureShippedOrgPolicies_Handler,
|
|
},
|
|
{
|
|
MethodName: "RecordDenial",
|
|
Handler: _AccessService_RecordDenial_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListDenials",
|
|
Handler: _AccessService_ListDenials_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "state/v1/access.proto",
|
|
}
|