refactor(state)!: split StateStoreService into per-domain services
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.
This commit is contained in:
1 parent
59e3de62db
commit
0dae907dad
99 files changed
+34114
-30598
No files matched your search
@@ -15,11 +15,10 @@ func builtinDefinitions(steps workflow.StepRegistry, settings map[string]any) []
|
||||
}
|
||||
|
||||
func domainManagedDescriptors() []*pb.ResourceDescriptor {
|
||||
const stateService = "state.v1.StateStoreService"
|
||||
return []*pb.ResourceDescriptor{
|
||||
{Kind: "identities", Title: "Identities", ApplyMode: "domain-managed", QueryService: stateService + "/ListIdentities,GetIdentity", CommandService: stateService + "/CreateIdentity,RenameIdentity,SuspendIdentity,ReactivateIdentity,RetireIdentity"},
|
||||
{Kind: "capture-events", Title: "Captured events", ApplyMode: "domain-managed", QueryService: stateService + "/StreamCaptures", CommandService: stateService + "/InsertCapture"},
|
||||
{Kind: "capture-mappings", Title: "Capture mappings", ApplyMode: "domain-managed", QueryService: stateService + "/ListMappings", CommandService: stateService + "/InsertMapping,UpdateMapping,DeleteMapping"},
|
||||
{Kind: "capture-bindings", Title: "Capture bindings", ApplyMode: "domain-managed", QueryService: stateService + "/ListBindings", CommandService: stateService + "/InsertBinding,UpdateBinding,DeleteBinding"},
|
||||
{Kind: "identities", Title: "Identities", ApplyMode: "domain-managed", QueryService: "state.v1.IdentityService/ListIdentities,GetIdentity", CommandService: "state.v1.IdentityService/CreateIdentity,RenameIdentity,SuspendIdentity,ReactivateIdentity,RetireIdentity"},
|
||||
{Kind: "capture-events", Title: "Captured events", ApplyMode: "domain-managed", QueryService: "state.v1.CaptureService/StreamCaptures", CommandService: "state.v1.CaptureService/InsertCapture"},
|
||||
{Kind: "capture-mappings", Title: "Capture mappings", ApplyMode: "domain-managed", QueryService: "state.v1.MappingService/ListMappings", CommandService: "state.v1.MappingService/InsertMapping,UpdateMapping,DeleteMapping"},
|
||||
{Kind: "capture-bindings", Title: "Capture bindings", ApplyMode: "domain-managed", QueryService: "state.v1.BindingService/ListBindings", CommandService: "state.v1.BindingService/InsertBinding,UpdateBinding,DeleteBinding"},
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,407 @@
|
||||
// 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",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,809 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/account.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 (
|
||||
AccountService_GetAuthenticationSettings_FullMethodName = "/state.v1.AccountService/GetAuthenticationSettings"
|
||||
AccountService_SaveAuthenticationSettings_FullMethodName = "/state.v1.AccountService/SaveAuthenticationSettings"
|
||||
AccountService_BeginPasskey_FullMethodName = "/state.v1.AccountService/BeginPasskey"
|
||||
AccountService_FinishPasskey_FullMethodName = "/state.v1.AccountService/FinishPasskey"
|
||||
AccountService_ListPasskeys_FullMethodName = "/state.v1.AccountService/ListPasskeys"
|
||||
AccountService_DeletePasskey_FullMethodName = "/state.v1.AccountService/DeletePasskey"
|
||||
AccountService_OpenAccountSession_FullMethodName = "/state.v1.AccountService/OpenAccountSession"
|
||||
AccountService_RequireFreshAccountSession_FullMethodName = "/state.v1.AccountService/RequireFreshAccountSession"
|
||||
AccountService_CreateAccountRecovery_FullMethodName = "/state.v1.AccountService/CreateAccountRecovery"
|
||||
AccountService_RecoverAccount_FullMethodName = "/state.v1.AccountService/RecoverAccount"
|
||||
AccountService_AccountSetup_FullMethodName = "/state.v1.AccountService/AccountSetup"
|
||||
AccountService_RegisterAccount_FullMethodName = "/state.v1.AccountService/RegisterAccount"
|
||||
AccountService_SignInAccount_FullMethodName = "/state.v1.AccountService/SignInAccount"
|
||||
AccountService_ResolveAccountSession_FullMethodName = "/state.v1.AccountService/ResolveAccountSession"
|
||||
AccountService_SignOutAccount_FullMethodName = "/state.v1.AccountService/SignOutAccount"
|
||||
AccountService_ChangeAccountPassword_FullMethodName = "/state.v1.AccountService/ChangeAccountPassword"
|
||||
AccountService_AddPersonalToken_FullMethodName = "/state.v1.AccountService/AddPersonalToken"
|
||||
AccountService_ListPersonalTokens_FullMethodName = "/state.v1.AccountService/ListPersonalTokens"
|
||||
AccountService_RevokePersonalToken_FullMethodName = "/state.v1.AccountService/RevokePersonalToken"
|
||||
)
|
||||
|
||||
// AccountServiceClient is the client API for AccountService 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 AccountServiceClient interface {
|
||||
GetAuthenticationSettings(ctx context.Context, in *GetAuthenticationSettingsRequest, opts ...grpc.CallOption) (*GetAuthenticationSettingsResponse, error)
|
||||
SaveAuthenticationSettings(ctx context.Context, in *SaveAuthenticationSettingsRequest, opts ...grpc.CallOption) (*SaveAuthenticationSettingsResponse, error)
|
||||
BeginPasskey(ctx context.Context, in *BeginPasskeyRequest, opts ...grpc.CallOption) (*BeginPasskeyResponse, error)
|
||||
FinishPasskey(ctx context.Context, in *FinishPasskeyRequest, opts ...grpc.CallOption) (*FinishPasskeyResponse, error)
|
||||
ListPasskeys(ctx context.Context, in *ListPasskeysRequest, opts ...grpc.CallOption) (*ListPasskeysResponse, error)
|
||||
DeletePasskey(ctx context.Context, in *DeletePasskeyRequest, opts ...grpc.CallOption) (*DeletePasskeyResponse, error)
|
||||
OpenAccountSession(ctx context.Context, in *OpenAccountSessionRequest, opts ...grpc.CallOption) (*OpenAccountSessionResponse, error)
|
||||
RequireFreshAccountSession(ctx context.Context, in *RequireFreshAccountSessionRequest, opts ...grpc.CallOption) (*RequireFreshAccountSessionResponse, error)
|
||||
CreateAccountRecovery(ctx context.Context, in *CreateAccountRecoveryRequest, opts ...grpc.CallOption) (*CreateAccountRecoveryResponse, error)
|
||||
RecoverAccount(ctx context.Context, in *RecoverAccountRequest, opts ...grpc.CallOption) (*RecoverAccountResponse, error)
|
||||
AccountSetup(ctx context.Context, in *AccountSetupRequest, opts ...grpc.CallOption) (*AccountSetupResponse, error)
|
||||
RegisterAccount(ctx context.Context, in *RegisterAccountRequest, opts ...grpc.CallOption) (*RegisterAccountResponse, error)
|
||||
SignInAccount(ctx context.Context, in *SignInAccountRequest, opts ...grpc.CallOption) (*SignInAccountResponse, error)
|
||||
ResolveAccountSession(ctx context.Context, in *ResolveAccountSessionRequest, opts ...grpc.CallOption) (*ResolveAccountSessionResponse, error)
|
||||
SignOutAccount(ctx context.Context, in *SignOutAccountRequest, opts ...grpc.CallOption) (*SignOutAccountResponse, error)
|
||||
ChangeAccountPassword(ctx context.Context, in *ChangeAccountPasswordRequest, opts ...grpc.CallOption) (*ChangeAccountPasswordResponse, error)
|
||||
// Personal API tokens act on the caller's own principal: the State Store
|
||||
// refuses a call that carries none.
|
||||
AddPersonalToken(ctx context.Context, in *AddPersonalTokenRequest, opts ...grpc.CallOption) (*AddPersonalTokenResponse, error)
|
||||
ListPersonalTokens(ctx context.Context, in *ListPersonalTokensRequest, opts ...grpc.CallOption) (*ListPersonalTokensResponse, error)
|
||||
RevokePersonalToken(ctx context.Context, in *RevokePersonalTokenRequest, opts ...grpc.CallOption) (*RevokePersonalTokenResponse, error)
|
||||
}
|
||||
|
||||
type accountServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient {
|
||||
return &accountServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) GetAuthenticationSettings(ctx context.Context, in *GetAuthenticationSettingsRequest, opts ...grpc.CallOption) (*GetAuthenticationSettingsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAuthenticationSettingsResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_GetAuthenticationSettings_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) SaveAuthenticationSettings(ctx context.Context, in *SaveAuthenticationSettingsRequest, opts ...grpc.CallOption) (*SaveAuthenticationSettingsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SaveAuthenticationSettingsResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_SaveAuthenticationSettings_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) BeginPasskey(ctx context.Context, in *BeginPasskeyRequest, opts ...grpc.CallOption) (*BeginPasskeyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BeginPasskeyResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_BeginPasskey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) FinishPasskey(ctx context.Context, in *FinishPasskeyRequest, opts ...grpc.CallOption) (*FinishPasskeyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(FinishPasskeyResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_FinishPasskey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListPasskeys(ctx context.Context, in *ListPasskeysRequest, opts ...grpc.CallOption) (*ListPasskeysResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPasskeysResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListPasskeys_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) DeletePasskey(ctx context.Context, in *DeletePasskeyRequest, opts ...grpc.CallOption) (*DeletePasskeyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeletePasskeyResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_DeletePasskey_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) OpenAccountSession(ctx context.Context, in *OpenAccountSessionRequest, opts ...grpc.CallOption) (*OpenAccountSessionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(OpenAccountSessionResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_OpenAccountSession_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) RequireFreshAccountSession(ctx context.Context, in *RequireFreshAccountSessionRequest, opts ...grpc.CallOption) (*RequireFreshAccountSessionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RequireFreshAccountSessionResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_RequireFreshAccountSession_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) CreateAccountRecovery(ctx context.Context, in *CreateAccountRecoveryRequest, opts ...grpc.CallOption) (*CreateAccountRecoveryResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateAccountRecoveryResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_CreateAccountRecovery_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) RecoverAccount(ctx context.Context, in *RecoverAccountRequest, opts ...grpc.CallOption) (*RecoverAccountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecoverAccountResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_RecoverAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) AccountSetup(ctx context.Context, in *AccountSetupRequest, opts ...grpc.CallOption) (*AccountSetupResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AccountSetupResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_AccountSetup_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) RegisterAccount(ctx context.Context, in *RegisterAccountRequest, opts ...grpc.CallOption) (*RegisterAccountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RegisterAccountResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_RegisterAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) SignInAccount(ctx context.Context, in *SignInAccountRequest, opts ...grpc.CallOption) (*SignInAccountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SignInAccountResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_SignInAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ResolveAccountSession(ctx context.Context, in *ResolveAccountSessionRequest, opts ...grpc.CallOption) (*ResolveAccountSessionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ResolveAccountSessionResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ResolveAccountSession_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) SignOutAccount(ctx context.Context, in *SignOutAccountRequest, opts ...grpc.CallOption) (*SignOutAccountResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SignOutAccountResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_SignOutAccount_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ChangeAccountPassword(ctx context.Context, in *ChangeAccountPasswordRequest, opts ...grpc.CallOption) (*ChangeAccountPasswordResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ChangeAccountPasswordResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ChangeAccountPassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) AddPersonalToken(ctx context.Context, in *AddPersonalTokenRequest, opts ...grpc.CallOption) (*AddPersonalTokenResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddPersonalTokenResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_AddPersonalToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ListPersonalTokens(ctx context.Context, in *ListPersonalTokensRequest, opts ...grpc.CallOption) (*ListPersonalTokensResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPersonalTokensResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ListPersonalTokens_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) RevokePersonalToken(ctx context.Context, in *RevokePersonalTokenRequest, opts ...grpc.CallOption) (*RevokePersonalTokenResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RevokePersonalTokenResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_RevokePersonalToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AccountServiceServer is the server API for AccountService service.
|
||||
// All implementations must embed UnimplementedAccountServiceServer
|
||||
// for forward compatibility.
|
||||
type AccountServiceServer interface {
|
||||
GetAuthenticationSettings(context.Context, *GetAuthenticationSettingsRequest) (*GetAuthenticationSettingsResponse, error)
|
||||
SaveAuthenticationSettings(context.Context, *SaveAuthenticationSettingsRequest) (*SaveAuthenticationSettingsResponse, error)
|
||||
BeginPasskey(context.Context, *BeginPasskeyRequest) (*BeginPasskeyResponse, error)
|
||||
FinishPasskey(context.Context, *FinishPasskeyRequest) (*FinishPasskeyResponse, error)
|
||||
ListPasskeys(context.Context, *ListPasskeysRequest) (*ListPasskeysResponse, error)
|
||||
DeletePasskey(context.Context, *DeletePasskeyRequest) (*DeletePasskeyResponse, error)
|
||||
OpenAccountSession(context.Context, *OpenAccountSessionRequest) (*OpenAccountSessionResponse, error)
|
||||
RequireFreshAccountSession(context.Context, *RequireFreshAccountSessionRequest) (*RequireFreshAccountSessionResponse, error)
|
||||
CreateAccountRecovery(context.Context, *CreateAccountRecoveryRequest) (*CreateAccountRecoveryResponse, error)
|
||||
RecoverAccount(context.Context, *RecoverAccountRequest) (*RecoverAccountResponse, error)
|
||||
AccountSetup(context.Context, *AccountSetupRequest) (*AccountSetupResponse, error)
|
||||
RegisterAccount(context.Context, *RegisterAccountRequest) (*RegisterAccountResponse, error)
|
||||
SignInAccount(context.Context, *SignInAccountRequest) (*SignInAccountResponse, error)
|
||||
ResolveAccountSession(context.Context, *ResolveAccountSessionRequest) (*ResolveAccountSessionResponse, error)
|
||||
SignOutAccount(context.Context, *SignOutAccountRequest) (*SignOutAccountResponse, error)
|
||||
ChangeAccountPassword(context.Context, *ChangeAccountPasswordRequest) (*ChangeAccountPasswordResponse, error)
|
||||
// Personal API tokens act on the caller's own principal: the State Store
|
||||
// refuses a call that carries none.
|
||||
AddPersonalToken(context.Context, *AddPersonalTokenRequest) (*AddPersonalTokenResponse, error)
|
||||
ListPersonalTokens(context.Context, *ListPersonalTokensRequest) (*ListPersonalTokensResponse, error)
|
||||
RevokePersonalToken(context.Context, *RevokePersonalTokenRequest) (*RevokePersonalTokenResponse, error)
|
||||
mustEmbedUnimplementedAccountServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAccountServiceServer 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 UnimplementedAccountServiceServer struct{}
|
||||
|
||||
func (UnimplementedAccountServiceServer) GetAuthenticationSettings(context.Context, *GetAuthenticationSettingsRequest) (*GetAuthenticationSettingsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAuthenticationSettings not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) SaveAuthenticationSettings(context.Context, *SaveAuthenticationSettingsRequest) (*SaveAuthenticationSettingsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SaveAuthenticationSettings not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) BeginPasskey(context.Context, *BeginPasskeyRequest) (*BeginPasskeyResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method BeginPasskey not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) FinishPasskey(context.Context, *FinishPasskeyRequest) (*FinishPasskeyResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method FinishPasskey not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListPasskeys(context.Context, *ListPasskeysRequest) (*ListPasskeysResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPasskeys not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) DeletePasskey(context.Context, *DeletePasskeyRequest) (*DeletePasskeyResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeletePasskey not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) OpenAccountSession(context.Context, *OpenAccountSessionRequest) (*OpenAccountSessionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method OpenAccountSession not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) RequireFreshAccountSession(context.Context, *RequireFreshAccountSessionRequest) (*RequireFreshAccountSessionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RequireFreshAccountSession not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) CreateAccountRecovery(context.Context, *CreateAccountRecoveryRequest) (*CreateAccountRecoveryResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateAccountRecovery not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) RecoverAccount(context.Context, *RecoverAccountRequest) (*RecoverAccountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecoverAccount not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) AccountSetup(context.Context, *AccountSetupRequest) (*AccountSetupResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AccountSetup not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) RegisterAccount(context.Context, *RegisterAccountRequest) (*RegisterAccountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RegisterAccount not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) SignInAccount(context.Context, *SignInAccountRequest) (*SignInAccountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SignInAccount not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ResolveAccountSession(context.Context, *ResolveAccountSessionRequest) (*ResolveAccountSessionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ResolveAccountSession not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) SignOutAccount(context.Context, *SignOutAccountRequest) (*SignOutAccountResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SignOutAccount not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ChangeAccountPassword(context.Context, *ChangeAccountPasswordRequest) (*ChangeAccountPasswordResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangeAccountPassword not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) AddPersonalToken(context.Context, *AddPersonalTokenRequest) (*AddPersonalTokenResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AddPersonalToken not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ListPersonalTokens(context.Context, *ListPersonalTokensRequest) (*ListPersonalTokensResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPersonalTokens not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) RevokePersonalToken(context.Context, *RevokePersonalTokenRequest) (*RevokePersonalTokenResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RevokePersonalToken not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) mustEmbedUnimplementedAccountServiceServer() {}
|
||||
func (UnimplementedAccountServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AccountServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAccountServiceServer interface {
|
||||
mustEmbedUnimplementedAccountServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedAccountServiceServer 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(&AccountService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AccountService_GetAuthenticationSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAuthenticationSettingsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).GetAuthenticationSettings(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_GetAuthenticationSettings_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).GetAuthenticationSettings(ctx, req.(*GetAuthenticationSettingsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_SaveAuthenticationSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SaveAuthenticationSettingsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).SaveAuthenticationSettings(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_SaveAuthenticationSettings_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).SaveAuthenticationSettings(ctx, req.(*SaveAuthenticationSettingsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_BeginPasskey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BeginPasskeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).BeginPasskey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_BeginPasskey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).BeginPasskey(ctx, req.(*BeginPasskeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_FinishPasskey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FinishPasskeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).FinishPasskey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_FinishPasskey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).FinishPasskey(ctx, req.(*FinishPasskeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListPasskeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPasskeysRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListPasskeys(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListPasskeys_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListPasskeys(ctx, req.(*ListPasskeysRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_DeletePasskey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeletePasskeyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).DeletePasskey(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_DeletePasskey_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).DeletePasskey(ctx, req.(*DeletePasskeyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_OpenAccountSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(OpenAccountSessionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).OpenAccountSession(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_OpenAccountSession_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).OpenAccountSession(ctx, req.(*OpenAccountSessionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_RequireFreshAccountSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RequireFreshAccountSessionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).RequireFreshAccountSession(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_RequireFreshAccountSession_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).RequireFreshAccountSession(ctx, req.(*RequireFreshAccountSessionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_CreateAccountRecovery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateAccountRecoveryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).CreateAccountRecovery(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_CreateAccountRecovery_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).CreateAccountRecovery(ctx, req.(*CreateAccountRecoveryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_RecoverAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecoverAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).RecoverAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_RecoverAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).RecoverAccount(ctx, req.(*RecoverAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_AccountSetup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AccountSetupRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).AccountSetup(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_AccountSetup_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).AccountSetup(ctx, req.(*AccountSetupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_RegisterAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).RegisterAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_RegisterAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).RegisterAccount(ctx, req.(*RegisterAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_SignInAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignInAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).SignInAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_SignInAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).SignInAccount(ctx, req.(*SignInAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ResolveAccountSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ResolveAccountSessionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ResolveAccountSession(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ResolveAccountSession_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ResolveAccountSession(ctx, req.(*ResolveAccountSessionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_SignOutAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SignOutAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).SignOutAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_SignOutAccount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).SignOutAccount(ctx, req.(*SignOutAccountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ChangeAccountPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ChangeAccountPasswordRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ChangeAccountPassword(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ChangeAccountPassword_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ChangeAccountPassword(ctx, req.(*ChangeAccountPasswordRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_AddPersonalToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddPersonalTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).AddPersonalToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_AddPersonalToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).AddPersonalToken(ctx, req.(*AddPersonalTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ListPersonalTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPersonalTokensRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ListPersonalTokens(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ListPersonalTokens_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ListPersonalTokens(ctx, req.(*ListPersonalTokensRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_RevokePersonalToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RevokePersonalTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).RevokePersonalToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_RevokePersonalToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).RevokePersonalToken(ctx, req.(*RevokePersonalTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AccountService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.AccountService",
|
||||
HandlerType: (*AccountServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetAuthenticationSettings",
|
||||
Handler: _AccountService_GetAuthenticationSettings_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SaveAuthenticationSettings",
|
||||
Handler: _AccountService_SaveAuthenticationSettings_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BeginPasskey",
|
||||
Handler: _AccountService_BeginPasskey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FinishPasskey",
|
||||
Handler: _AccountService_FinishPasskey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListPasskeys",
|
||||
Handler: _AccountService_ListPasskeys_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeletePasskey",
|
||||
Handler: _AccountService_DeletePasskey_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "OpenAccountSession",
|
||||
Handler: _AccountService_OpenAccountSession_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RequireFreshAccountSession",
|
||||
Handler: _AccountService_RequireFreshAccountSession_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateAccountRecovery",
|
||||
Handler: _AccountService_CreateAccountRecovery_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecoverAccount",
|
||||
Handler: _AccountService_RecoverAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AccountSetup",
|
||||
Handler: _AccountService_AccountSetup_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RegisterAccount",
|
||||
Handler: _AccountService_RegisterAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SignInAccount",
|
||||
Handler: _AccountService_SignInAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ResolveAccountSession",
|
||||
Handler: _AccountService_ResolveAccountSession_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SignOutAccount",
|
||||
Handler: _AccountService_SignOutAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ChangeAccountPassword",
|
||||
Handler: _AccountService_ChangeAccountPassword_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddPersonalToken",
|
||||
Handler: _AccountService_AddPersonalToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListPersonalTokens",
|
||||
Handler: _AccountService_ListPersonalTokens_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RevokePersonalToken",
|
||||
Handler: _AccountService_RevokePersonalToken_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/account.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,325 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/alert.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 (
|
||||
AlertService_RaiseAlert_FullMethodName = "/state.v1.AlertService/RaiseAlert"
|
||||
AlertService_ResolveAlert_FullMethodName = "/state.v1.AlertService/ResolveAlert"
|
||||
AlertService_DismissAlert_FullMethodName = "/state.v1.AlertService/DismissAlert"
|
||||
AlertService_ListAlerts_FullMethodName = "/state.v1.AlertService/ListAlerts"
|
||||
AlertService_ClaimAlertDeliveries_FullMethodName = "/state.v1.AlertService/ClaimAlertDeliveries"
|
||||
AlertService_RecordAlertAttempt_FullMethodName = "/state.v1.AlertService/RecordAlertAttempt"
|
||||
)
|
||||
|
||||
// AlertServiceClient is the client API for AlertService 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.
|
||||
//
|
||||
// Operator alerts (internal/domain/alert). A caller acting for a principal
|
||||
// reads, dismisses and raises only in that principal's org; a request org is
|
||||
// ignored for it. A service acting for no one names the org itself.
|
||||
// RaiseAlert and ResolveAlert are idempotent, so a periodic check can call
|
||||
// them every tick. ClaimAlertDeliveries and RecordAlertAttempt serve the
|
||||
// outbound webhook and refuse a caller scoped to an org.
|
||||
type AlertServiceClient interface {
|
||||
RaiseAlert(ctx context.Context, in *RaiseAlertRequest, opts ...grpc.CallOption) (*RaiseAlertResponse, error)
|
||||
ResolveAlert(ctx context.Context, in *ResolveAlertRequest, opts ...grpc.CallOption) (*ResolveAlertResponse, error)
|
||||
DismissAlert(ctx context.Context, in *DismissAlertRequest, opts ...grpc.CallOption) (*DismissAlertResponse, error)
|
||||
ListAlerts(ctx context.Context, in *ListAlertsRequest, opts ...grpc.CallOption) (*ListAlertsResponse, error)
|
||||
ClaimAlertDeliveries(ctx context.Context, in *ClaimAlertDeliveriesRequest, opts ...grpc.CallOption) (*ClaimAlertDeliveriesResponse, error)
|
||||
RecordAlertAttempt(ctx context.Context, in *RecordAlertAttemptRequest, opts ...grpc.CallOption) (*RecordAlertAttemptResponse, error)
|
||||
}
|
||||
|
||||
type alertServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAlertServiceClient(cc grpc.ClientConnInterface) AlertServiceClient {
|
||||
return &alertServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *alertServiceClient) RaiseAlert(ctx context.Context, in *RaiseAlertRequest, opts ...grpc.CallOption) (*RaiseAlertResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RaiseAlertResponse)
|
||||
err := c.cc.Invoke(ctx, AlertService_RaiseAlert_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *alertServiceClient) ResolveAlert(ctx context.Context, in *ResolveAlertRequest, opts ...grpc.CallOption) (*ResolveAlertResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ResolveAlertResponse)
|
||||
err := c.cc.Invoke(ctx, AlertService_ResolveAlert_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *alertServiceClient) DismissAlert(ctx context.Context, in *DismissAlertRequest, opts ...grpc.CallOption) (*DismissAlertResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DismissAlertResponse)
|
||||
err := c.cc.Invoke(ctx, AlertService_DismissAlert_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *alertServiceClient) ListAlerts(ctx context.Context, in *ListAlertsRequest, opts ...grpc.CallOption) (*ListAlertsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListAlertsResponse)
|
||||
err := c.cc.Invoke(ctx, AlertService_ListAlerts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *alertServiceClient) ClaimAlertDeliveries(ctx context.Context, in *ClaimAlertDeliveriesRequest, opts ...grpc.CallOption) (*ClaimAlertDeliveriesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ClaimAlertDeliveriesResponse)
|
||||
err := c.cc.Invoke(ctx, AlertService_ClaimAlertDeliveries_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *alertServiceClient) RecordAlertAttempt(ctx context.Context, in *RecordAlertAttemptRequest, opts ...grpc.CallOption) (*RecordAlertAttemptResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecordAlertAttemptResponse)
|
||||
err := c.cc.Invoke(ctx, AlertService_RecordAlertAttempt_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AlertServiceServer is the server API for AlertService service.
|
||||
// All implementations must embed UnimplementedAlertServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Operator alerts (internal/domain/alert). A caller acting for a principal
|
||||
// reads, dismisses and raises only in that principal's org; a request org is
|
||||
// ignored for it. A service acting for no one names the org itself.
|
||||
// RaiseAlert and ResolveAlert are idempotent, so a periodic check can call
|
||||
// them every tick. ClaimAlertDeliveries and RecordAlertAttempt serve the
|
||||
// outbound webhook and refuse a caller scoped to an org.
|
||||
type AlertServiceServer interface {
|
||||
RaiseAlert(context.Context, *RaiseAlertRequest) (*RaiseAlertResponse, error)
|
||||
ResolveAlert(context.Context, *ResolveAlertRequest) (*ResolveAlertResponse, error)
|
||||
DismissAlert(context.Context, *DismissAlertRequest) (*DismissAlertResponse, error)
|
||||
ListAlerts(context.Context, *ListAlertsRequest) (*ListAlertsResponse, error)
|
||||
ClaimAlertDeliveries(context.Context, *ClaimAlertDeliveriesRequest) (*ClaimAlertDeliveriesResponse, error)
|
||||
RecordAlertAttempt(context.Context, *RecordAlertAttemptRequest) (*RecordAlertAttemptResponse, error)
|
||||
mustEmbedUnimplementedAlertServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAlertServiceServer 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 UnimplementedAlertServiceServer struct{}
|
||||
|
||||
func (UnimplementedAlertServiceServer) RaiseAlert(context.Context, *RaiseAlertRequest) (*RaiseAlertResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RaiseAlert not implemented")
|
||||
}
|
||||
func (UnimplementedAlertServiceServer) ResolveAlert(context.Context, *ResolveAlertRequest) (*ResolveAlertResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ResolveAlert not implemented")
|
||||
}
|
||||
func (UnimplementedAlertServiceServer) DismissAlert(context.Context, *DismissAlertRequest) (*DismissAlertResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DismissAlert not implemented")
|
||||
}
|
||||
func (UnimplementedAlertServiceServer) ListAlerts(context.Context, *ListAlertsRequest) (*ListAlertsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListAlerts not implemented")
|
||||
}
|
||||
func (UnimplementedAlertServiceServer) ClaimAlertDeliveries(context.Context, *ClaimAlertDeliveriesRequest) (*ClaimAlertDeliveriesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ClaimAlertDeliveries not implemented")
|
||||
}
|
||||
func (UnimplementedAlertServiceServer) RecordAlertAttempt(context.Context, *RecordAlertAttemptRequest) (*RecordAlertAttemptResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecordAlertAttempt not implemented")
|
||||
}
|
||||
func (UnimplementedAlertServiceServer) mustEmbedUnimplementedAlertServiceServer() {}
|
||||
func (UnimplementedAlertServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAlertServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AlertServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAlertServiceServer interface {
|
||||
mustEmbedUnimplementedAlertServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAlertServiceServer(s grpc.ServiceRegistrar, srv AlertServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedAlertServiceServer 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(&AlertService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AlertService_RaiseAlert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RaiseAlertRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AlertServiceServer).RaiseAlert(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AlertService_RaiseAlert_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlertServiceServer).RaiseAlert(ctx, req.(*RaiseAlertRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AlertService_ResolveAlert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ResolveAlertRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AlertServiceServer).ResolveAlert(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AlertService_ResolveAlert_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlertServiceServer).ResolveAlert(ctx, req.(*ResolveAlertRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AlertService_DismissAlert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DismissAlertRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AlertServiceServer).DismissAlert(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AlertService_DismissAlert_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlertServiceServer).DismissAlert(ctx, req.(*DismissAlertRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AlertService_ListAlerts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListAlertsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AlertServiceServer).ListAlerts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AlertService_ListAlerts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlertServiceServer).ListAlerts(ctx, req.(*ListAlertsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AlertService_ClaimAlertDeliveries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ClaimAlertDeliveriesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AlertServiceServer).ClaimAlertDeliveries(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AlertService_ClaimAlertDeliveries_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlertServiceServer).ClaimAlertDeliveries(ctx, req.(*ClaimAlertDeliveriesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AlertService_RecordAlertAttempt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecordAlertAttemptRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AlertServiceServer).RecordAlertAttempt(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AlertService_RecordAlertAttempt_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlertServiceServer).RecordAlertAttempt(ctx, req.(*RecordAlertAttemptRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AlertService_ServiceDesc is the grpc.ServiceDesc for AlertService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AlertService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.AlertService",
|
||||
HandlerType: (*AlertServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "RaiseAlert",
|
||||
Handler: _AlertService_RaiseAlert_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ResolveAlert",
|
||||
Handler: _AlertService_ResolveAlert_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DismissAlert",
|
||||
Handler: _AlertService_DismissAlert_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListAlerts",
|
||||
Handler: _AlertService_ListAlerts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ClaimAlertDeliveries",
|
||||
Handler: _AlertService_ClaimAlertDeliveries_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecordAlertAttempt",
|
||||
Handler: _AlertService_RecordAlertAttempt_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/alert.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,425 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/binding.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 (
|
||||
BindingService_InsertBinding_FullMethodName = "/state.v1.BindingService/InsertBinding"
|
||||
BindingService_GetBinding_FullMethodName = "/state.v1.BindingService/GetBinding"
|
||||
BindingService_ListBindings_FullMethodName = "/state.v1.BindingService/ListBindings"
|
||||
BindingService_UpdateBinding_FullMethodName = "/state.v1.BindingService/UpdateBinding"
|
||||
BindingService_DeleteBinding_FullMethodName = "/state.v1.BindingService/DeleteBinding"
|
||||
BindingService_ApproveBinding_FullMethodName = "/state.v1.BindingService/ApproveBinding"
|
||||
BindingService_PauseBinding_FullMethodName = "/state.v1.BindingService/PauseBinding"
|
||||
BindingService_ResumeBinding_FullMethodName = "/state.v1.BindingService/ResumeBinding"
|
||||
BindingService_ArmedBindingsForSource_FullMethodName = "/state.v1.BindingService/ArmedBindingsForSource"
|
||||
)
|
||||
|
||||
// BindingServiceClient is the client API for BindingService 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 BindingServiceClient interface {
|
||||
InsertBinding(ctx context.Context, in *InsertBindingRequest, opts ...grpc.CallOption) (*InsertBindingResponse, error)
|
||||
GetBinding(ctx context.Context, in *GetBindingRequest, opts ...grpc.CallOption) (*GetBindingResponse, error)
|
||||
ListBindings(ctx context.Context, in *ListBindingsRequest, opts ...grpc.CallOption) (*ListBindingsResponse, error)
|
||||
UpdateBinding(ctx context.Context, in *UpdateBindingRequest, opts ...grpc.CallOption) (*UpdateBindingResponse, error)
|
||||
DeleteBinding(ctx context.Context, in *DeleteBindingRequest, opts ...grpc.CallOption) (*DeleteBindingResponse, error)
|
||||
ApproveBinding(ctx context.Context, in *ApproveBindingRequest, opts ...grpc.CallOption) (*ApproveBindingResponse, error)
|
||||
PauseBinding(ctx context.Context, in *PauseBindingRequest, opts ...grpc.CallOption) (*PauseBindingResponse, error)
|
||||
ResumeBinding(ctx context.Context, in *ResumeBindingRequest, opts ...grpc.CallOption) (*ResumeBindingResponse, error)
|
||||
ArmedBindingsForSource(ctx context.Context, in *ArmedBindingsForSourceRequest, opts ...grpc.CallOption) (*ArmedBindingsForSourceResponse, error)
|
||||
}
|
||||
|
||||
type bindingServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewBindingServiceClient(cc grpc.ClientConnInterface) BindingServiceClient {
|
||||
return &bindingServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) InsertBinding(ctx context.Context, in *InsertBindingRequest, opts ...grpc.CallOption) (*InsertBindingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InsertBindingResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_InsertBinding_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) GetBinding(ctx context.Context, in *GetBindingRequest, opts ...grpc.CallOption) (*GetBindingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetBindingResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_GetBinding_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) ListBindings(ctx context.Context, in *ListBindingsRequest, opts ...grpc.CallOption) (*ListBindingsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListBindingsResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_ListBindings_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) UpdateBinding(ctx context.Context, in *UpdateBindingRequest, opts ...grpc.CallOption) (*UpdateBindingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateBindingResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_UpdateBinding_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) DeleteBinding(ctx context.Context, in *DeleteBindingRequest, opts ...grpc.CallOption) (*DeleteBindingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteBindingResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_DeleteBinding_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) ApproveBinding(ctx context.Context, in *ApproveBindingRequest, opts ...grpc.CallOption) (*ApproveBindingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ApproveBindingResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_ApproveBinding_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) PauseBinding(ctx context.Context, in *PauseBindingRequest, opts ...grpc.CallOption) (*PauseBindingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PauseBindingResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_PauseBinding_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) ResumeBinding(ctx context.Context, in *ResumeBindingRequest, opts ...grpc.CallOption) (*ResumeBindingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ResumeBindingResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_ResumeBinding_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bindingServiceClient) ArmedBindingsForSource(ctx context.Context, in *ArmedBindingsForSourceRequest, opts ...grpc.CallOption) (*ArmedBindingsForSourceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ArmedBindingsForSourceResponse)
|
||||
err := c.cc.Invoke(ctx, BindingService_ArmedBindingsForSource_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// BindingServiceServer is the server API for BindingService service.
|
||||
// All implementations must embed UnimplementedBindingServiceServer
|
||||
// for forward compatibility.
|
||||
type BindingServiceServer interface {
|
||||
InsertBinding(context.Context, *InsertBindingRequest) (*InsertBindingResponse, error)
|
||||
GetBinding(context.Context, *GetBindingRequest) (*GetBindingResponse, error)
|
||||
ListBindings(context.Context, *ListBindingsRequest) (*ListBindingsResponse, error)
|
||||
UpdateBinding(context.Context, *UpdateBindingRequest) (*UpdateBindingResponse, error)
|
||||
DeleteBinding(context.Context, *DeleteBindingRequest) (*DeleteBindingResponse, error)
|
||||
ApproveBinding(context.Context, *ApproveBindingRequest) (*ApproveBindingResponse, error)
|
||||
PauseBinding(context.Context, *PauseBindingRequest) (*PauseBindingResponse, error)
|
||||
ResumeBinding(context.Context, *ResumeBindingRequest) (*ResumeBindingResponse, error)
|
||||
ArmedBindingsForSource(context.Context, *ArmedBindingsForSourceRequest) (*ArmedBindingsForSourceResponse, error)
|
||||
mustEmbedUnimplementedBindingServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedBindingServiceServer 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 UnimplementedBindingServiceServer struct{}
|
||||
|
||||
func (UnimplementedBindingServiceServer) InsertBinding(context.Context, *InsertBindingRequest) (*InsertBindingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InsertBinding not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) GetBinding(context.Context, *GetBindingRequest) (*GetBindingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetBinding not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) ListBindings(context.Context, *ListBindingsRequest) (*ListBindingsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListBindings not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) UpdateBinding(context.Context, *UpdateBindingRequest) (*UpdateBindingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateBinding not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) DeleteBinding(context.Context, *DeleteBindingRequest) (*DeleteBindingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteBinding not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) ApproveBinding(context.Context, *ApproveBindingRequest) (*ApproveBindingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ApproveBinding not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) PauseBinding(context.Context, *PauseBindingRequest) (*PauseBindingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PauseBinding not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) ResumeBinding(context.Context, *ResumeBindingRequest) (*ResumeBindingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ResumeBinding not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) ArmedBindingsForSource(context.Context, *ArmedBindingsForSourceRequest) (*ArmedBindingsForSourceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ArmedBindingsForSource not implemented")
|
||||
}
|
||||
func (UnimplementedBindingServiceServer) mustEmbedUnimplementedBindingServiceServer() {}
|
||||
func (UnimplementedBindingServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeBindingServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to BindingServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeBindingServiceServer interface {
|
||||
mustEmbedUnimplementedBindingServiceServer()
|
||||
}
|
||||
|
||||
func RegisterBindingServiceServer(s grpc.ServiceRegistrar, srv BindingServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedBindingServiceServer 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(&BindingService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _BindingService_InsertBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InsertBindingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).InsertBinding(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_InsertBinding_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).InsertBinding(ctx, req.(*InsertBindingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_GetBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBindingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).GetBinding(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_GetBinding_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).GetBinding(ctx, req.(*GetBindingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_ListBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListBindingsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).ListBindings(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_ListBindings_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).ListBindings(ctx, req.(*ListBindingsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_UpdateBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateBindingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).UpdateBinding(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_UpdateBinding_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).UpdateBinding(ctx, req.(*UpdateBindingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_DeleteBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteBindingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).DeleteBinding(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_DeleteBinding_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).DeleteBinding(ctx, req.(*DeleteBindingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_ApproveBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ApproveBindingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).ApproveBinding(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_ApproveBinding_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).ApproveBinding(ctx, req.(*ApproveBindingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_PauseBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PauseBindingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).PauseBinding(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_PauseBinding_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).PauseBinding(ctx, req.(*PauseBindingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_ResumeBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ResumeBindingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).ResumeBinding(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_ResumeBinding_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).ResumeBinding(ctx, req.(*ResumeBindingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _BindingService_ArmedBindingsForSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ArmedBindingsForSourceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(BindingServiceServer).ArmedBindingsForSource(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: BindingService_ArmedBindingsForSource_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BindingServiceServer).ArmedBindingsForSource(ctx, req.(*ArmedBindingsForSourceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// BindingService_ServiceDesc is the grpc.ServiceDesc for BindingService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var BindingService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.BindingService",
|
||||
HandlerType: (*BindingServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "InsertBinding",
|
||||
Handler: _BindingService_InsertBinding_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBinding",
|
||||
Handler: _BindingService_GetBinding_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListBindings",
|
||||
Handler: _BindingService_ListBindings_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateBinding",
|
||||
Handler: _BindingService_UpdateBinding_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteBinding",
|
||||
Handler: _BindingService_DeleteBinding_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ApproveBinding",
|
||||
Handler: _BindingService_ApproveBinding_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PauseBinding",
|
||||
Handler: _BindingService_PauseBinding_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ResumeBinding",
|
||||
Handler: _BindingService_ResumeBinding_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ArmedBindingsForSource",
|
||||
Handler: _BindingService_ArmedBindingsForSource_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/binding.proto",
|
||||
}
|
||||
@@ -0,0 +1,835 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/capture.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// CapturedEvent mirrors storecontract.CapturedEvent.
|
||||
type CapturedEvent struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"`
|
||||
Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
|
||||
RemoteAddr string `protobuf:"bytes,4,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"`
|
||||
ContentType string `protobuf:"bytes,5,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
|
||||
Headers string `protobuf:"bytes,6,opt,name=headers,proto3" json:"headers,omitempty"`
|
||||
Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"`
|
||||
Authenticated bool `protobuf:"varint,8,opt,name=authenticated,proto3" json:"authenticated,omitempty"`
|
||||
// event_type is the ID of the event type the capture was identified as on
|
||||
// arrival; empty is unidentified.
|
||||
EventType string `protobuf:"bytes,9,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
|
||||
// unsigned marks an event taken on an approved unsigned source.
|
||||
Unsigned bool `protobuf:"varint,10,opt,name=unsigned,proto3" json:"unsigned,omitempty"`
|
||||
// delivery names the sender's delivery; a retry of one delivery shares it.
|
||||
// Intake sets it from the source's delivery header; empty takes the
|
||||
// capture ID.
|
||||
Delivery string `protobuf:"bytes,11,opt,name=delivery,proto3" json:"delivery,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) Reset() {
|
||||
*x = CapturedEvent{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CapturedEvent) ProtoMessage() {}
|
||||
|
||||
func (x *CapturedEvent) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CapturedEvent.ProtoReflect.Descriptor instead.
|
||||
func (*CapturedEvent) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetReceivedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.ReceivedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetRemoteAddr() string {
|
||||
if x != nil {
|
||||
return x.RemoteAddr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetContentType() string {
|
||||
if x != nil {
|
||||
return x.ContentType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetHeaders() string {
|
||||
if x != nil {
|
||||
return x.Headers
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetBody() string {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetAuthenticated() bool {
|
||||
if x != nil {
|
||||
return x.Authenticated
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetEventType() string {
|
||||
if x != nil {
|
||||
return x.EventType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetUnsigned() bool {
|
||||
if x != nil {
|
||||
return x.Unsigned
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *CapturedEvent) GetDelivery() string {
|
||||
if x != nil {
|
||||
return x.Delivery
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RecordCaptureRefusalRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
|
||||
RefusedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=refused_at,json=refusedAt,proto3" json:"refused_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordCaptureRefusalRequest) Reset() {
|
||||
*x = RecordCaptureRefusalRequest{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordCaptureRefusalRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordCaptureRefusalRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RecordCaptureRefusalRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordCaptureRefusalRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RecordCaptureRefusalRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *RecordCaptureRefusalRequest) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordCaptureRefusalRequest) GetAddr() string {
|
||||
if x != nil {
|
||||
return x.Addr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordCaptureRefusalRequest) GetRefusedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.RefusedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RecordCaptureRefusalResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordCaptureRefusalResponse) Reset() {
|
||||
*x = RecordCaptureRefusalResponse{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordCaptureRefusalResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordCaptureRefusalResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RecordCaptureRefusalResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordCaptureRefusalResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RecordCaptureRefusalResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
type ListCaptureRefusalsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Since *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=since,proto3" json:"since,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListCaptureRefusalsRequest) Reset() {
|
||||
*x = ListCaptureRefusalsRequest{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListCaptureRefusalsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListCaptureRefusalsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListCaptureRefusalsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListCaptureRefusalsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListCaptureRefusalsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ListCaptureRefusalsRequest) GetSince() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.Since
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CaptureRefusals struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Refused int64 `protobuf:"varint,2,opt,name=refused,proto3" json:"refused,omitempty"`
|
||||
Accepted int64 `protobuf:"varint,3,opt,name=accepted,proto3" json:"accepted,omitempty"`
|
||||
Addrs []string `protobuf:"bytes,4,rep,name=addrs,proto3" json:"addrs,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CaptureRefusals) Reset() {
|
||||
*x = CaptureRefusals{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CaptureRefusals) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CaptureRefusals) ProtoMessage() {}
|
||||
|
||||
func (x *CaptureRefusals) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CaptureRefusals.ProtoReflect.Descriptor instead.
|
||||
func (*CaptureRefusals) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *CaptureRefusals) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CaptureRefusals) GetRefused() int64 {
|
||||
if x != nil {
|
||||
return x.Refused
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CaptureRefusals) GetAccepted() int64 {
|
||||
if x != nil {
|
||||
return x.Accepted
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CaptureRefusals) GetAddrs() []string {
|
||||
if x != nil {
|
||||
return x.Addrs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListCaptureRefusalsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Sources []*CaptureRefusals `protobuf:"bytes,1,rep,name=sources,proto3" json:"sources,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListCaptureRefusalsResponse) Reset() {
|
||||
*x = ListCaptureRefusalsResponse{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListCaptureRefusalsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListCaptureRefusalsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListCaptureRefusalsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListCaptureRefusalsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListCaptureRefusalsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ListCaptureRefusalsResponse) GetSources() []*CaptureRefusals {
|
||||
if x != nil {
|
||||
return x.Sources
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type InsertCaptureRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Capture *CapturedEvent `protobuf:"bytes,1,opt,name=capture,proto3" json:"capture,omitempty"`
|
||||
RetentionSeconds int64 `protobuf:"varint,2,opt,name=retention_seconds,json=retentionSeconds,proto3" json:"retention_seconds,omitempty"`
|
||||
MaxEvents int64 `protobuf:"varint,3,opt,name=max_events,json=maxEvents,proto3" json:"max_events,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertCaptureRequest) Reset() {
|
||||
*x = InsertCaptureRequest{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertCaptureRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertCaptureRequest) ProtoMessage() {}
|
||||
|
||||
func (x *InsertCaptureRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertCaptureRequest.ProtoReflect.Descriptor instead.
|
||||
func (*InsertCaptureRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *InsertCaptureRequest) GetCapture() *CapturedEvent {
|
||||
if x != nil {
|
||||
return x.Capture
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *InsertCaptureRequest) GetRetentionSeconds() int64 {
|
||||
if x != nil {
|
||||
return x.RetentionSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *InsertCaptureRequest) GetMaxEvents() int64 {
|
||||
if x != nil {
|
||||
return x.MaxEvents
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type InsertCaptureResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertCaptureResponse) Reset() {
|
||||
*x = InsertCaptureResponse{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertCaptureResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertCaptureResponse) ProtoMessage() {}
|
||||
|
||||
func (x *InsertCaptureResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertCaptureResponse.ProtoReflect.Descriptor instead.
|
||||
func (*InsertCaptureResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *InsertCaptureResponse) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type StreamCapturesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StreamCapturesRequest) Reset() {
|
||||
*x = StreamCapturesRequest{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StreamCapturesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamCapturesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StreamCapturesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamCapturesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StreamCapturesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *StreamCapturesRequest) GetLimit() int64 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Streamed one capture per message; see StreamCaptures above.
|
||||
type StreamCapturesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Capture *CapturedEvent `protobuf:"bytes,1,opt,name=capture,proto3" json:"capture,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StreamCapturesResponse) Reset() {
|
||||
*x = StreamCapturesResponse{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StreamCapturesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamCapturesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StreamCapturesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamCapturesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StreamCapturesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *StreamCapturesResponse) GetCapture() *CapturedEvent {
|
||||
if x != nil {
|
||||
return x.Capture
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StreamUndispatchedCapturesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// Bindings are the ids of the armed bindings, on enabled workflows, the
|
||||
// captures are listed for.
|
||||
Bindings []string `protobuf:"bytes,3,rep,name=bindings,proto3" json:"bindings,omitempty"`
|
||||
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StreamUndispatchedCapturesRequest) Reset() {
|
||||
*x = StreamUndispatchedCapturesRequest{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StreamUndispatchedCapturesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamUndispatchedCapturesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StreamUndispatchedCapturesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamUndispatchedCapturesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StreamUndispatchedCapturesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *StreamUndispatchedCapturesRequest) GetBindings() []string {
|
||||
if x != nil {
|
||||
return x.Bindings
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StreamUndispatchedCapturesRequest) GetLimit() int64 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Streamed one capture per message; see StreamUndispatchedCaptures above.
|
||||
type StreamUndispatchedCapturesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Capture *CapturedEvent `protobuf:"bytes,1,opt,name=capture,proto3" json:"capture,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StreamUndispatchedCapturesResponse) Reset() {
|
||||
*x = StreamUndispatchedCapturesResponse{}
|
||||
mi := &file_state_v1_capture_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StreamUndispatchedCapturesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamUndispatchedCapturesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StreamUndispatchedCapturesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_capture_proto_msgTypes[11]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamUndispatchedCapturesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StreamUndispatchedCapturesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_capture_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
func (x *StreamUndispatchedCapturesResponse) GetCapture() *CapturedEvent {
|
||||
if x != nil {
|
||||
return x.Capture
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_state_v1_capture_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_capture_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x16state/v1/capture.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe3\x02\n" +
|
||||
"\rCapturedEvent\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12;\n" +
|
||||
"\vreceived_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
|
||||
"receivedAt\x12\x16\n" +
|
||||
"\x06source\x18\x03 \x01(\tR\x06source\x12\x1f\n" +
|
||||
"\vremote_addr\x18\x04 \x01(\tR\n" +
|
||||
"remoteAddr\x12!\n" +
|
||||
"\fcontent_type\x18\x05 \x01(\tR\vcontentType\x12\x18\n" +
|
||||
"\aheaders\x18\x06 \x01(\tR\aheaders\x12\x12\n" +
|
||||
"\x04body\x18\a \x01(\tR\x04body\x12$\n" +
|
||||
"\rauthenticated\x18\b \x01(\bR\rauthenticated\x12\x1d\n" +
|
||||
"\n" +
|
||||
"event_type\x18\t \x01(\tR\teventType\x12\x1a\n" +
|
||||
"\bunsigned\x18\n" +
|
||||
" \x01(\bR\bunsigned\x12\x1a\n" +
|
||||
"\bdelivery\x18\v \x01(\tR\bdelivery\"\x84\x01\n" +
|
||||
"\x1bRecordCaptureRefusalRequest\x12\x16\n" +
|
||||
"\x06source\x18\x01 \x01(\tR\x06source\x12\x12\n" +
|
||||
"\x04addr\x18\x02 \x01(\tR\x04addr\x129\n" +
|
||||
"\n" +
|
||||
"refused_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\trefusedAt\"\x1e\n" +
|
||||
"\x1cRecordCaptureRefusalResponse\"N\n" +
|
||||
"\x1aListCaptureRefusalsRequest\x120\n" +
|
||||
"\x05since\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x05since\"u\n" +
|
||||
"\x0fCaptureRefusals\x12\x16\n" +
|
||||
"\x06source\x18\x01 \x01(\tR\x06source\x12\x18\n" +
|
||||
"\arefused\x18\x02 \x01(\x03R\arefused\x12\x1a\n" +
|
||||
"\baccepted\x18\x03 \x01(\x03R\baccepted\x12\x14\n" +
|
||||
"\x05addrs\x18\x04 \x03(\tR\x05addrs\"R\n" +
|
||||
"\x1bListCaptureRefusalsResponse\x123\n" +
|
||||
"\asources\x18\x01 \x03(\v2\x19.state.v1.CaptureRefusalsR\asources\"\x95\x01\n" +
|
||||
"\x14InsertCaptureRequest\x121\n" +
|
||||
"\acapture\x18\x01 \x01(\v2\x17.state.v1.CapturedEventR\acapture\x12+\n" +
|
||||
"\x11retention_seconds\x18\x02 \x01(\x03R\x10retentionSeconds\x12\x1d\n" +
|
||||
"\n" +
|
||||
"max_events\x18\x03 \x01(\x03R\tmaxEvents\"'\n" +
|
||||
"\x15InsertCaptureResponse\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"-\n" +
|
||||
"\x15StreamCapturesRequest\x12\x14\n" +
|
||||
"\x05limit\x18\x01 \x01(\x03R\x05limit\"K\n" +
|
||||
"\x16StreamCapturesResponse\x121\n" +
|
||||
"\acapture\x18\x01 \x01(\v2\x17.state.v1.CapturedEventR\acapture\"d\n" +
|
||||
"!StreamUndispatchedCapturesRequest\x12\x1a\n" +
|
||||
"\bbindings\x18\x03 \x03(\tR\bbindings\x12\x14\n" +
|
||||
"\x05limit\x18\x02 \x01(\x03R\x05limitJ\x04\b\x01\x10\x02R\asources\"W\n" +
|
||||
"\"StreamUndispatchedCapturesResponse\x121\n" +
|
||||
"\acapture\x18\x01 \x01(\v2\x17.state.v1.CapturedEventR\acapture2\xff\x03\n" +
|
||||
"\x0eCaptureService\x12e\n" +
|
||||
"\x14RecordCaptureRefusal\x12%.state.v1.RecordCaptureRefusalRequest\x1a&.state.v1.RecordCaptureRefusalResponse\x12b\n" +
|
||||
"\x13ListCaptureRefusals\x12$.state.v1.ListCaptureRefusalsRequest\x1a%.state.v1.ListCaptureRefusalsResponse\x12P\n" +
|
||||
"\rInsertCapture\x12\x1e.state.v1.InsertCaptureRequest\x1a\x1f.state.v1.InsertCaptureResponse\x12U\n" +
|
||||
"\x0eStreamCaptures\x12\x1f.state.v1.StreamCapturesRequest\x1a .state.v1.StreamCapturesResponse0\x01\x12y\n" +
|
||||
"\x1aStreamUndispatchedCaptures\x12+.state.v1.StreamUndispatchedCapturesRequest\x1a,.state.v1.StreamUndispatchedCapturesResponse0\x01B\xa6\x01\n" +
|
||||
"\fcom.state.v1B\fCaptureProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_capture_proto_rawDescOnce sync.Once
|
||||
file_state_v1_capture_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_capture_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_capture_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_capture_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_capture_proto_rawDesc), len(file_state_v1_capture_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_capture_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_capture_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||
var file_state_v1_capture_proto_goTypes = []any{
|
||||
(*CapturedEvent)(nil), // 0: state.v1.CapturedEvent
|
||||
(*RecordCaptureRefusalRequest)(nil), // 1: state.v1.RecordCaptureRefusalRequest
|
||||
(*RecordCaptureRefusalResponse)(nil), // 2: state.v1.RecordCaptureRefusalResponse
|
||||
(*ListCaptureRefusalsRequest)(nil), // 3: state.v1.ListCaptureRefusalsRequest
|
||||
(*CaptureRefusals)(nil), // 4: state.v1.CaptureRefusals
|
||||
(*ListCaptureRefusalsResponse)(nil), // 5: state.v1.ListCaptureRefusalsResponse
|
||||
(*InsertCaptureRequest)(nil), // 6: state.v1.InsertCaptureRequest
|
||||
(*InsertCaptureResponse)(nil), // 7: state.v1.InsertCaptureResponse
|
||||
(*StreamCapturesRequest)(nil), // 8: state.v1.StreamCapturesRequest
|
||||
(*StreamCapturesResponse)(nil), // 9: state.v1.StreamCapturesResponse
|
||||
(*StreamUndispatchedCapturesRequest)(nil), // 10: state.v1.StreamUndispatchedCapturesRequest
|
||||
(*StreamUndispatchedCapturesResponse)(nil), // 11: state.v1.StreamUndispatchedCapturesResponse
|
||||
(*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp
|
||||
}
|
||||
var file_state_v1_capture_proto_depIdxs = []int32{
|
||||
12, // 0: state.v1.CapturedEvent.received_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 1: state.v1.RecordCaptureRefusalRequest.refused_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 2: state.v1.ListCaptureRefusalsRequest.since:type_name -> google.protobuf.Timestamp
|
||||
4, // 3: state.v1.ListCaptureRefusalsResponse.sources:type_name -> state.v1.CaptureRefusals
|
||||
0, // 4: state.v1.InsertCaptureRequest.capture:type_name -> state.v1.CapturedEvent
|
||||
0, // 5: state.v1.StreamCapturesResponse.capture:type_name -> state.v1.CapturedEvent
|
||||
0, // 6: state.v1.StreamUndispatchedCapturesResponse.capture:type_name -> state.v1.CapturedEvent
|
||||
1, // 7: state.v1.CaptureService.RecordCaptureRefusal:input_type -> state.v1.RecordCaptureRefusalRequest
|
||||
3, // 8: state.v1.CaptureService.ListCaptureRefusals:input_type -> state.v1.ListCaptureRefusalsRequest
|
||||
6, // 9: state.v1.CaptureService.InsertCapture:input_type -> state.v1.InsertCaptureRequest
|
||||
8, // 10: state.v1.CaptureService.StreamCaptures:input_type -> state.v1.StreamCapturesRequest
|
||||
10, // 11: state.v1.CaptureService.StreamUndispatchedCaptures:input_type -> state.v1.StreamUndispatchedCapturesRequest
|
||||
2, // 12: state.v1.CaptureService.RecordCaptureRefusal:output_type -> state.v1.RecordCaptureRefusalResponse
|
||||
5, // 13: state.v1.CaptureService.ListCaptureRefusals:output_type -> state.v1.ListCaptureRefusalsResponse
|
||||
7, // 14: state.v1.CaptureService.InsertCapture:output_type -> state.v1.InsertCaptureResponse
|
||||
9, // 15: state.v1.CaptureService.StreamCaptures:output_type -> state.v1.StreamCapturesResponse
|
||||
11, // 16: state.v1.CaptureService.StreamUndispatchedCaptures:output_type -> state.v1.StreamUndispatchedCapturesResponse
|
||||
12, // [12:17] is the sub-list for method output_type
|
||||
7, // [7:12] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_capture_proto_init() }
|
||||
func file_state_v1_capture_proto_init() {
|
||||
if File_state_v1_capture_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_capture_proto_rawDesc), len(file_state_v1_capture_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 12,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_capture_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_capture_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_capture_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_capture_proto = out.File
|
||||
file_state_v1_capture_proto_goTypes = nil
|
||||
file_state_v1_capture_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/capture.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 (
|
||||
CaptureService_RecordCaptureRefusal_FullMethodName = "/state.v1.CaptureService/RecordCaptureRefusal"
|
||||
CaptureService_ListCaptureRefusals_FullMethodName = "/state.v1.CaptureService/ListCaptureRefusals"
|
||||
CaptureService_InsertCapture_FullMethodName = "/state.v1.CaptureService/InsertCapture"
|
||||
CaptureService_StreamCaptures_FullMethodName = "/state.v1.CaptureService/StreamCaptures"
|
||||
CaptureService_StreamUndispatchedCaptures_FullMethodName = "/state.v1.CaptureService/StreamUndispatchedCaptures"
|
||||
)
|
||||
|
||||
// CaptureServiceClient is the client API for CaptureService 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 CaptureServiceClient interface {
|
||||
// Capture refusals: events the network rules refused at the receiver,
|
||||
// counted per source. Administrative.
|
||||
RecordCaptureRefusal(ctx context.Context, in *RecordCaptureRefusalRequest, opts ...grpc.CallOption) (*RecordCaptureRefusalResponse, error)
|
||||
ListCaptureRefusals(ctx context.Context, in *ListCaptureRefusalsRequest, opts ...grpc.CallOption) (*ListCaptureRefusalsResponse, error)
|
||||
InsertCapture(ctx context.Context, in *InsertCaptureRequest, opts ...grpc.CallOption) (*InsertCaptureResponse, error)
|
||||
// StreamCaptures returns one capture per message: a batch of large capture
|
||||
// bodies can exceed gRPC's 4MiB unary message cap
|
||||
// (docs/prds/state-store-contract.md).
|
||||
StreamCaptures(ctx context.Context, in *StreamCapturesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamCapturesResponse], error)
|
||||
StreamUndispatchedCaptures(ctx context.Context, in *StreamUndispatchedCapturesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamUndispatchedCapturesResponse], error)
|
||||
}
|
||||
|
||||
type captureServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewCaptureServiceClient(cc grpc.ClientConnInterface) CaptureServiceClient {
|
||||
return &captureServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *captureServiceClient) RecordCaptureRefusal(ctx context.Context, in *RecordCaptureRefusalRequest, opts ...grpc.CallOption) (*RecordCaptureRefusalResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecordCaptureRefusalResponse)
|
||||
err := c.cc.Invoke(ctx, CaptureService_RecordCaptureRefusal_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *captureServiceClient) ListCaptureRefusals(ctx context.Context, in *ListCaptureRefusalsRequest, opts ...grpc.CallOption) (*ListCaptureRefusalsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListCaptureRefusalsResponse)
|
||||
err := c.cc.Invoke(ctx, CaptureService_ListCaptureRefusals_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *captureServiceClient) InsertCapture(ctx context.Context, in *InsertCaptureRequest, opts ...grpc.CallOption) (*InsertCaptureResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InsertCaptureResponse)
|
||||
err := c.cc.Invoke(ctx, CaptureService_InsertCapture_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *captureServiceClient) StreamCaptures(ctx context.Context, in *StreamCapturesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamCapturesResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &CaptureService_ServiceDesc.Streams[0], CaptureService_StreamCaptures_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[StreamCapturesRequest, StreamCapturesResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CaptureService_StreamCapturesClient = grpc.ServerStreamingClient[StreamCapturesResponse]
|
||||
|
||||
func (c *captureServiceClient) StreamUndispatchedCaptures(ctx context.Context, in *StreamUndispatchedCapturesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamUndispatchedCapturesResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &CaptureService_ServiceDesc.Streams[1], CaptureService_StreamUndispatchedCaptures_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[StreamUndispatchedCapturesRequest, StreamUndispatchedCapturesResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CaptureService_StreamUndispatchedCapturesClient = grpc.ServerStreamingClient[StreamUndispatchedCapturesResponse]
|
||||
|
||||
// CaptureServiceServer is the server API for CaptureService service.
|
||||
// All implementations must embed UnimplementedCaptureServiceServer
|
||||
// for forward compatibility.
|
||||
type CaptureServiceServer interface {
|
||||
// Capture refusals: events the network rules refused at the receiver,
|
||||
// counted per source. Administrative.
|
||||
RecordCaptureRefusal(context.Context, *RecordCaptureRefusalRequest) (*RecordCaptureRefusalResponse, error)
|
||||
ListCaptureRefusals(context.Context, *ListCaptureRefusalsRequest) (*ListCaptureRefusalsResponse, error)
|
||||
InsertCapture(context.Context, *InsertCaptureRequest) (*InsertCaptureResponse, error)
|
||||
// StreamCaptures returns one capture per message: a batch of large capture
|
||||
// bodies can exceed gRPC's 4MiB unary message cap
|
||||
// (docs/prds/state-store-contract.md).
|
||||
StreamCaptures(*StreamCapturesRequest, grpc.ServerStreamingServer[StreamCapturesResponse]) error
|
||||
StreamUndispatchedCaptures(*StreamUndispatchedCapturesRequest, grpc.ServerStreamingServer[StreamUndispatchedCapturesResponse]) error
|
||||
mustEmbedUnimplementedCaptureServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedCaptureServiceServer 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 UnimplementedCaptureServiceServer struct{}
|
||||
|
||||
func (UnimplementedCaptureServiceServer) RecordCaptureRefusal(context.Context, *RecordCaptureRefusalRequest) (*RecordCaptureRefusalResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecordCaptureRefusal not implemented")
|
||||
}
|
||||
func (UnimplementedCaptureServiceServer) ListCaptureRefusals(context.Context, *ListCaptureRefusalsRequest) (*ListCaptureRefusalsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListCaptureRefusals not implemented")
|
||||
}
|
||||
func (UnimplementedCaptureServiceServer) InsertCapture(context.Context, *InsertCaptureRequest) (*InsertCaptureResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InsertCapture not implemented")
|
||||
}
|
||||
func (UnimplementedCaptureServiceServer) StreamCaptures(*StreamCapturesRequest, grpc.ServerStreamingServer[StreamCapturesResponse]) error {
|
||||
return status.Error(codes.Unimplemented, "method StreamCaptures not implemented")
|
||||
}
|
||||
func (UnimplementedCaptureServiceServer) StreamUndispatchedCaptures(*StreamUndispatchedCapturesRequest, grpc.ServerStreamingServer[StreamUndispatchedCapturesResponse]) error {
|
||||
return status.Error(codes.Unimplemented, "method StreamUndispatchedCaptures not implemented")
|
||||
}
|
||||
func (UnimplementedCaptureServiceServer) mustEmbedUnimplementedCaptureServiceServer() {}
|
||||
func (UnimplementedCaptureServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCaptureServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CaptureServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeCaptureServiceServer interface {
|
||||
mustEmbedUnimplementedCaptureServiceServer()
|
||||
}
|
||||
|
||||
func RegisterCaptureServiceServer(s grpc.ServiceRegistrar, srv CaptureServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedCaptureServiceServer 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(&CaptureService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _CaptureService_RecordCaptureRefusal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecordCaptureRefusalRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CaptureServiceServer).RecordCaptureRefusal(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CaptureService_RecordCaptureRefusal_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CaptureServiceServer).RecordCaptureRefusal(ctx, req.(*RecordCaptureRefusalRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CaptureService_ListCaptureRefusals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListCaptureRefusalsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CaptureServiceServer).ListCaptureRefusals(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CaptureService_ListCaptureRefusals_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CaptureServiceServer).ListCaptureRefusals(ctx, req.(*ListCaptureRefusalsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CaptureService_InsertCapture_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InsertCaptureRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CaptureServiceServer).InsertCapture(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CaptureService_InsertCapture_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CaptureServiceServer).InsertCapture(ctx, req.(*InsertCaptureRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CaptureService_StreamCaptures_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(StreamCapturesRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(CaptureServiceServer).StreamCaptures(m, &grpc.GenericServerStream[StreamCapturesRequest, StreamCapturesResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CaptureService_StreamCapturesServer = grpc.ServerStreamingServer[StreamCapturesResponse]
|
||||
|
||||
func _CaptureService_StreamUndispatchedCaptures_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(StreamUndispatchedCapturesRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(CaptureServiceServer).StreamUndispatchedCaptures(m, &grpc.GenericServerStream[StreamUndispatchedCapturesRequest, StreamUndispatchedCapturesResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CaptureService_StreamUndispatchedCapturesServer = grpc.ServerStreamingServer[StreamUndispatchedCapturesResponse]
|
||||
|
||||
// CaptureService_ServiceDesc is the grpc.ServiceDesc for CaptureService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var CaptureService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.CaptureService",
|
||||
HandlerType: (*CaptureServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "RecordCaptureRefusal",
|
||||
Handler: _CaptureService_RecordCaptureRefusal_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListCaptureRefusals",
|
||||
Handler: _CaptureService_ListCaptureRefusals_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InsertCapture",
|
||||
Handler: _CaptureService_InsertCapture_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "StreamCaptures",
|
||||
Handler: _CaptureService_StreamCaptures_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "StreamUndispatchedCaptures",
|
||||
Handler: _CaptureService_StreamUndispatchedCaptures_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "state/v1/capture.proto",
|
||||
}
|
||||
@@ -0,0 +1,824 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/dispatch.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type RecordDispatchRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
BindingId string `protobuf:"bytes,1,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"`
|
||||
BindingVersion int64 `protobuf:"varint,2,opt,name=binding_version,json=bindingVersion,proto3" json:"binding_version,omitempty"`
|
||||
CaptureId string `protobuf:"bytes,3,opt,name=capture_id,json=captureId,proto3" json:"capture_id,omitempty"`
|
||||
// task_id addresses the tasks table.
|
||||
TaskId int64 `protobuf:"varint,4,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
// reason is empty for a dispatch and names why an evaluated capture
|
||||
// started no task.
|
||||
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordDispatchRequest) Reset() {
|
||||
*x = RecordDispatchRequest{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordDispatchRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordDispatchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RecordDispatchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordDispatchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RecordDispatchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *RecordDispatchRequest) GetBindingId() string {
|
||||
if x != nil {
|
||||
return x.BindingId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordDispatchRequest) GetBindingVersion() int64 {
|
||||
if x != nil {
|
||||
return x.BindingVersion
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RecordDispatchRequest) GetCaptureId() string {
|
||||
if x != nil {
|
||||
return x.CaptureId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordDispatchRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RecordDispatchRequest) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RecordDispatchResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordDispatchResponse) Reset() {
|
||||
*x = RecordDispatchResponse{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordDispatchResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordDispatchResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RecordDispatchResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordDispatchResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RecordDispatchResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
// ListDispatchesRequest filters the binding dispatch ledger; empty fields
|
||||
// match any row.
|
||||
type ListDispatchesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
BindingId string `protobuf:"bytes,1,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"`
|
||||
CaptureId string `protobuf:"bytes,2,opt,name=capture_id,json=captureId,proto3" json:"capture_id,omitempty"`
|
||||
TaskId int64 `protobuf:"varint,3,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListDispatchesRequest) Reset() {
|
||||
*x = ListDispatchesRequest{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListDispatchesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListDispatchesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListDispatchesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListDispatchesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListDispatchesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListDispatchesRequest) GetBindingId() string {
|
||||
if x != nil {
|
||||
return x.BindingId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListDispatchesRequest) GetCaptureId() string {
|
||||
if x != nil {
|
||||
return x.CaptureId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListDispatchesRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListDispatchesRequest) GetLimit() int32 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Dispatch struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
BindingId string `protobuf:"bytes,1,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"`
|
||||
BindingVersion int64 `protobuf:"varint,2,opt,name=binding_version,json=bindingVersion,proto3" json:"binding_version,omitempty"`
|
||||
CaptureId string `protobuf:"bytes,3,opt,name=capture_id,json=captureId,proto3" json:"capture_id,omitempty"`
|
||||
TaskId int64 `protobuf:"varint,4,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
DispatchedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=dispatched_at,json=dispatchedAt,proto3" json:"dispatched_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Dispatch) Reset() {
|
||||
*x = Dispatch{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Dispatch) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Dispatch) ProtoMessage() {}
|
||||
|
||||
func (x *Dispatch) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Dispatch.ProtoReflect.Descriptor instead.
|
||||
func (*Dispatch) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *Dispatch) GetBindingId() string {
|
||||
if x != nil {
|
||||
return x.BindingId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Dispatch) GetBindingVersion() int64 {
|
||||
if x != nil {
|
||||
return x.BindingVersion
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Dispatch) GetCaptureId() string {
|
||||
if x != nil {
|
||||
return x.CaptureId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Dispatch) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Dispatch) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Dispatch) GetDispatchedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.DispatchedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListDispatchesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Dispatches []*Dispatch `protobuf:"bytes,1,rep,name=dispatches,proto3" json:"dispatches,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListDispatchesResponse) Reset() {
|
||||
*x = ListDispatchesResponse{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListDispatchesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListDispatchesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListDispatchesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListDispatchesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListDispatchesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ListDispatchesResponse) GetDispatches() []*Dispatch {
|
||||
if x != nil {
|
||||
return x.Dispatches
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RecordPlaybookDispatchRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
PlaybookId string `protobuf:"bytes,1,opt,name=playbook_id,json=playbookId,proto3" json:"playbook_id,omitempty"`
|
||||
PlaybookVersion string `protobuf:"bytes,2,opt,name=playbook_version,json=playbookVersion,proto3" json:"playbook_version,omitempty"`
|
||||
EventId string `protobuf:"bytes,3,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
|
||||
ActionId string `protobuf:"bytes,4,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchRequest) Reset() {
|
||||
*x = RecordPlaybookDispatchRequest{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordPlaybookDispatchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RecordPlaybookDispatchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordPlaybookDispatchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RecordPlaybookDispatchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchRequest) GetPlaybookId() string {
|
||||
if x != nil {
|
||||
return x.PlaybookId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchRequest) GetPlaybookVersion() string {
|
||||
if x != nil {
|
||||
return x.PlaybookVersion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchRequest) GetEventId() string {
|
||||
if x != nil {
|
||||
return x.EventId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchRequest) GetActionId() string {
|
||||
if x != nil {
|
||||
return x.ActionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RecordPlaybookDispatchResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchResponse) Reset() {
|
||||
*x = RecordPlaybookDispatchResponse{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordPlaybookDispatchResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordPlaybookDispatchResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RecordPlaybookDispatchResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordPlaybookDispatchResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RecordPlaybookDispatchResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
type DeletePlaybookDispatchesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
PlaybookId string `protobuf:"bytes,1,opt,name=playbook_id,json=playbookId,proto3" json:"playbook_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeletePlaybookDispatchesRequest) Reset() {
|
||||
*x = DeletePlaybookDispatchesRequest{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeletePlaybookDispatchesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeletePlaybookDispatchesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeletePlaybookDispatchesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeletePlaybookDispatchesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeletePlaybookDispatchesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *DeletePlaybookDispatchesRequest) GetPlaybookId() string {
|
||||
if x != nil {
|
||||
return x.PlaybookId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeletePlaybookDispatchesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeletePlaybookDispatchesResponse) Reset() {
|
||||
*x = DeletePlaybookDispatchesResponse{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeletePlaybookDispatchesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeletePlaybookDispatchesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *DeletePlaybookDispatchesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeletePlaybookDispatchesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeletePlaybookDispatchesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
type EnqueueBindingTaskRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
|
||||
Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"`
|
||||
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
|
||||
Workflow string `protobuf:"bytes,5,opt,name=workflow,proto3" json:"workflow,omitempty"`
|
||||
Identity string `protobuf:"bytes,6,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
BindingId string `protobuf:"bytes,7,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"`
|
||||
BindingVersion int64 `protobuf:"varint,8,opt,name=binding_version,json=bindingVersion,proto3" json:"binding_version,omitempty"`
|
||||
InputsJson string `protobuf:"bytes,9,opt,name=inputs_json,json=inputsJson,proto3" json:"inputs_json,omitempty"`
|
||||
CaptureId string `protobuf:"bytes,10,opt,name=capture_id,json=captureId,proto3" json:"capture_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) Reset() {
|
||||
*x = EnqueueBindingTaskRequest{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EnqueueBindingTaskRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EnqueueBindingTaskRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EnqueueBindingTaskRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetOwner() string {
|
||||
if x != nil {
|
||||
return x.Owner
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetRepo() string {
|
||||
if x != nil {
|
||||
return x.Repo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetBody() string {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetWorkflow() string {
|
||||
if x != nil {
|
||||
return x.Workflow
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetBindingId() string {
|
||||
if x != nil {
|
||||
return x.BindingId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetBindingVersion() int64 {
|
||||
if x != nil {
|
||||
return x.BindingVersion
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetInputsJson() string {
|
||||
if x != nil {
|
||||
return x.InputsJson
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskRequest) GetCaptureId() string {
|
||||
if x != nil {
|
||||
return x.CaptureId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type EnqueueBindingTaskResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskResponse) Reset() {
|
||||
*x = EnqueueBindingTaskResponse{}
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EnqueueBindingTaskResponse) ProtoMessage() {}
|
||||
|
||||
func (x *EnqueueBindingTaskResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_dispatch_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EnqueueBindingTaskResponse.ProtoReflect.Descriptor instead.
|
||||
func (*EnqueueBindingTaskResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_dispatch_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *EnqueueBindingTaskResponse) GetTask() *Task {
|
||||
if x != nil {
|
||||
return x.Task
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_state_v1_dispatch_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_dispatch_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x17state/v1/dispatch.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14state/v1/types.proto\"\xaf\x01\n" +
|
||||
"\x15RecordDispatchRequest\x12\x1d\n" +
|
||||
"\n" +
|
||||
"binding_id\x18\x01 \x01(\tR\tbindingId\x12'\n" +
|
||||
"\x0fbinding_version\x18\x02 \x01(\x03R\x0ebindingVersion\x12\x1d\n" +
|
||||
"\n" +
|
||||
"capture_id\x18\x03 \x01(\tR\tcaptureId\x12\x17\n" +
|
||||
"\atask_id\x18\x04 \x01(\x03R\x06taskId\x12\x16\n" +
|
||||
"\x06reason\x18\x05 \x01(\tR\x06reason\"\x18\n" +
|
||||
"\x16RecordDispatchResponse\"\x84\x01\n" +
|
||||
"\x15ListDispatchesRequest\x12\x1d\n" +
|
||||
"\n" +
|
||||
"binding_id\x18\x01 \x01(\tR\tbindingId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"capture_id\x18\x02 \x01(\tR\tcaptureId\x12\x17\n" +
|
||||
"\atask_id\x18\x03 \x01(\x03R\x06taskId\x12\x14\n" +
|
||||
"\x05limit\x18\x04 \x01(\x05R\x05limit\"\xe3\x01\n" +
|
||||
"\bDispatch\x12\x1d\n" +
|
||||
"\n" +
|
||||
"binding_id\x18\x01 \x01(\tR\tbindingId\x12'\n" +
|
||||
"\x0fbinding_version\x18\x02 \x01(\x03R\x0ebindingVersion\x12\x1d\n" +
|
||||
"\n" +
|
||||
"capture_id\x18\x03 \x01(\tR\tcaptureId\x12\x17\n" +
|
||||
"\atask_id\x18\x04 \x01(\x03R\x06taskId\x12\x16\n" +
|
||||
"\x06reason\x18\x05 \x01(\tR\x06reason\x12?\n" +
|
||||
"\rdispatched_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\fdispatchedAt\"L\n" +
|
||||
"\x16ListDispatchesResponse\x122\n" +
|
||||
"\n" +
|
||||
"dispatches\x18\x01 \x03(\v2\x12.state.v1.DispatchR\n" +
|
||||
"dispatches\"\xa3\x01\n" +
|
||||
"\x1dRecordPlaybookDispatchRequest\x12\x1f\n" +
|
||||
"\vplaybook_id\x18\x01 \x01(\tR\n" +
|
||||
"playbookId\x12)\n" +
|
||||
"\x10playbook_version\x18\x02 \x01(\tR\x0fplaybookVersion\x12\x19\n" +
|
||||
"\bevent_id\x18\x03 \x01(\tR\aeventId\x12\x1b\n" +
|
||||
"\taction_id\x18\x04 \x01(\tR\bactionId\" \n" +
|
||||
"\x1eRecordPlaybookDispatchResponse\"B\n" +
|
||||
"\x1fDeletePlaybookDispatchesRequest\x12\x1f\n" +
|
||||
"\vplaybook_id\x18\x01 \x01(\tR\n" +
|
||||
"playbookId\"\"\n" +
|
||||
" DeletePlaybookDispatchesResponse\"\xaf\x02\n" +
|
||||
"\x19EnqueueBindingTaskRequest\x12\x14\n" +
|
||||
"\x05owner\x18\x01 \x01(\tR\x05owner\x12\x12\n" +
|
||||
"\x04repo\x18\x02 \x01(\tR\x04repo\x12\x14\n" +
|
||||
"\x05title\x18\x03 \x01(\tR\x05title\x12\x12\n" +
|
||||
"\x04body\x18\x04 \x01(\tR\x04body\x12\x1a\n" +
|
||||
"\bworkflow\x18\x05 \x01(\tR\bworkflow\x12\x1a\n" +
|
||||
"\bidentity\x18\x06 \x01(\tR\bidentity\x12\x1d\n" +
|
||||
"\n" +
|
||||
"binding_id\x18\a \x01(\tR\tbindingId\x12'\n" +
|
||||
"\x0fbinding_version\x18\b \x01(\x03R\x0ebindingVersion\x12\x1f\n" +
|
||||
"\vinputs_json\x18\t \x01(\tR\n" +
|
||||
"inputsJson\x12\x1d\n" +
|
||||
"\n" +
|
||||
"capture_id\x18\n" +
|
||||
" \x01(\tR\tcaptureId\"@\n" +
|
||||
"\x1aEnqueueBindingTaskResponse\x12\"\n" +
|
||||
"\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task2\xfc\x03\n" +
|
||||
"\x0fDispatchService\x12S\n" +
|
||||
"\x0eListDispatches\x12\x1f.state.v1.ListDispatchesRequest\x1a .state.v1.ListDispatchesResponse\x12S\n" +
|
||||
"\x0eRecordDispatch\x12\x1f.state.v1.RecordDispatchRequest\x1a .state.v1.RecordDispatchResponse\x12k\n" +
|
||||
"\x16RecordPlaybookDispatch\x12'.state.v1.RecordPlaybookDispatchRequest\x1a(.state.v1.RecordPlaybookDispatchResponse\x12q\n" +
|
||||
"\x18DeletePlaybookDispatches\x12).state.v1.DeletePlaybookDispatchesRequest\x1a*.state.v1.DeletePlaybookDispatchesResponse\x12_\n" +
|
||||
"\x12EnqueueBindingTask\x12#.state.v1.EnqueueBindingTaskRequest\x1a$.state.v1.EnqueueBindingTaskResponseB\xa7\x01\n" +
|
||||
"\fcom.state.v1B\rDispatchProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_dispatch_proto_rawDescOnce sync.Once
|
||||
file_state_v1_dispatch_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_dispatch_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_dispatch_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_dispatch_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_dispatch_proto_rawDesc), len(file_state_v1_dispatch_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_dispatch_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_dispatch_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_state_v1_dispatch_proto_goTypes = []any{
|
||||
(*RecordDispatchRequest)(nil), // 0: state.v1.RecordDispatchRequest
|
||||
(*RecordDispatchResponse)(nil), // 1: state.v1.RecordDispatchResponse
|
||||
(*ListDispatchesRequest)(nil), // 2: state.v1.ListDispatchesRequest
|
||||
(*Dispatch)(nil), // 3: state.v1.Dispatch
|
||||
(*ListDispatchesResponse)(nil), // 4: state.v1.ListDispatchesResponse
|
||||
(*RecordPlaybookDispatchRequest)(nil), // 5: state.v1.RecordPlaybookDispatchRequest
|
||||
(*RecordPlaybookDispatchResponse)(nil), // 6: state.v1.RecordPlaybookDispatchResponse
|
||||
(*DeletePlaybookDispatchesRequest)(nil), // 7: state.v1.DeletePlaybookDispatchesRequest
|
||||
(*DeletePlaybookDispatchesResponse)(nil), // 8: state.v1.DeletePlaybookDispatchesResponse
|
||||
(*EnqueueBindingTaskRequest)(nil), // 9: state.v1.EnqueueBindingTaskRequest
|
||||
(*EnqueueBindingTaskResponse)(nil), // 10: state.v1.EnqueueBindingTaskResponse
|
||||
(*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp
|
||||
(*Task)(nil), // 12: state.v1.Task
|
||||
}
|
||||
var file_state_v1_dispatch_proto_depIdxs = []int32{
|
||||
11, // 0: state.v1.Dispatch.dispatched_at:type_name -> google.protobuf.Timestamp
|
||||
3, // 1: state.v1.ListDispatchesResponse.dispatches:type_name -> state.v1.Dispatch
|
||||
12, // 2: state.v1.EnqueueBindingTaskResponse.task:type_name -> state.v1.Task
|
||||
2, // 3: state.v1.DispatchService.ListDispatches:input_type -> state.v1.ListDispatchesRequest
|
||||
0, // 4: state.v1.DispatchService.RecordDispatch:input_type -> state.v1.RecordDispatchRequest
|
||||
5, // 5: state.v1.DispatchService.RecordPlaybookDispatch:input_type -> state.v1.RecordPlaybookDispatchRequest
|
||||
7, // 6: state.v1.DispatchService.DeletePlaybookDispatches:input_type -> state.v1.DeletePlaybookDispatchesRequest
|
||||
9, // 7: state.v1.DispatchService.EnqueueBindingTask:input_type -> state.v1.EnqueueBindingTaskRequest
|
||||
4, // 8: state.v1.DispatchService.ListDispatches:output_type -> state.v1.ListDispatchesResponse
|
||||
1, // 9: state.v1.DispatchService.RecordDispatch:output_type -> state.v1.RecordDispatchResponse
|
||||
6, // 10: state.v1.DispatchService.RecordPlaybookDispatch:output_type -> state.v1.RecordPlaybookDispatchResponse
|
||||
8, // 11: state.v1.DispatchService.DeletePlaybookDispatches:output_type -> state.v1.DeletePlaybookDispatchesResponse
|
||||
10, // 12: state.v1.DispatchService.EnqueueBindingTask:output_type -> state.v1.EnqueueBindingTaskResponse
|
||||
8, // [8:13] is the sub-list for method output_type
|
||||
3, // [3:8] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_dispatch_proto_init() }
|
||||
func file_state_v1_dispatch_proto_init() {
|
||||
if File_state_v1_dispatch_proto != nil {
|
||||
return
|
||||
}
|
||||
file_state_v1_types_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_dispatch_proto_rawDesc), len(file_state_v1_dispatch_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_dispatch_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_dispatch_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_dispatch_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_dispatch_proto = out.File
|
||||
file_state_v1_dispatch_proto_goTypes = nil
|
||||
file_state_v1_dispatch_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/dispatch.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 (
|
||||
DispatchService_ListDispatches_FullMethodName = "/state.v1.DispatchService/ListDispatches"
|
||||
DispatchService_RecordDispatch_FullMethodName = "/state.v1.DispatchService/RecordDispatch"
|
||||
DispatchService_RecordPlaybookDispatch_FullMethodName = "/state.v1.DispatchService/RecordPlaybookDispatch"
|
||||
DispatchService_DeletePlaybookDispatches_FullMethodName = "/state.v1.DispatchService/DeletePlaybookDispatches"
|
||||
DispatchService_EnqueueBindingTask_FullMethodName = "/state.v1.DispatchService/EnqueueBindingTask"
|
||||
)
|
||||
|
||||
// DispatchServiceClient is the client API for DispatchService 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 DispatchServiceClient interface {
|
||||
ListDispatches(ctx context.Context, in *ListDispatchesRequest, opts ...grpc.CallOption) (*ListDispatchesResponse, error)
|
||||
RecordDispatch(ctx context.Context, in *RecordDispatchRequest, opts ...grpc.CallOption) (*RecordDispatchResponse, error)
|
||||
// Playbook dispatch ledger (eda-playbook-engine.md gap 2): one durable
|
||||
// at-most-once record per (playbook, version, event, action) for the
|
||||
// side-effecting positions. Administrative, like RecordDispatch: a
|
||||
// task-scoped grant cannot reach either (see TaskGrants).
|
||||
RecordPlaybookDispatch(ctx context.Context, in *RecordPlaybookDispatchRequest, opts ...grpc.CallOption) (*RecordPlaybookDispatchResponse, error)
|
||||
DeletePlaybookDispatches(ctx context.Context, in *DeletePlaybookDispatchesRequest, opts ...grpc.CallOption) (*DeletePlaybookDispatchesResponse, error)
|
||||
// BindingTaskCreator: claims the binding's dispatch of a capture and
|
||||
// enqueues its task in one transaction, so a failure leaves neither and a
|
||||
// replayed delivery is refused with AlreadyExists.
|
||||
EnqueueBindingTask(ctx context.Context, in *EnqueueBindingTaskRequest, opts ...grpc.CallOption) (*EnqueueBindingTaskResponse, error)
|
||||
}
|
||||
|
||||
type dispatchServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDispatchServiceClient(cc grpc.ClientConnInterface) DispatchServiceClient {
|
||||
return &dispatchServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *dispatchServiceClient) ListDispatches(ctx context.Context, in *ListDispatchesRequest, opts ...grpc.CallOption) (*ListDispatchesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListDispatchesResponse)
|
||||
err := c.cc.Invoke(ctx, DispatchService_ListDispatches_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dispatchServiceClient) RecordDispatch(ctx context.Context, in *RecordDispatchRequest, opts ...grpc.CallOption) (*RecordDispatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecordDispatchResponse)
|
||||
err := c.cc.Invoke(ctx, DispatchService_RecordDispatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dispatchServiceClient) RecordPlaybookDispatch(ctx context.Context, in *RecordPlaybookDispatchRequest, opts ...grpc.CallOption) (*RecordPlaybookDispatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecordPlaybookDispatchResponse)
|
||||
err := c.cc.Invoke(ctx, DispatchService_RecordPlaybookDispatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dispatchServiceClient) DeletePlaybookDispatches(ctx context.Context, in *DeletePlaybookDispatchesRequest, opts ...grpc.CallOption) (*DeletePlaybookDispatchesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeletePlaybookDispatchesResponse)
|
||||
err := c.cc.Invoke(ctx, DispatchService_DeletePlaybookDispatches_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *dispatchServiceClient) EnqueueBindingTask(ctx context.Context, in *EnqueueBindingTaskRequest, opts ...grpc.CallOption) (*EnqueueBindingTaskResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(EnqueueBindingTaskResponse)
|
||||
err := c.cc.Invoke(ctx, DispatchService_EnqueueBindingTask_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// DispatchServiceServer is the server API for DispatchService service.
|
||||
// All implementations must embed UnimplementedDispatchServiceServer
|
||||
// for forward compatibility.
|
||||
type DispatchServiceServer interface {
|
||||
ListDispatches(context.Context, *ListDispatchesRequest) (*ListDispatchesResponse, error)
|
||||
RecordDispatch(context.Context, *RecordDispatchRequest) (*RecordDispatchResponse, error)
|
||||
// Playbook dispatch ledger (eda-playbook-engine.md gap 2): one durable
|
||||
// at-most-once record per (playbook, version, event, action) for the
|
||||
// side-effecting positions. Administrative, like RecordDispatch: a
|
||||
// task-scoped grant cannot reach either (see TaskGrants).
|
||||
RecordPlaybookDispatch(context.Context, *RecordPlaybookDispatchRequest) (*RecordPlaybookDispatchResponse, error)
|
||||
DeletePlaybookDispatches(context.Context, *DeletePlaybookDispatchesRequest) (*DeletePlaybookDispatchesResponse, error)
|
||||
// BindingTaskCreator: claims the binding's dispatch of a capture and
|
||||
// enqueues its task in one transaction, so a failure leaves neither and a
|
||||
// replayed delivery is refused with AlreadyExists.
|
||||
EnqueueBindingTask(context.Context, *EnqueueBindingTaskRequest) (*EnqueueBindingTaskResponse, error)
|
||||
mustEmbedUnimplementedDispatchServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedDispatchServiceServer 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 UnimplementedDispatchServiceServer struct{}
|
||||
|
||||
func (UnimplementedDispatchServiceServer) ListDispatches(context.Context, *ListDispatchesRequest) (*ListDispatchesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListDispatches not implemented")
|
||||
}
|
||||
func (UnimplementedDispatchServiceServer) RecordDispatch(context.Context, *RecordDispatchRequest) (*RecordDispatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecordDispatch not implemented")
|
||||
}
|
||||
func (UnimplementedDispatchServiceServer) RecordPlaybookDispatch(context.Context, *RecordPlaybookDispatchRequest) (*RecordPlaybookDispatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecordPlaybookDispatch not implemented")
|
||||
}
|
||||
func (UnimplementedDispatchServiceServer) DeletePlaybookDispatches(context.Context, *DeletePlaybookDispatchesRequest) (*DeletePlaybookDispatchesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeletePlaybookDispatches not implemented")
|
||||
}
|
||||
func (UnimplementedDispatchServiceServer) EnqueueBindingTask(context.Context, *EnqueueBindingTaskRequest) (*EnqueueBindingTaskResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method EnqueueBindingTask not implemented")
|
||||
}
|
||||
func (UnimplementedDispatchServiceServer) mustEmbedUnimplementedDispatchServiceServer() {}
|
||||
func (UnimplementedDispatchServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeDispatchServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DispatchServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDispatchServiceServer interface {
|
||||
mustEmbedUnimplementedDispatchServiceServer()
|
||||
}
|
||||
|
||||
func RegisterDispatchServiceServer(s grpc.ServiceRegistrar, srv DispatchServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedDispatchServiceServer 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(&DispatchService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DispatchService_ListDispatches_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListDispatchesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DispatchServiceServer).ListDispatches(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DispatchService_ListDispatches_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DispatchServiceServer).ListDispatches(ctx, req.(*ListDispatchesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DispatchService_RecordDispatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecordDispatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DispatchServiceServer).RecordDispatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DispatchService_RecordDispatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DispatchServiceServer).RecordDispatch(ctx, req.(*RecordDispatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DispatchService_RecordPlaybookDispatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecordPlaybookDispatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DispatchServiceServer).RecordPlaybookDispatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DispatchService_RecordPlaybookDispatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DispatchServiceServer).RecordPlaybookDispatch(ctx, req.(*RecordPlaybookDispatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DispatchService_DeletePlaybookDispatches_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeletePlaybookDispatchesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DispatchServiceServer).DeletePlaybookDispatches(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DispatchService_DeletePlaybookDispatches_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DispatchServiceServer).DeletePlaybookDispatches(ctx, req.(*DeletePlaybookDispatchesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DispatchService_EnqueueBindingTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EnqueueBindingTaskRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DispatchServiceServer).EnqueueBindingTask(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DispatchService_EnqueueBindingTask_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DispatchServiceServer).EnqueueBindingTask(ctx, req.(*EnqueueBindingTaskRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// DispatchService_ServiceDesc is the grpc.ServiceDesc for DispatchService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DispatchService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.DispatchService",
|
||||
HandlerType: (*DispatchServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListDispatches",
|
||||
Handler: _DispatchService_ListDispatches_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecordDispatch",
|
||||
Handler: _DispatchService_RecordDispatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecordPlaybookDispatch",
|
||||
Handler: _DispatchService_RecordPlaybookDispatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeletePlaybookDispatches",
|
||||
Handler: _DispatchService_DeletePlaybookDispatches_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EnqueueBindingTask",
|
||||
Handler: _DispatchService_EnqueueBindingTask_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/dispatch.proto",
|
||||
}
|
||||
@@ -0,0 +1,702 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/event_type.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// EventTypeHeaderCondition mirrors internal/domain/eventtype.HeaderCondition.
|
||||
type EventTypeHeaderCondition struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EventTypeHeaderCondition) Reset() {
|
||||
*x = EventTypeHeaderCondition{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EventTypeHeaderCondition) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EventTypeHeaderCondition) ProtoMessage() {}
|
||||
|
||||
func (x *EventTypeHeaderCondition) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EventTypeHeaderCondition.ProtoReflect.Descriptor instead.
|
||||
func (*EventTypeHeaderCondition) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *EventTypeHeaderCondition) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EventTypeHeaderCondition) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// EventTypePayloadCondition mirrors internal/domain/eventtype.PayloadCondition.
|
||||
type EventTypePayloadCondition struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
Op string `protobuf:"bytes,2,opt,name=op,proto3" json:"op,omitempty"`
|
||||
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EventTypePayloadCondition) Reset() {
|
||||
*x = EventTypePayloadCondition{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EventTypePayloadCondition) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EventTypePayloadCondition) ProtoMessage() {}
|
||||
|
||||
func (x *EventTypePayloadCondition) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EventTypePayloadCondition.ProtoReflect.Descriptor instead.
|
||||
func (*EventTypePayloadCondition) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *EventTypePayloadCondition) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EventTypePayloadCondition) GetOp() string {
|
||||
if x != nil {
|
||||
return x.Op
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EventTypePayloadCondition) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// EventType mirrors internal/domain/eventtype.EventType. header_conditions and
|
||||
// payload_conditions are its rule; schema maps each payload path to its type.
|
||||
type EventType struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
HeaderConditions []*EventTypeHeaderCondition `protobuf:"bytes,4,rep,name=header_conditions,json=headerConditions,proto3" json:"header_conditions,omitempty"`
|
||||
PayloadConditions []*EventTypePayloadCondition `protobuf:"bytes,5,rep,name=payload_conditions,json=payloadConditions,proto3" json:"payload_conditions,omitempty"`
|
||||
Schema map[string]string `protobuf:"bytes,6,rep,name=schema,proto3" json:"schema,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
// workspace_id is its source's workspace; read-only here.
|
||||
WorkspaceId string `protobuf:"bytes,9,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EventType) Reset() {
|
||||
*x = EventType{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EventType) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EventType) ProtoMessage() {}
|
||||
|
||||
func (x *EventType) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EventType.ProtoReflect.Descriptor instead.
|
||||
func (*EventType) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *EventType) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EventType) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EventType) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EventType) GetHeaderConditions() []*EventTypeHeaderCondition {
|
||||
if x != nil {
|
||||
return x.HeaderConditions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EventType) GetPayloadConditions() []*EventTypePayloadCondition {
|
||||
if x != nil {
|
||||
return x.PayloadConditions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EventType) GetSchema() map[string]string {
|
||||
if x != nil {
|
||||
return x.Schema
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EventType) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EventType) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EventType) GetWorkspaceId() string {
|
||||
if x != nil {
|
||||
return x.WorkspaceId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type InsertEventTypeRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
EventType *EventType `protobuf:"bytes,1,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertEventTypeRequest) Reset() {
|
||||
*x = InsertEventTypeRequest{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertEventTypeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertEventTypeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *InsertEventTypeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertEventTypeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*InsertEventTypeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *InsertEventTypeRequest) GetEventType() *EventType {
|
||||
if x != nil {
|
||||
return x.EventType
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type InsertEventTypeResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertEventTypeResponse) Reset() {
|
||||
*x = InsertEventTypeResponse{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertEventTypeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertEventTypeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *InsertEventTypeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertEventTypeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*InsertEventTypeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *InsertEventTypeResponse) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UpdateEventTypeRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
EventType *EventType `protobuf:"bytes,1,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateEventTypeRequest) Reset() {
|
||||
*x = UpdateEventTypeRequest{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateEventTypeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateEventTypeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateEventTypeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdateEventTypeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateEventTypeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *UpdateEventTypeRequest) GetEventType() *EventType {
|
||||
if x != nil {
|
||||
return x.EventType
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateEventTypeResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateEventTypeResponse) Reset() {
|
||||
*x = UpdateEventTypeResponse{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateEventTypeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateEventTypeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateEventTypeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdateEventTypeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateEventTypeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
type DeleteEventTypeRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteEventTypeRequest) Reset() {
|
||||
*x = DeleteEventTypeRequest{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteEventTypeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteEventTypeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteEventTypeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteEventTypeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteEventTypeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *DeleteEventTypeRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteEventTypeResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteEventTypeResponse) Reset() {
|
||||
*x = DeleteEventTypeResponse{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteEventTypeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteEventTypeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteEventTypeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteEventTypeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteEventTypeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
type ListEventTypesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListEventTypesRequest) Reset() {
|
||||
*x = ListEventTypesRequest{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListEventTypesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListEventTypesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListEventTypesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListEventTypesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListEventTypesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
type ListEventTypesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
EventTypes []*EventType `protobuf:"bytes,1,rep,name=event_types,json=eventTypes,proto3" json:"event_types,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListEventTypesResponse) Reset() {
|
||||
*x = ListEventTypesResponse{}
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListEventTypesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListEventTypesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListEventTypesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_event_type_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListEventTypesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListEventTypesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_event_type_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *ListEventTypesResponse) GetEventTypes() []*EventType {
|
||||
if x != nil {
|
||||
return x.EventTypes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_state_v1_event_type_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_event_type_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x19state/v1/event_type.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"D\n" +
|
||||
"\x18EventTypeHeaderCondition\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value\"U\n" +
|
||||
"\x19EventTypePayloadCondition\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\x12\x0e\n" +
|
||||
"\x02op\x18\x02 \x01(\tR\x02op\x12\x14\n" +
|
||||
"\x05value\x18\x03 \x01(\tR\x05value\"\xf9\x03\n" +
|
||||
"\tEventType\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" +
|
||||
"\x06source\x18\x02 \x01(\tR\x06source\x12\x12\n" +
|
||||
"\x04name\x18\x03 \x01(\tR\x04name\x12O\n" +
|
||||
"\x11header_conditions\x18\x04 \x03(\v2\".state.v1.EventTypeHeaderConditionR\x10headerConditions\x12R\n" +
|
||||
"\x12payload_conditions\x18\x05 \x03(\v2#.state.v1.EventTypePayloadConditionR\x11payloadConditions\x127\n" +
|
||||
"\x06schema\x18\x06 \x03(\v2\x1f.state.v1.EventType.SchemaEntryR\x06schema\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12!\n" +
|
||||
"\fworkspace_id\x18\t \x01(\tR\vworkspaceId\x1a9\n" +
|
||||
"\vSchemaEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"L\n" +
|
||||
"\x16InsertEventTypeRequest\x122\n" +
|
||||
"\n" +
|
||||
"event_type\x18\x01 \x01(\v2\x13.state.v1.EventTypeR\teventType\")\n" +
|
||||
"\x17InsertEventTypeResponse\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"L\n" +
|
||||
"\x16UpdateEventTypeRequest\x122\n" +
|
||||
"\n" +
|
||||
"event_type\x18\x01 \x01(\v2\x13.state.v1.EventTypeR\teventType\"\x19\n" +
|
||||
"\x17UpdateEventTypeResponse\"(\n" +
|
||||
"\x16DeleteEventTypeRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"\x19\n" +
|
||||
"\x17DeleteEventTypeResponse\"\x17\n" +
|
||||
"\x15ListEventTypesRequest\"N\n" +
|
||||
"\x16ListEventTypesResponse\x124\n" +
|
||||
"\vevent_types\x18\x01 \x03(\v2\x13.state.v1.EventTypeR\n" +
|
||||
"eventTypes2\xef\x02\n" +
|
||||
"\x10EventTypeService\x12V\n" +
|
||||
"\x0fInsertEventType\x12 .state.v1.InsertEventTypeRequest\x1a!.state.v1.InsertEventTypeResponse\x12V\n" +
|
||||
"\x0fUpdateEventType\x12 .state.v1.UpdateEventTypeRequest\x1a!.state.v1.UpdateEventTypeResponse\x12V\n" +
|
||||
"\x0fDeleteEventType\x12 .state.v1.DeleteEventTypeRequest\x1a!.state.v1.DeleteEventTypeResponse\x12S\n" +
|
||||
"\x0eListEventTypes\x12\x1f.state.v1.ListEventTypesRequest\x1a .state.v1.ListEventTypesResponseB\xa8\x01\n" +
|
||||
"\fcom.state.v1B\x0eEventTypeProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_event_type_proto_rawDescOnce sync.Once
|
||||
file_state_v1_event_type_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_event_type_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_event_type_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_event_type_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_event_type_proto_rawDesc), len(file_state_v1_event_type_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_event_type_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_event_type_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||
var file_state_v1_event_type_proto_goTypes = []any{
|
||||
(*EventTypeHeaderCondition)(nil), // 0: state.v1.EventTypeHeaderCondition
|
||||
(*EventTypePayloadCondition)(nil), // 1: state.v1.EventTypePayloadCondition
|
||||
(*EventType)(nil), // 2: state.v1.EventType
|
||||
(*InsertEventTypeRequest)(nil), // 3: state.v1.InsertEventTypeRequest
|
||||
(*InsertEventTypeResponse)(nil), // 4: state.v1.InsertEventTypeResponse
|
||||
(*UpdateEventTypeRequest)(nil), // 5: state.v1.UpdateEventTypeRequest
|
||||
(*UpdateEventTypeResponse)(nil), // 6: state.v1.UpdateEventTypeResponse
|
||||
(*DeleteEventTypeRequest)(nil), // 7: state.v1.DeleteEventTypeRequest
|
||||
(*DeleteEventTypeResponse)(nil), // 8: state.v1.DeleteEventTypeResponse
|
||||
(*ListEventTypesRequest)(nil), // 9: state.v1.ListEventTypesRequest
|
||||
(*ListEventTypesResponse)(nil), // 10: state.v1.ListEventTypesResponse
|
||||
nil, // 11: state.v1.EventType.SchemaEntry
|
||||
(*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp
|
||||
}
|
||||
var file_state_v1_event_type_proto_depIdxs = []int32{
|
||||
0, // 0: state.v1.EventType.header_conditions:type_name -> state.v1.EventTypeHeaderCondition
|
||||
1, // 1: state.v1.EventType.payload_conditions:type_name -> state.v1.EventTypePayloadCondition
|
||||
11, // 2: state.v1.EventType.schema:type_name -> state.v1.EventType.SchemaEntry
|
||||
12, // 3: state.v1.EventType.created_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 4: state.v1.EventType.updated_at:type_name -> google.protobuf.Timestamp
|
||||
2, // 5: state.v1.InsertEventTypeRequest.event_type:type_name -> state.v1.EventType
|
||||
2, // 6: state.v1.UpdateEventTypeRequest.event_type:type_name -> state.v1.EventType
|
||||
2, // 7: state.v1.ListEventTypesResponse.event_types:type_name -> state.v1.EventType
|
||||
3, // 8: state.v1.EventTypeService.InsertEventType:input_type -> state.v1.InsertEventTypeRequest
|
||||
5, // 9: state.v1.EventTypeService.UpdateEventType:input_type -> state.v1.UpdateEventTypeRequest
|
||||
7, // 10: state.v1.EventTypeService.DeleteEventType:input_type -> state.v1.DeleteEventTypeRequest
|
||||
9, // 11: state.v1.EventTypeService.ListEventTypes:input_type -> state.v1.ListEventTypesRequest
|
||||
4, // 12: state.v1.EventTypeService.InsertEventType:output_type -> state.v1.InsertEventTypeResponse
|
||||
6, // 13: state.v1.EventTypeService.UpdateEventType:output_type -> state.v1.UpdateEventTypeResponse
|
||||
8, // 14: state.v1.EventTypeService.DeleteEventType:output_type -> state.v1.DeleteEventTypeResponse
|
||||
10, // 15: state.v1.EventTypeService.ListEventTypes:output_type -> state.v1.ListEventTypesResponse
|
||||
12, // [12:16] is the sub-list for method output_type
|
||||
8, // [8:12] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_event_type_proto_init() }
|
||||
func file_state_v1_event_type_proto_init() {
|
||||
if File_state_v1_event_type_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_event_type_proto_rawDesc), len(file_state_v1_event_type_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 12,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_event_type_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_event_type_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_event_type_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_event_type_proto = out.File
|
||||
file_state_v1_event_type_proto_goTypes = nil
|
||||
file_state_v1_event_type_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/event_type.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 (
|
||||
EventTypeService_InsertEventType_FullMethodName = "/state.v1.EventTypeService/InsertEventType"
|
||||
EventTypeService_UpdateEventType_FullMethodName = "/state.v1.EventTypeService/UpdateEventType"
|
||||
EventTypeService_DeleteEventType_FullMethodName = "/state.v1.EventTypeService/DeleteEventType"
|
||||
EventTypeService_ListEventTypes_FullMethodName = "/state.v1.EventTypeService/ListEventTypes"
|
||||
)
|
||||
|
||||
// EventTypeServiceClient is the client API for EventTypeService 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.
|
||||
//
|
||||
// Event types. Insert and Update refuse an overlapping or malformed type.
|
||||
type EventTypeServiceClient interface {
|
||||
InsertEventType(ctx context.Context, in *InsertEventTypeRequest, opts ...grpc.CallOption) (*InsertEventTypeResponse, error)
|
||||
UpdateEventType(ctx context.Context, in *UpdateEventTypeRequest, opts ...grpc.CallOption) (*UpdateEventTypeResponse, error)
|
||||
DeleteEventType(ctx context.Context, in *DeleteEventTypeRequest, opts ...grpc.CallOption) (*DeleteEventTypeResponse, error)
|
||||
ListEventTypes(ctx context.Context, in *ListEventTypesRequest, opts ...grpc.CallOption) (*ListEventTypesResponse, error)
|
||||
}
|
||||
|
||||
type eventTypeServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewEventTypeServiceClient(cc grpc.ClientConnInterface) EventTypeServiceClient {
|
||||
return &eventTypeServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *eventTypeServiceClient) InsertEventType(ctx context.Context, in *InsertEventTypeRequest, opts ...grpc.CallOption) (*InsertEventTypeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InsertEventTypeResponse)
|
||||
err := c.cc.Invoke(ctx, EventTypeService_InsertEventType_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *eventTypeServiceClient) UpdateEventType(ctx context.Context, in *UpdateEventTypeRequest, opts ...grpc.CallOption) (*UpdateEventTypeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateEventTypeResponse)
|
||||
err := c.cc.Invoke(ctx, EventTypeService_UpdateEventType_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *eventTypeServiceClient) DeleteEventType(ctx context.Context, in *DeleteEventTypeRequest, opts ...grpc.CallOption) (*DeleteEventTypeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteEventTypeResponse)
|
||||
err := c.cc.Invoke(ctx, EventTypeService_DeleteEventType_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *eventTypeServiceClient) ListEventTypes(ctx context.Context, in *ListEventTypesRequest, opts ...grpc.CallOption) (*ListEventTypesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListEventTypesResponse)
|
||||
err := c.cc.Invoke(ctx, EventTypeService_ListEventTypes_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// EventTypeServiceServer is the server API for EventTypeService service.
|
||||
// All implementations must embed UnimplementedEventTypeServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Event types. Insert and Update refuse an overlapping or malformed type.
|
||||
type EventTypeServiceServer interface {
|
||||
InsertEventType(context.Context, *InsertEventTypeRequest) (*InsertEventTypeResponse, error)
|
||||
UpdateEventType(context.Context, *UpdateEventTypeRequest) (*UpdateEventTypeResponse, error)
|
||||
DeleteEventType(context.Context, *DeleteEventTypeRequest) (*DeleteEventTypeResponse, error)
|
||||
ListEventTypes(context.Context, *ListEventTypesRequest) (*ListEventTypesResponse, error)
|
||||
mustEmbedUnimplementedEventTypeServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedEventTypeServiceServer 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 UnimplementedEventTypeServiceServer struct{}
|
||||
|
||||
func (UnimplementedEventTypeServiceServer) InsertEventType(context.Context, *InsertEventTypeRequest) (*InsertEventTypeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InsertEventType not implemented")
|
||||
}
|
||||
func (UnimplementedEventTypeServiceServer) UpdateEventType(context.Context, *UpdateEventTypeRequest) (*UpdateEventTypeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateEventType not implemented")
|
||||
}
|
||||
func (UnimplementedEventTypeServiceServer) DeleteEventType(context.Context, *DeleteEventTypeRequest) (*DeleteEventTypeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteEventType not implemented")
|
||||
}
|
||||
func (UnimplementedEventTypeServiceServer) ListEventTypes(context.Context, *ListEventTypesRequest) (*ListEventTypesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListEventTypes not implemented")
|
||||
}
|
||||
func (UnimplementedEventTypeServiceServer) mustEmbedUnimplementedEventTypeServiceServer() {}
|
||||
func (UnimplementedEventTypeServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeEventTypeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to EventTypeServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeEventTypeServiceServer interface {
|
||||
mustEmbedUnimplementedEventTypeServiceServer()
|
||||
}
|
||||
|
||||
func RegisterEventTypeServiceServer(s grpc.ServiceRegistrar, srv EventTypeServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedEventTypeServiceServer 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(&EventTypeService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _EventTypeService_InsertEventType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InsertEventTypeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(EventTypeServiceServer).InsertEventType(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: EventTypeService_InsertEventType_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(EventTypeServiceServer).InsertEventType(ctx, req.(*InsertEventTypeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _EventTypeService_UpdateEventType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateEventTypeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(EventTypeServiceServer).UpdateEventType(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: EventTypeService_UpdateEventType_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(EventTypeServiceServer).UpdateEventType(ctx, req.(*UpdateEventTypeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _EventTypeService_DeleteEventType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteEventTypeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(EventTypeServiceServer).DeleteEventType(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: EventTypeService_DeleteEventType_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(EventTypeServiceServer).DeleteEventType(ctx, req.(*DeleteEventTypeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _EventTypeService_ListEventTypes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListEventTypesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(EventTypeServiceServer).ListEventTypes(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: EventTypeService_ListEventTypes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(EventTypeServiceServer).ListEventTypes(ctx, req.(*ListEventTypesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// EventTypeService_ServiceDesc is the grpc.ServiceDesc for EventTypeService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var EventTypeService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.EventTypeService",
|
||||
HandlerType: (*EventTypeServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "InsertEventType",
|
||||
Handler: _EventTypeService_InsertEventType_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateEventType",
|
||||
Handler: _EventTypeService_UpdateEventType_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteEventType",
|
||||
Handler: _EventTypeService_DeleteEventType_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListEventTypes",
|
||||
Handler: _EventTypeService_ListEventTypes_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/event_type.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,291 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/execution.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 (
|
||||
ExecutionService_StartStep_FullMethodName = "/state.v1.ExecutionService/StartStep"
|
||||
ExecutionService_RecordUsage_FullMethodName = "/state.v1.ExecutionService/RecordUsage"
|
||||
ExecutionService_FinishStep_FullMethodName = "/state.v1.ExecutionService/FinishStep"
|
||||
ExecutionService_CancelExecution_FullMethodName = "/state.v1.ExecutionService/CancelExecution"
|
||||
ExecutionService_ListSteps_FullMethodName = "/state.v1.ExecutionService/ListSteps"
|
||||
)
|
||||
|
||||
// ExecutionServiceClient is the client API for ExecutionService 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 ExecutionServiceClient interface {
|
||||
// Step executions (docs/prds/execution-tree-state-machine.md). The run
|
||||
// credential authorises both on its own execution only.
|
||||
StartStep(ctx context.Context, in *StartStepRequest, opts ...grpc.CallOption) (*StartStepResponse, error)
|
||||
// RecordUsage appends one model call's usage record. A run credential may
|
||||
// record usage only for its own task.
|
||||
RecordUsage(ctx context.Context, in *RecordUsageRequest, opts ...grpc.CallOption) (*RecordUsageResponse, error)
|
||||
FinishStep(ctx context.Context, in *FinishStepRequest, opts ...grpc.CallOption) (*FinishStepResponse, error)
|
||||
// Cancellation. Deliberately administrative (deny-by-default for a
|
||||
// task-scoped grant): a cancel is a dashboard, API and dispatch action
|
||||
// decided by the Authorizer, not a worker call.
|
||||
CancelExecution(ctx context.Context, in *CancelExecutionRequest, opts ...grpc.CallOption) (*CancelExecutionResponse, error)
|
||||
// ListSteps is a dashboard/API/dispatch action (Authorizer: read on the
|
||||
// run), not task-scoped-grant callable like StartStep/FinishStep.
|
||||
ListSteps(ctx context.Context, in *ListStepsRequest, opts ...grpc.CallOption) (*ListStepsResponse, error)
|
||||
}
|
||||
|
||||
type executionServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewExecutionServiceClient(cc grpc.ClientConnInterface) ExecutionServiceClient {
|
||||
return &executionServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *executionServiceClient) StartStep(ctx context.Context, in *StartStepRequest, opts ...grpc.CallOption) (*StartStepResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StartStepResponse)
|
||||
err := c.cc.Invoke(ctx, ExecutionService_StartStep_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *executionServiceClient) RecordUsage(ctx context.Context, in *RecordUsageRequest, opts ...grpc.CallOption) (*RecordUsageResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecordUsageResponse)
|
||||
err := c.cc.Invoke(ctx, ExecutionService_RecordUsage_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *executionServiceClient) FinishStep(ctx context.Context, in *FinishStepRequest, opts ...grpc.CallOption) (*FinishStepResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(FinishStepResponse)
|
||||
err := c.cc.Invoke(ctx, ExecutionService_FinishStep_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *executionServiceClient) CancelExecution(ctx context.Context, in *CancelExecutionRequest, opts ...grpc.CallOption) (*CancelExecutionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CancelExecutionResponse)
|
||||
err := c.cc.Invoke(ctx, ExecutionService_CancelExecution_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *executionServiceClient) ListSteps(ctx context.Context, in *ListStepsRequest, opts ...grpc.CallOption) (*ListStepsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListStepsResponse)
|
||||
err := c.cc.Invoke(ctx, ExecutionService_ListSteps_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ExecutionServiceServer is the server API for ExecutionService service.
|
||||
// All implementations must embed UnimplementedExecutionServiceServer
|
||||
// for forward compatibility.
|
||||
type ExecutionServiceServer interface {
|
||||
// Step executions (docs/prds/execution-tree-state-machine.md). The run
|
||||
// credential authorises both on its own execution only.
|
||||
StartStep(context.Context, *StartStepRequest) (*StartStepResponse, error)
|
||||
// RecordUsage appends one model call's usage record. A run credential may
|
||||
// record usage only for its own task.
|
||||
RecordUsage(context.Context, *RecordUsageRequest) (*RecordUsageResponse, error)
|
||||
FinishStep(context.Context, *FinishStepRequest) (*FinishStepResponse, error)
|
||||
// Cancellation. Deliberately administrative (deny-by-default for a
|
||||
// task-scoped grant): a cancel is a dashboard, API and dispatch action
|
||||
// decided by the Authorizer, not a worker call.
|
||||
CancelExecution(context.Context, *CancelExecutionRequest) (*CancelExecutionResponse, error)
|
||||
// ListSteps is a dashboard/API/dispatch action (Authorizer: read on the
|
||||
// run), not task-scoped-grant callable like StartStep/FinishStep.
|
||||
ListSteps(context.Context, *ListStepsRequest) (*ListStepsResponse, error)
|
||||
mustEmbedUnimplementedExecutionServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedExecutionServiceServer 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 UnimplementedExecutionServiceServer struct{}
|
||||
|
||||
func (UnimplementedExecutionServiceServer) StartStep(context.Context, *StartStepRequest) (*StartStepResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method StartStep not implemented")
|
||||
}
|
||||
func (UnimplementedExecutionServiceServer) RecordUsage(context.Context, *RecordUsageRequest) (*RecordUsageResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecordUsage not implemented")
|
||||
}
|
||||
func (UnimplementedExecutionServiceServer) FinishStep(context.Context, *FinishStepRequest) (*FinishStepResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method FinishStep not implemented")
|
||||
}
|
||||
func (UnimplementedExecutionServiceServer) CancelExecution(context.Context, *CancelExecutionRequest) (*CancelExecutionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CancelExecution not implemented")
|
||||
}
|
||||
func (UnimplementedExecutionServiceServer) ListSteps(context.Context, *ListStepsRequest) (*ListStepsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListSteps not implemented")
|
||||
}
|
||||
func (UnimplementedExecutionServiceServer) mustEmbedUnimplementedExecutionServiceServer() {}
|
||||
func (UnimplementedExecutionServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeExecutionServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ExecutionServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeExecutionServiceServer interface {
|
||||
mustEmbedUnimplementedExecutionServiceServer()
|
||||
}
|
||||
|
||||
func RegisterExecutionServiceServer(s grpc.ServiceRegistrar, srv ExecutionServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedExecutionServiceServer 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(&ExecutionService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ExecutionService_StartStep_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartStepRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExecutionServiceServer).StartStep(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExecutionService_StartStep_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExecutionServiceServer).StartStep(ctx, req.(*StartStepRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExecutionService_RecordUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecordUsageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExecutionServiceServer).RecordUsage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExecutionService_RecordUsage_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExecutionServiceServer).RecordUsage(ctx, req.(*RecordUsageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExecutionService_FinishStep_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FinishStepRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExecutionServiceServer).FinishStep(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExecutionService_FinishStep_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExecutionServiceServer).FinishStep(ctx, req.(*FinishStepRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExecutionService_CancelExecution_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CancelExecutionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExecutionServiceServer).CancelExecution(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExecutionService_CancelExecution_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExecutionServiceServer).CancelExecution(ctx, req.(*CancelExecutionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExecutionService_ListSteps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListStepsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExecutionServiceServer).ListSteps(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExecutionService_ListSteps_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExecutionServiceServer).ListSteps(ctx, req.(*ListStepsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ExecutionService_ServiceDesc is the grpc.ServiceDesc for ExecutionService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ExecutionService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.ExecutionService",
|
||||
HandlerType: (*ExecutionServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StartStep",
|
||||
Handler: _ExecutionService_StartStep_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecordUsage",
|
||||
Handler: _ExecutionService_RecordUsage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FinishStep",
|
||||
Handler: _ExecutionService_FinishStep_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CancelExecution",
|
||||
Handler: _ExecutionService_CancelExecution_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListSteps",
|
||||
Handler: _ExecutionService_ListSteps_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/execution.proto",
|
||||
}
|
||||
@@ -0,0 +1,402 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/harness_secret.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// HarnessSecret mirrors internal/domain/harnesssecret.Secret -- one org's
|
||||
// captured OAuth token set for a credential binding's service
|
||||
// (docs/prds/external-agent-harness.md, Credentials).
|
||||
type HarnessSecret struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
|
||||
AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
|
||||
RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
|
||||
TokenType string `protobuf:"bytes,5,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"`
|
||||
ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
Scopes []string `protobuf:"bytes,8,rep,name=scopes,proto3" json:"scopes,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) Reset() {
|
||||
*x = HarnessSecret{}
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HarnessSecret) ProtoMessage() {}
|
||||
|
||||
func (x *HarnessSecret) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HarnessSecret.ProtoReflect.Descriptor instead.
|
||||
func (*HarnessSecret) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_harness_secret_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) GetService() string {
|
||||
if x != nil {
|
||||
return x.Service
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) GetAccessToken() string {
|
||||
if x != nil {
|
||||
return x.AccessToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) GetRefreshToken() string {
|
||||
if x != nil {
|
||||
return x.RefreshToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) GetTokenType() string {
|
||||
if x != nil {
|
||||
return x.TokenType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) GetExpiresAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.ExpiresAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HarnessSecret) GetScopes() []string {
|
||||
if x != nil {
|
||||
return x.Scopes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetHarnessSecretRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
|
||||
RunCredential string `protobuf:"bytes,3,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretRequest) Reset() {
|
||||
*x = GetHarnessSecretRequest{}
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetHarnessSecretRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetHarnessSecretRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetHarnessSecretRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetHarnessSecretRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_harness_secret_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretRequest) GetService() string {
|
||||
if x != nil {
|
||||
return x.Service
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretRequest) GetRunCredential() string {
|
||||
if x != nil {
|
||||
return x.RunCredential
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetHarnessSecretResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Secret *HarnessSecret `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
|
||||
Org string `protobuf:"bytes,2,opt,name=org,proto3" json:"org,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretResponse) Reset() {
|
||||
*x = GetHarnessSecretResponse{}
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetHarnessSecretResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetHarnessSecretResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetHarnessSecretResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetHarnessSecretResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_harness_secret_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretResponse) GetSecret() *HarnessSecret {
|
||||
if x != nil {
|
||||
return x.Secret
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetHarnessSecretResponse) GetOrg() string {
|
||||
if x != nil {
|
||||
return x.Org
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type PutHarnessSecretRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Secret *HarnessSecret `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
|
||||
RunCredential string `protobuf:"bytes,2,opt,name=run_credential,json=runCredential,proto3" json:"run_credential,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *PutHarnessSecretRequest) Reset() {
|
||||
*x = PutHarnessSecretRequest{}
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *PutHarnessSecretRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PutHarnessSecretRequest) ProtoMessage() {}
|
||||
|
||||
func (x *PutHarnessSecretRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PutHarnessSecretRequest.ProtoReflect.Descriptor instead.
|
||||
func (*PutHarnessSecretRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_harness_secret_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *PutHarnessSecretRequest) GetSecret() *HarnessSecret {
|
||||
if x != nil {
|
||||
return x.Secret
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PutHarnessSecretRequest) GetRunCredential() string {
|
||||
if x != nil {
|
||||
return x.RunCredential
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type PutHarnessSecretResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *PutHarnessSecretResponse) Reset() {
|
||||
*x = PutHarnessSecretResponse{}
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *PutHarnessSecretResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PutHarnessSecretResponse) ProtoMessage() {}
|
||||
|
||||
func (x *PutHarnessSecretResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_harness_secret_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PutHarnessSecretResponse.ProtoReflect.Descriptor instead.
|
||||
func (*PutHarnessSecretResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_harness_secret_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
var File_state_v1_harness_secret_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_harness_secret_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x1dstate/v1/harness_secret.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\x02\n" +
|
||||
"\rHarnessSecret\x12\x18\n" +
|
||||
"\aservice\x18\x02 \x01(\tR\aservice\x12!\n" +
|
||||
"\faccess_token\x18\x03 \x01(\tR\vaccessToken\x12#\n" +
|
||||
"\rrefresh_token\x18\x04 \x01(\tR\frefreshToken\x12\x1d\n" +
|
||||
"\n" +
|
||||
"token_type\x18\x05 \x01(\tR\ttokenType\x129\n" +
|
||||
"\n" +
|
||||
"expires_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x16\n" +
|
||||
"\x06scopes\x18\b \x03(\tR\x06scopesJ\x04\b\x01\x10\x02R\x03org\"e\n" +
|
||||
"\x17GetHarnessSecretRequest\x12\x18\n" +
|
||||
"\aservice\x18\x02 \x01(\tR\aservice\x12%\n" +
|
||||
"\x0erun_credential\x18\x03 \x01(\tR\rrunCredentialJ\x04\b\x01\x10\x02R\x03org\"]\n" +
|
||||
"\x18GetHarnessSecretResponse\x12/\n" +
|
||||
"\x06secret\x18\x01 \x01(\v2\x17.state.v1.HarnessSecretR\x06secret\x12\x10\n" +
|
||||
"\x03org\x18\x02 \x01(\tR\x03org\"q\n" +
|
||||
"\x17PutHarnessSecretRequest\x12/\n" +
|
||||
"\x06secret\x18\x01 \x01(\v2\x17.state.v1.HarnessSecretR\x06secret\x12%\n" +
|
||||
"\x0erun_credential\x18\x02 \x01(\tR\rrunCredential\"\x1a\n" +
|
||||
"\x18PutHarnessSecretResponse2\xcc\x01\n" +
|
||||
"\x14HarnessSecretService\x12Y\n" +
|
||||
"\x10GetHarnessSecret\x12!.state.v1.GetHarnessSecretRequest\x1a\".state.v1.GetHarnessSecretResponse\x12Y\n" +
|
||||
"\x10PutHarnessSecret\x12!.state.v1.PutHarnessSecretRequest\x1a\".state.v1.PutHarnessSecretResponseB\xac\x01\n" +
|
||||
"\fcom.state.v1B\x12HarnessSecretProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_harness_secret_proto_rawDescOnce sync.Once
|
||||
file_state_v1_harness_secret_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_harness_secret_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_harness_secret_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_harness_secret_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_harness_secret_proto_rawDesc), len(file_state_v1_harness_secret_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_harness_secret_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_harness_secret_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_state_v1_harness_secret_proto_goTypes = []any{
|
||||
(*HarnessSecret)(nil), // 0: state.v1.HarnessSecret
|
||||
(*GetHarnessSecretRequest)(nil), // 1: state.v1.GetHarnessSecretRequest
|
||||
(*GetHarnessSecretResponse)(nil), // 2: state.v1.GetHarnessSecretResponse
|
||||
(*PutHarnessSecretRequest)(nil), // 3: state.v1.PutHarnessSecretRequest
|
||||
(*PutHarnessSecretResponse)(nil), // 4: state.v1.PutHarnessSecretResponse
|
||||
(*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp
|
||||
}
|
||||
var file_state_v1_harness_secret_proto_depIdxs = []int32{
|
||||
5, // 0: state.v1.HarnessSecret.expires_at:type_name -> google.protobuf.Timestamp
|
||||
5, // 1: state.v1.HarnessSecret.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 2: state.v1.GetHarnessSecretResponse.secret:type_name -> state.v1.HarnessSecret
|
||||
0, // 3: state.v1.PutHarnessSecretRequest.secret:type_name -> state.v1.HarnessSecret
|
||||
1, // 4: state.v1.HarnessSecretService.GetHarnessSecret:input_type -> state.v1.GetHarnessSecretRequest
|
||||
3, // 5: state.v1.HarnessSecretService.PutHarnessSecret:input_type -> state.v1.PutHarnessSecretRequest
|
||||
2, // 6: state.v1.HarnessSecretService.GetHarnessSecret:output_type -> state.v1.GetHarnessSecretResponse
|
||||
4, // 7: state.v1.HarnessSecretService.PutHarnessSecret:output_type -> state.v1.PutHarnessSecretResponse
|
||||
6, // [6:8] is the sub-list for method output_type
|
||||
4, // [4:6] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_harness_secret_proto_init() }
|
||||
func file_state_v1_harness_secret_proto_init() {
|
||||
if File_state_v1_harness_secret_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_harness_secret_proto_rawDesc), len(file_state_v1_harness_secret_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_harness_secret_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_harness_secret_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_harness_secret_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_harness_secret_proto = out.File
|
||||
file_state_v1_harness_secret_proto_goTypes = nil
|
||||
file_state_v1_harness_secret_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/harness_secret.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 (
|
||||
HarnessSecretService_GetHarnessSecret_FullMethodName = "/state.v1.HarnessSecretService/GetHarnessSecret"
|
||||
HarnessSecretService_PutHarnessSecret_FullMethodName = "/state.v1.HarnessSecretService/PutHarnessSecret"
|
||||
)
|
||||
|
||||
// HarnessSecretServiceClient is the client API for HarnessSecretService 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.
|
||||
//
|
||||
// Harness OAuth secrets (docs/prds/external-agent-harness.md,
|
||||
// Credentials). Administrative: the setup terminal (an `update` action on
|
||||
// the secret, Authorizer-gated) and the egress proxy's token-endpoint
|
||||
// interception (acting as the daemon, not a worker) are the only callers.
|
||||
type HarnessSecretServiceClient interface {
|
||||
GetHarnessSecret(ctx context.Context, in *GetHarnessSecretRequest, opts ...grpc.CallOption) (*GetHarnessSecretResponse, error)
|
||||
PutHarnessSecret(ctx context.Context, in *PutHarnessSecretRequest, opts ...grpc.CallOption) (*PutHarnessSecretResponse, error)
|
||||
}
|
||||
|
||||
type harnessSecretServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewHarnessSecretServiceClient(cc grpc.ClientConnInterface) HarnessSecretServiceClient {
|
||||
return &harnessSecretServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *harnessSecretServiceClient) GetHarnessSecret(ctx context.Context, in *GetHarnessSecretRequest, opts ...grpc.CallOption) (*GetHarnessSecretResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetHarnessSecretResponse)
|
||||
err := c.cc.Invoke(ctx, HarnessSecretService_GetHarnessSecret_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *harnessSecretServiceClient) PutHarnessSecret(ctx context.Context, in *PutHarnessSecretRequest, opts ...grpc.CallOption) (*PutHarnessSecretResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PutHarnessSecretResponse)
|
||||
err := c.cc.Invoke(ctx, HarnessSecretService_PutHarnessSecret_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// HarnessSecretServiceServer is the server API for HarnessSecretService service.
|
||||
// All implementations must embed UnimplementedHarnessSecretServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Harness OAuth secrets (docs/prds/external-agent-harness.md,
|
||||
// Credentials). Administrative: the setup terminal (an `update` action on
|
||||
// the secret, Authorizer-gated) and the egress proxy's token-endpoint
|
||||
// interception (acting as the daemon, not a worker) are the only callers.
|
||||
type HarnessSecretServiceServer interface {
|
||||
GetHarnessSecret(context.Context, *GetHarnessSecretRequest) (*GetHarnessSecretResponse, error)
|
||||
PutHarnessSecret(context.Context, *PutHarnessSecretRequest) (*PutHarnessSecretResponse, error)
|
||||
mustEmbedUnimplementedHarnessSecretServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedHarnessSecretServiceServer 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 UnimplementedHarnessSecretServiceServer struct{}
|
||||
|
||||
func (UnimplementedHarnessSecretServiceServer) GetHarnessSecret(context.Context, *GetHarnessSecretRequest) (*GetHarnessSecretResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetHarnessSecret not implemented")
|
||||
}
|
||||
func (UnimplementedHarnessSecretServiceServer) PutHarnessSecret(context.Context, *PutHarnessSecretRequest) (*PutHarnessSecretResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PutHarnessSecret not implemented")
|
||||
}
|
||||
func (UnimplementedHarnessSecretServiceServer) mustEmbedUnimplementedHarnessSecretServiceServer() {}
|
||||
func (UnimplementedHarnessSecretServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeHarnessSecretServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to HarnessSecretServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeHarnessSecretServiceServer interface {
|
||||
mustEmbedUnimplementedHarnessSecretServiceServer()
|
||||
}
|
||||
|
||||
func RegisterHarnessSecretServiceServer(s grpc.ServiceRegistrar, srv HarnessSecretServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedHarnessSecretServiceServer 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(&HarnessSecretService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _HarnessSecretService_GetHarnessSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHarnessSecretRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HarnessSecretServiceServer).GetHarnessSecret(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HarnessSecretService_GetHarnessSecret_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HarnessSecretServiceServer).GetHarnessSecret(ctx, req.(*GetHarnessSecretRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HarnessSecretService_PutHarnessSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PutHarnessSecretRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HarnessSecretServiceServer).PutHarnessSecret(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HarnessSecretService_PutHarnessSecret_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HarnessSecretServiceServer).PutHarnessSecret(ctx, req.(*PutHarnessSecretRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// HarnessSecretService_ServiceDesc is the grpc.ServiceDesc for HarnessSecretService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var HarnessSecretService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.HarnessSecretService",
|
||||
HandlerType: (*HarnessSecretServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetHarnessSecret",
|
||||
Handler: _HarnessSecretService_GetHarnessSecret_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PutHarnessSecret",
|
||||
Handler: _HarnessSecretService_PutHarnessSecret_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/harness_secret.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,473 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/identity.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 (
|
||||
IdentityService_ListIdentities_FullMethodName = "/state.v1.IdentityService/ListIdentities"
|
||||
IdentityService_GetIdentity_FullMethodName = "/state.v1.IdentityService/GetIdentity"
|
||||
IdentityService_CreateIdentity_FullMethodName = "/state.v1.IdentityService/CreateIdentity"
|
||||
IdentityService_RenameIdentity_FullMethodName = "/state.v1.IdentityService/RenameIdentity"
|
||||
IdentityService_SuspendIdentity_FullMethodName = "/state.v1.IdentityService/SuspendIdentity"
|
||||
IdentityService_ReactivateIdentity_FullMethodName = "/state.v1.IdentityService/ReactivateIdentity"
|
||||
IdentityService_RetireIdentity_FullMethodName = "/state.v1.IdentityService/RetireIdentity"
|
||||
IdentityService_ResolveIdentitySubject_FullMethodName = "/state.v1.IdentityService/ResolveIdentitySubject"
|
||||
IdentityService_BindIdentitySubject_FullMethodName = "/state.v1.IdentityService/BindIdentitySubject"
|
||||
IdentityService_ClaimIdentitySubject_FullMethodName = "/state.v1.IdentityService/ClaimIdentitySubject"
|
||||
)
|
||||
|
||||
// IdentityServiceClient is the client API for IdentityService 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.
|
||||
//
|
||||
// Task-scoped grants cannot call these administrative RPCs.
|
||||
type IdentityServiceClient interface {
|
||||
ListIdentities(ctx context.Context, in *ListIdentitiesRequest, opts ...grpc.CallOption) (*ListIdentitiesResponse, error)
|
||||
GetIdentity(ctx context.Context, in *GetIdentityRequest, opts ...grpc.CallOption) (*GetIdentityResponse, error)
|
||||
CreateIdentity(ctx context.Context, in *CreateIdentityRequest, opts ...grpc.CallOption) (*CreateIdentityResponse, error)
|
||||
RenameIdentity(ctx context.Context, in *RenameIdentityRequest, opts ...grpc.CallOption) (*RenameIdentityResponse, error)
|
||||
SuspendIdentity(ctx context.Context, in *SuspendIdentityRequest, opts ...grpc.CallOption) (*SuspendIdentityResponse, error)
|
||||
ReactivateIdentity(ctx context.Context, in *ReactivateIdentityRequest, opts ...grpc.CallOption) (*ReactivateIdentityResponse, error)
|
||||
RetireIdentity(ctx context.Context, in *RetireIdentityRequest, opts ...grpc.CallOption) (*RetireIdentityResponse, error)
|
||||
// Subject bindings. A verified provider subject is resolved to the identity it
|
||||
// is bound to; the authenticating process calls these rather than owning the
|
||||
// identity store.
|
||||
ResolveIdentitySubject(ctx context.Context, in *ResolveIdentitySubjectRequest, opts ...grpc.CallOption) (*ResolveIdentitySubjectResponse, error)
|
||||
BindIdentitySubject(ctx context.Context, in *BindIdentitySubjectRequest, opts ...grpc.CallOption) (*BindIdentitySubjectResponse, error)
|
||||
ClaimIdentitySubject(ctx context.Context, in *ClaimIdentitySubjectRequest, opts ...grpc.CallOption) (*ClaimIdentitySubjectResponse, error)
|
||||
}
|
||||
|
||||
type identityServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewIdentityServiceClient(cc grpc.ClientConnInterface) IdentityServiceClient {
|
||||
return &identityServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) ListIdentities(ctx context.Context, in *ListIdentitiesRequest, opts ...grpc.CallOption) (*ListIdentitiesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListIdentitiesResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_ListIdentities_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) GetIdentity(ctx context.Context, in *GetIdentityRequest, opts ...grpc.CallOption) (*GetIdentityResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetIdentityResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_GetIdentity_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) CreateIdentity(ctx context.Context, in *CreateIdentityRequest, opts ...grpc.CallOption) (*CreateIdentityResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateIdentityResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_CreateIdentity_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) RenameIdentity(ctx context.Context, in *RenameIdentityRequest, opts ...grpc.CallOption) (*RenameIdentityResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RenameIdentityResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_RenameIdentity_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) SuspendIdentity(ctx context.Context, in *SuspendIdentityRequest, opts ...grpc.CallOption) (*SuspendIdentityResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SuspendIdentityResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_SuspendIdentity_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) ReactivateIdentity(ctx context.Context, in *ReactivateIdentityRequest, opts ...grpc.CallOption) (*ReactivateIdentityResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ReactivateIdentityResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_ReactivateIdentity_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) RetireIdentity(ctx context.Context, in *RetireIdentityRequest, opts ...grpc.CallOption) (*RetireIdentityResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RetireIdentityResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_RetireIdentity_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) ResolveIdentitySubject(ctx context.Context, in *ResolveIdentitySubjectRequest, opts ...grpc.CallOption) (*ResolveIdentitySubjectResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ResolveIdentitySubjectResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_ResolveIdentitySubject_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) BindIdentitySubject(ctx context.Context, in *BindIdentitySubjectRequest, opts ...grpc.CallOption) (*BindIdentitySubjectResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BindIdentitySubjectResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_BindIdentitySubject_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *identityServiceClient) ClaimIdentitySubject(ctx context.Context, in *ClaimIdentitySubjectRequest, opts ...grpc.CallOption) (*ClaimIdentitySubjectResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ClaimIdentitySubjectResponse)
|
||||
err := c.cc.Invoke(ctx, IdentityService_ClaimIdentitySubject_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// IdentityServiceServer is the server API for IdentityService service.
|
||||
// All implementations must embed UnimplementedIdentityServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Task-scoped grants cannot call these administrative RPCs.
|
||||
type IdentityServiceServer interface {
|
||||
ListIdentities(context.Context, *ListIdentitiesRequest) (*ListIdentitiesResponse, error)
|
||||
GetIdentity(context.Context, *GetIdentityRequest) (*GetIdentityResponse, error)
|
||||
CreateIdentity(context.Context, *CreateIdentityRequest) (*CreateIdentityResponse, error)
|
||||
RenameIdentity(context.Context, *RenameIdentityRequest) (*RenameIdentityResponse, error)
|
||||
SuspendIdentity(context.Context, *SuspendIdentityRequest) (*SuspendIdentityResponse, error)
|
||||
ReactivateIdentity(context.Context, *ReactivateIdentityRequest) (*ReactivateIdentityResponse, error)
|
||||
RetireIdentity(context.Context, *RetireIdentityRequest) (*RetireIdentityResponse, error)
|
||||
// Subject bindings. A verified provider subject is resolved to the identity it
|
||||
// is bound to; the authenticating process calls these rather than owning the
|
||||
// identity store.
|
||||
ResolveIdentitySubject(context.Context, *ResolveIdentitySubjectRequest) (*ResolveIdentitySubjectResponse, error)
|
||||
BindIdentitySubject(context.Context, *BindIdentitySubjectRequest) (*BindIdentitySubjectResponse, error)
|
||||
ClaimIdentitySubject(context.Context, *ClaimIdentitySubjectRequest) (*ClaimIdentitySubjectResponse, error)
|
||||
mustEmbedUnimplementedIdentityServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedIdentityServiceServer 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 UnimplementedIdentityServiceServer struct{}
|
||||
|
||||
func (UnimplementedIdentityServiceServer) ListIdentities(context.Context, *ListIdentitiesRequest) (*ListIdentitiesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListIdentities not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) GetIdentity(context.Context, *GetIdentityRequest) (*GetIdentityResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetIdentity not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) CreateIdentity(context.Context, *CreateIdentityRequest) (*CreateIdentityResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateIdentity not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) RenameIdentity(context.Context, *RenameIdentityRequest) (*RenameIdentityResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RenameIdentity not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) SuspendIdentity(context.Context, *SuspendIdentityRequest) (*SuspendIdentityResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SuspendIdentity not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) ReactivateIdentity(context.Context, *ReactivateIdentityRequest) (*ReactivateIdentityResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ReactivateIdentity not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) RetireIdentity(context.Context, *RetireIdentityRequest) (*RetireIdentityResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RetireIdentity not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) ResolveIdentitySubject(context.Context, *ResolveIdentitySubjectRequest) (*ResolveIdentitySubjectResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ResolveIdentitySubject not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) BindIdentitySubject(context.Context, *BindIdentitySubjectRequest) (*BindIdentitySubjectResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method BindIdentitySubject not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) ClaimIdentitySubject(context.Context, *ClaimIdentitySubjectRequest) (*ClaimIdentitySubjectResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ClaimIdentitySubject not implemented")
|
||||
}
|
||||
func (UnimplementedIdentityServiceServer) mustEmbedUnimplementedIdentityServiceServer() {}
|
||||
func (UnimplementedIdentityServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeIdentityServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to IdentityServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeIdentityServiceServer interface {
|
||||
mustEmbedUnimplementedIdentityServiceServer()
|
||||
}
|
||||
|
||||
func RegisterIdentityServiceServer(s grpc.ServiceRegistrar, srv IdentityServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedIdentityServiceServer 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(&IdentityService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _IdentityService_ListIdentities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListIdentitiesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).ListIdentities(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_ListIdentities_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).ListIdentities(ctx, req.(*ListIdentitiesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_GetIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).GetIdentity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_GetIdentity_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).GetIdentity(ctx, req.(*GetIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_CreateIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).CreateIdentity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_CreateIdentity_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).CreateIdentity(ctx, req.(*CreateIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_RenameIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RenameIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).RenameIdentity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_RenameIdentity_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).RenameIdentity(ctx, req.(*RenameIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_SuspendIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SuspendIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).SuspendIdentity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_SuspendIdentity_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).SuspendIdentity(ctx, req.(*SuspendIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_ReactivateIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ReactivateIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).ReactivateIdentity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_ReactivateIdentity_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).ReactivateIdentity(ctx, req.(*ReactivateIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_RetireIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RetireIdentityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).RetireIdentity(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_RetireIdentity_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).RetireIdentity(ctx, req.(*RetireIdentityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_ResolveIdentitySubject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ResolveIdentitySubjectRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).ResolveIdentitySubject(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_ResolveIdentitySubject_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).ResolveIdentitySubject(ctx, req.(*ResolveIdentitySubjectRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_BindIdentitySubject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BindIdentitySubjectRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).BindIdentitySubject(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_BindIdentitySubject_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).BindIdentitySubject(ctx, req.(*BindIdentitySubjectRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _IdentityService_ClaimIdentitySubject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ClaimIdentitySubjectRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(IdentityServiceServer).ClaimIdentitySubject(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: IdentityService_ClaimIdentitySubject_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(IdentityServiceServer).ClaimIdentitySubject(ctx, req.(*ClaimIdentitySubjectRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// IdentityService_ServiceDesc is the grpc.ServiceDesc for IdentityService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var IdentityService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.IdentityService",
|
||||
HandlerType: (*IdentityServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListIdentities",
|
||||
Handler: _IdentityService_ListIdentities_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetIdentity",
|
||||
Handler: _IdentityService_GetIdentity_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateIdentity",
|
||||
Handler: _IdentityService_CreateIdentity_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RenameIdentity",
|
||||
Handler: _IdentityService_RenameIdentity_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SuspendIdentity",
|
||||
Handler: _IdentityService_SuspendIdentity_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ReactivateIdentity",
|
||||
Handler: _IdentityService_ReactivateIdentity_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RetireIdentity",
|
||||
Handler: _IdentityService_RetireIdentity_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ResolveIdentitySubject",
|
||||
Handler: _IdentityService_ResolveIdentitySubject_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BindIdentitySubject",
|
||||
Handler: _IdentityService_BindIdentitySubject_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ClaimIdentitySubject",
|
||||
Handler: _IdentityService_ClaimIdentitySubject_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/identity.proto",
|
||||
}
|
||||
@@ -0,0 +1,865 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/mapping.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// MappingField mirrors internal/domain/mapping.Field.
|
||||
type MappingField struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
|
||||
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *MappingField) Reset() {
|
||||
*x = MappingField{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *MappingField) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*MappingField) ProtoMessage() {}
|
||||
|
||||
func (x *MappingField) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MappingField.ProtoReflect.Descriptor instead.
|
||||
func (*MappingField) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *MappingField) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MappingField) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MappingField) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *MappingField) GetRequired() bool {
|
||||
if x != nil {
|
||||
return x.Required
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Mapping mirrors internal/domain/mapping.Mapping.
|
||||
type Mapping struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
SourceHint string `protobuf:"bytes,3,opt,name=source_hint,json=sourceHint,proto3" json:"source_hint,omitempty"`
|
||||
Fields []*MappingField `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
EventTypeId string `protobuf:"bytes,7,opt,name=event_type_id,json=eventTypeId,proto3" json:"event_type_id,omitempty"`
|
||||
// match_count and last_matched_at are read-only: the store counts them.
|
||||
MatchCount int64 `protobuf:"varint,8,opt,name=match_count,json=matchCount,proto3" json:"match_count,omitempty"`
|
||||
LastMatchedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=last_matched_at,json=lastMatchedAt,proto3" json:"last_matched_at,omitempty"`
|
||||
// workspace_id is its event type's workspace; read-only here.
|
||||
WorkspaceId string `protobuf:"bytes,10,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Mapping) Reset() {
|
||||
*x = Mapping{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Mapping) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Mapping) ProtoMessage() {}
|
||||
|
||||
func (x *Mapping) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Mapping.ProtoReflect.Descriptor instead.
|
||||
func (*Mapping) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Mapping) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Mapping) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Mapping) GetSourceHint() string {
|
||||
if x != nil {
|
||||
return x.SourceHint
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Mapping) GetFields() []*MappingField {
|
||||
if x != nil {
|
||||
return x.Fields
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Mapping) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Mapping) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Mapping) GetEventTypeId() string {
|
||||
if x != nil {
|
||||
return x.EventTypeId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Mapping) GetMatchCount() int64 {
|
||||
if x != nil {
|
||||
return x.MatchCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Mapping) GetLastMatchedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.LastMatchedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Mapping) GetWorkspaceId() string {
|
||||
if x != nil {
|
||||
return x.WorkspaceId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type InsertMappingRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Mapping *Mapping `protobuf:"bytes,1,opt,name=mapping,proto3" json:"mapping,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertMappingRequest) Reset() {
|
||||
*x = InsertMappingRequest{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertMappingRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertMappingRequest) ProtoMessage() {}
|
||||
|
||||
func (x *InsertMappingRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertMappingRequest.ProtoReflect.Descriptor instead.
|
||||
func (*InsertMappingRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *InsertMappingRequest) GetMapping() *Mapping {
|
||||
if x != nil {
|
||||
return x.Mapping
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type InsertMappingResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertMappingResponse) Reset() {
|
||||
*x = InsertMappingResponse{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertMappingResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertMappingResponse) ProtoMessage() {}
|
||||
|
||||
func (x *InsertMappingResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertMappingResponse.ProtoReflect.Descriptor instead.
|
||||
func (*InsertMappingResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *InsertMappingResponse) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetMappingRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMappingRequest) Reset() {
|
||||
*x = GetMappingRequest{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMappingRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMappingRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetMappingRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetMappingRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetMappingRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetMappingRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetMappingResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Mapping *Mapping `protobuf:"bytes,1,opt,name=mapping,proto3" json:"mapping,omitempty"`
|
||||
Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMappingResponse) Reset() {
|
||||
*x = GetMappingResponse{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMappingResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMappingResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetMappingResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetMappingResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetMappingResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetMappingResponse) GetMapping() *Mapping {
|
||||
if x != nil {
|
||||
return x.Mapping
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetMappingResponse) GetFound() bool {
|
||||
if x != nil {
|
||||
return x.Found
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ListMappingsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListMappingsRequest) Reset() {
|
||||
*x = ListMappingsRequest{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListMappingsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListMappingsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListMappingsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListMappingsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListMappingsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
type ListMappingsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Mappings []*Mapping `protobuf:"bytes,1,rep,name=mappings,proto3" json:"mappings,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListMappingsResponse) Reset() {
|
||||
*x = ListMappingsResponse{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListMappingsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListMappingsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListMappingsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListMappingsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListMappingsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *ListMappingsResponse) GetMappings() []*Mapping {
|
||||
if x != nil {
|
||||
return x.Mappings
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateMappingRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Mapping *Mapping `protobuf:"bytes,1,opt,name=mapping,proto3" json:"mapping,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateMappingRequest) Reset() {
|
||||
*x = UpdateMappingRequest{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateMappingRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateMappingRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateMappingRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdateMappingRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateMappingRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *UpdateMappingRequest) GetMapping() *Mapping {
|
||||
if x != nil {
|
||||
return x.Mapping
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateMappingResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateMappingResponse) Reset() {
|
||||
*x = UpdateMappingResponse{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateMappingResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateMappingResponse) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateMappingResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdateMappingResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateMappingResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
type DeleteMappingRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteMappingRequest) Reset() {
|
||||
*x = DeleteMappingRequest{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteMappingRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteMappingRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteMappingRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteMappingRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteMappingRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *DeleteMappingRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteMappingResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteMappingResponse) Reset() {
|
||||
*x = DeleteMappingResponse{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteMappingResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteMappingResponse) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteMappingResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[11]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteMappingResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteMappingResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
type RecordMappingMatchRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
MappingId string `protobuf:"bytes,1,opt,name=mapping_id,json=mappingId,proto3" json:"mapping_id,omitempty"`
|
||||
CaptureId string `protobuf:"bytes,2,opt,name=capture_id,json=captureId,proto3" json:"capture_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordMappingMatchRequest) Reset() {
|
||||
*x = RecordMappingMatchRequest{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordMappingMatchRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordMappingMatchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RecordMappingMatchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[12]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordMappingMatchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RecordMappingMatchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *RecordMappingMatchRequest) GetMappingId() string {
|
||||
if x != nil {
|
||||
return x.MappingId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RecordMappingMatchRequest) GetCaptureId() string {
|
||||
if x != nil {
|
||||
return x.CaptureId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RecordMappingMatchResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RecordMappingMatchResponse) Reset() {
|
||||
*x = RecordMappingMatchResponse{}
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RecordMappingMatchResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RecordMappingMatchResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RecordMappingMatchResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_mapping_proto_msgTypes[13]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RecordMappingMatchResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RecordMappingMatchResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_mapping_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
var File_state_v1_mapping_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_mapping_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x16state/v1/mapping.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"f\n" +
|
||||
"\fMappingField\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" +
|
||||
"\x04path\x18\x02 \x01(\tR\x04path\x12\x12\n" +
|
||||
"\x04type\x18\x03 \x01(\tR\x04type\x12\x1a\n" +
|
||||
"\brequired\x18\x04 \x01(\bR\brequired\"\xa0\x03\n" +
|
||||
"\aMapping\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04name\x18\x02 \x01(\tR\x04name\x12\x1f\n" +
|
||||
"\vsource_hint\x18\x03 \x01(\tR\n" +
|
||||
"sourceHint\x12.\n" +
|
||||
"\x06fields\x18\x04 \x03(\v2\x16.state.v1.MappingFieldR\x06fields\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\"\n" +
|
||||
"\revent_type_id\x18\a \x01(\tR\veventTypeId\x12\x1f\n" +
|
||||
"\vmatch_count\x18\b \x01(\x03R\n" +
|
||||
"matchCount\x12B\n" +
|
||||
"\x0flast_matched_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\rlastMatchedAt\x12!\n" +
|
||||
"\fworkspace_id\x18\n" +
|
||||
" \x01(\tR\vworkspaceId\"C\n" +
|
||||
"\x14InsertMappingRequest\x12+\n" +
|
||||
"\amapping\x18\x01 \x01(\v2\x11.state.v1.MappingR\amapping\"'\n" +
|
||||
"\x15InsertMappingResponse\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"#\n" +
|
||||
"\x11GetMappingRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"W\n" +
|
||||
"\x12GetMappingResponse\x12+\n" +
|
||||
"\amapping\x18\x01 \x01(\v2\x11.state.v1.MappingR\amapping\x12\x14\n" +
|
||||
"\x05found\x18\x02 \x01(\bR\x05found\"\x15\n" +
|
||||
"\x13ListMappingsRequest\"E\n" +
|
||||
"\x14ListMappingsResponse\x12-\n" +
|
||||
"\bmappings\x18\x01 \x03(\v2\x11.state.v1.MappingR\bmappings\"C\n" +
|
||||
"\x14UpdateMappingRequest\x12+\n" +
|
||||
"\amapping\x18\x01 \x01(\v2\x11.state.v1.MappingR\amapping\"\x17\n" +
|
||||
"\x15UpdateMappingResponse\"&\n" +
|
||||
"\x14DeleteMappingRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"\x17\n" +
|
||||
"\x15DeleteMappingResponse\"Y\n" +
|
||||
"\x19RecordMappingMatchRequest\x12\x1d\n" +
|
||||
"\n" +
|
||||
"mapping_id\x18\x01 \x01(\tR\tmappingId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"capture_id\x18\x02 \x01(\tR\tcaptureId\"\x1c\n" +
|
||||
"\x1aRecordMappingMatchResponse2\xff\x03\n" +
|
||||
"\x0eMappingService\x12P\n" +
|
||||
"\rInsertMapping\x12\x1e.state.v1.InsertMappingRequest\x1a\x1f.state.v1.InsertMappingResponse\x12G\n" +
|
||||
"\n" +
|
||||
"GetMapping\x12\x1b.state.v1.GetMappingRequest\x1a\x1c.state.v1.GetMappingResponse\x12M\n" +
|
||||
"\fListMappings\x12\x1d.state.v1.ListMappingsRequest\x1a\x1e.state.v1.ListMappingsResponse\x12P\n" +
|
||||
"\rUpdateMapping\x12\x1e.state.v1.UpdateMappingRequest\x1a\x1f.state.v1.UpdateMappingResponse\x12P\n" +
|
||||
"\rDeleteMapping\x12\x1e.state.v1.DeleteMappingRequest\x1a\x1f.state.v1.DeleteMappingResponse\x12_\n" +
|
||||
"\x12RecordMappingMatch\x12#.state.v1.RecordMappingMatchRequest\x1a$.state.v1.RecordMappingMatchResponseB\xa6\x01\n" +
|
||||
"\fcom.state.v1B\fMappingProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_mapping_proto_rawDescOnce sync.Once
|
||||
file_state_v1_mapping_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_mapping_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_mapping_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_mapping_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_mapping_proto_rawDesc), len(file_state_v1_mapping_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_mapping_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_mapping_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
|
||||
var file_state_v1_mapping_proto_goTypes = []any{
|
||||
(*MappingField)(nil), // 0: state.v1.MappingField
|
||||
(*Mapping)(nil), // 1: state.v1.Mapping
|
||||
(*InsertMappingRequest)(nil), // 2: state.v1.InsertMappingRequest
|
||||
(*InsertMappingResponse)(nil), // 3: state.v1.InsertMappingResponse
|
||||
(*GetMappingRequest)(nil), // 4: state.v1.GetMappingRequest
|
||||
(*GetMappingResponse)(nil), // 5: state.v1.GetMappingResponse
|
||||
(*ListMappingsRequest)(nil), // 6: state.v1.ListMappingsRequest
|
||||
(*ListMappingsResponse)(nil), // 7: state.v1.ListMappingsResponse
|
||||
(*UpdateMappingRequest)(nil), // 8: state.v1.UpdateMappingRequest
|
||||
(*UpdateMappingResponse)(nil), // 9: state.v1.UpdateMappingResponse
|
||||
(*DeleteMappingRequest)(nil), // 10: state.v1.DeleteMappingRequest
|
||||
(*DeleteMappingResponse)(nil), // 11: state.v1.DeleteMappingResponse
|
||||
(*RecordMappingMatchRequest)(nil), // 12: state.v1.RecordMappingMatchRequest
|
||||
(*RecordMappingMatchResponse)(nil), // 13: state.v1.RecordMappingMatchResponse
|
||||
(*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp
|
||||
}
|
||||
var file_state_v1_mapping_proto_depIdxs = []int32{
|
||||
0, // 0: state.v1.Mapping.fields:type_name -> state.v1.MappingField
|
||||
14, // 1: state.v1.Mapping.created_at:type_name -> google.protobuf.Timestamp
|
||||
14, // 2: state.v1.Mapping.updated_at:type_name -> google.protobuf.Timestamp
|
||||
14, // 3: state.v1.Mapping.last_matched_at:type_name -> google.protobuf.Timestamp
|
||||
1, // 4: state.v1.InsertMappingRequest.mapping:type_name -> state.v1.Mapping
|
||||
1, // 5: state.v1.GetMappingResponse.mapping:type_name -> state.v1.Mapping
|
||||
1, // 6: state.v1.ListMappingsResponse.mappings:type_name -> state.v1.Mapping
|
||||
1, // 7: state.v1.UpdateMappingRequest.mapping:type_name -> state.v1.Mapping
|
||||
2, // 8: state.v1.MappingService.InsertMapping:input_type -> state.v1.InsertMappingRequest
|
||||
4, // 9: state.v1.MappingService.GetMapping:input_type -> state.v1.GetMappingRequest
|
||||
6, // 10: state.v1.MappingService.ListMappings:input_type -> state.v1.ListMappingsRequest
|
||||
8, // 11: state.v1.MappingService.UpdateMapping:input_type -> state.v1.UpdateMappingRequest
|
||||
10, // 12: state.v1.MappingService.DeleteMapping:input_type -> state.v1.DeleteMappingRequest
|
||||
12, // 13: state.v1.MappingService.RecordMappingMatch:input_type -> state.v1.RecordMappingMatchRequest
|
||||
3, // 14: state.v1.MappingService.InsertMapping:output_type -> state.v1.InsertMappingResponse
|
||||
5, // 15: state.v1.MappingService.GetMapping:output_type -> state.v1.GetMappingResponse
|
||||
7, // 16: state.v1.MappingService.ListMappings:output_type -> state.v1.ListMappingsResponse
|
||||
9, // 17: state.v1.MappingService.UpdateMapping:output_type -> state.v1.UpdateMappingResponse
|
||||
11, // 18: state.v1.MappingService.DeleteMapping:output_type -> state.v1.DeleteMappingResponse
|
||||
13, // 19: state.v1.MappingService.RecordMappingMatch:output_type -> state.v1.RecordMappingMatchResponse
|
||||
14, // [14:20] is the sub-list for method output_type
|
||||
8, // [8:14] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_mapping_proto_init() }
|
||||
func file_state_v1_mapping_proto_init() {
|
||||
if File_state_v1_mapping_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_mapping_proto_rawDesc), len(file_state_v1_mapping_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 14,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_mapping_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_mapping_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_mapping_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_mapping_proto = out.File
|
||||
file_state_v1_mapping_proto_goTypes = nil
|
||||
file_state_v1_mapping_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/mapping.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 (
|
||||
MappingService_InsertMapping_FullMethodName = "/state.v1.MappingService/InsertMapping"
|
||||
MappingService_GetMapping_FullMethodName = "/state.v1.MappingService/GetMapping"
|
||||
MappingService_ListMappings_FullMethodName = "/state.v1.MappingService/ListMappings"
|
||||
MappingService_UpdateMapping_FullMethodName = "/state.v1.MappingService/UpdateMapping"
|
||||
MappingService_DeleteMapping_FullMethodName = "/state.v1.MappingService/DeleteMapping"
|
||||
MappingService_RecordMappingMatch_FullMethodName = "/state.v1.MappingService/RecordMappingMatch"
|
||||
)
|
||||
|
||||
// MappingServiceClient is the client API for MappingService 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 MappingServiceClient interface {
|
||||
InsertMapping(ctx context.Context, in *InsertMappingRequest, opts ...grpc.CallOption) (*InsertMappingResponse, error)
|
||||
GetMapping(ctx context.Context, in *GetMappingRequest, opts ...grpc.CallOption) (*GetMappingResponse, error)
|
||||
ListMappings(ctx context.Context, in *ListMappingsRequest, opts ...grpc.CallOption) (*ListMappingsResponse, error)
|
||||
UpdateMapping(ctx context.Context, in *UpdateMappingRequest, opts ...grpc.CallOption) (*UpdateMappingResponse, error)
|
||||
DeleteMapping(ctx context.Context, in *DeleteMappingRequest, opts ...grpc.CallOption) (*DeleteMappingResponse, error)
|
||||
// RecordMappingMatch counts one event a mapping resolved; the same
|
||||
// (mapping, capture) twice counts once.
|
||||
RecordMappingMatch(ctx context.Context, in *RecordMappingMatchRequest, opts ...grpc.CallOption) (*RecordMappingMatchResponse, error)
|
||||
}
|
||||
|
||||
type mappingServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMappingServiceClient(cc grpc.ClientConnInterface) MappingServiceClient {
|
||||
return &mappingServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *mappingServiceClient) InsertMapping(ctx context.Context, in *InsertMappingRequest, opts ...grpc.CallOption) (*InsertMappingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InsertMappingResponse)
|
||||
err := c.cc.Invoke(ctx, MappingService_InsertMapping_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *mappingServiceClient) GetMapping(ctx context.Context, in *GetMappingRequest, opts ...grpc.CallOption) (*GetMappingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetMappingResponse)
|
||||
err := c.cc.Invoke(ctx, MappingService_GetMapping_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *mappingServiceClient) ListMappings(ctx context.Context, in *ListMappingsRequest, opts ...grpc.CallOption) (*ListMappingsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListMappingsResponse)
|
||||
err := c.cc.Invoke(ctx, MappingService_ListMappings_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *mappingServiceClient) UpdateMapping(ctx context.Context, in *UpdateMappingRequest, opts ...grpc.CallOption) (*UpdateMappingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateMappingResponse)
|
||||
err := c.cc.Invoke(ctx, MappingService_UpdateMapping_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *mappingServiceClient) DeleteMapping(ctx context.Context, in *DeleteMappingRequest, opts ...grpc.CallOption) (*DeleteMappingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteMappingResponse)
|
||||
err := c.cc.Invoke(ctx, MappingService_DeleteMapping_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *mappingServiceClient) RecordMappingMatch(ctx context.Context, in *RecordMappingMatchRequest, opts ...grpc.CallOption) (*RecordMappingMatchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecordMappingMatchResponse)
|
||||
err := c.cc.Invoke(ctx, MappingService_RecordMappingMatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MappingServiceServer is the server API for MappingService service.
|
||||
// All implementations must embed UnimplementedMappingServiceServer
|
||||
// for forward compatibility.
|
||||
type MappingServiceServer interface {
|
||||
InsertMapping(context.Context, *InsertMappingRequest) (*InsertMappingResponse, error)
|
||||
GetMapping(context.Context, *GetMappingRequest) (*GetMappingResponse, error)
|
||||
ListMappings(context.Context, *ListMappingsRequest) (*ListMappingsResponse, error)
|
||||
UpdateMapping(context.Context, *UpdateMappingRequest) (*UpdateMappingResponse, error)
|
||||
DeleteMapping(context.Context, *DeleteMappingRequest) (*DeleteMappingResponse, error)
|
||||
// RecordMappingMatch counts one event a mapping resolved; the same
|
||||
// (mapping, capture) twice counts once.
|
||||
RecordMappingMatch(context.Context, *RecordMappingMatchRequest) (*RecordMappingMatchResponse, error)
|
||||
mustEmbedUnimplementedMappingServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedMappingServiceServer 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 UnimplementedMappingServiceServer struct{}
|
||||
|
||||
func (UnimplementedMappingServiceServer) InsertMapping(context.Context, *InsertMappingRequest) (*InsertMappingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InsertMapping not implemented")
|
||||
}
|
||||
func (UnimplementedMappingServiceServer) GetMapping(context.Context, *GetMappingRequest) (*GetMappingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetMapping not implemented")
|
||||
}
|
||||
func (UnimplementedMappingServiceServer) ListMappings(context.Context, *ListMappingsRequest) (*ListMappingsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListMappings not implemented")
|
||||
}
|
||||
func (UnimplementedMappingServiceServer) UpdateMapping(context.Context, *UpdateMappingRequest) (*UpdateMappingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateMapping not implemented")
|
||||
}
|
||||
func (UnimplementedMappingServiceServer) DeleteMapping(context.Context, *DeleteMappingRequest) (*DeleteMappingResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteMapping not implemented")
|
||||
}
|
||||
func (UnimplementedMappingServiceServer) RecordMappingMatch(context.Context, *RecordMappingMatchRequest) (*RecordMappingMatchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecordMappingMatch not implemented")
|
||||
}
|
||||
func (UnimplementedMappingServiceServer) mustEmbedUnimplementedMappingServiceServer() {}
|
||||
func (UnimplementedMappingServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeMappingServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MappingServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMappingServiceServer interface {
|
||||
mustEmbedUnimplementedMappingServiceServer()
|
||||
}
|
||||
|
||||
func RegisterMappingServiceServer(s grpc.ServiceRegistrar, srv MappingServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedMappingServiceServer 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(&MappingService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _MappingService_InsertMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InsertMappingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MappingServiceServer).InsertMapping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MappingService_InsertMapping_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MappingServiceServer).InsertMapping(ctx, req.(*InsertMappingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MappingService_GetMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetMappingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MappingServiceServer).GetMapping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MappingService_GetMapping_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MappingServiceServer).GetMapping(ctx, req.(*GetMappingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MappingService_ListMappings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMappingsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MappingServiceServer).ListMappings(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MappingService_ListMappings_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MappingServiceServer).ListMappings(ctx, req.(*ListMappingsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MappingService_UpdateMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateMappingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MappingServiceServer).UpdateMapping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MappingService_UpdateMapping_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MappingServiceServer).UpdateMapping(ctx, req.(*UpdateMappingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MappingService_DeleteMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteMappingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MappingServiceServer).DeleteMapping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MappingService_DeleteMapping_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MappingServiceServer).DeleteMapping(ctx, req.(*DeleteMappingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MappingService_RecordMappingMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecordMappingMatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MappingServiceServer).RecordMappingMatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MappingService_RecordMappingMatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MappingServiceServer).RecordMappingMatch(ctx, req.(*RecordMappingMatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// MappingService_ServiceDesc is the grpc.ServiceDesc for MappingService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var MappingService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.MappingService",
|
||||
HandlerType: (*MappingServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "InsertMapping",
|
||||
Handler: _MappingService_InsertMapping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetMapping",
|
||||
Handler: _MappingService_GetMapping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMappings",
|
||||
Handler: _MappingService_ListMappings_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateMapping",
|
||||
Handler: _MappingService_UpdateMapping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteMapping",
|
||||
Handler: _MappingService_DeleteMapping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RecordMappingMatch",
|
||||
Handler: _MappingService_RecordMappingMatch_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/mapping.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,515 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/org.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 (
|
||||
OrgService_CallerModels_FullMethodName = "/state.v1.OrgService/CallerModels"
|
||||
OrgService_ListOrgs_FullMethodName = "/state.v1.OrgService/ListOrgs"
|
||||
OrgService_GetOrg_FullMethodName = "/state.v1.OrgService/GetOrg"
|
||||
OrgService_CreateOrg_FullMethodName = "/state.v1.OrgService/CreateOrg"
|
||||
OrgService_ListWorkspaces_FullMethodName = "/state.v1.OrgService/ListWorkspaces"
|
||||
OrgService_CreateWorkspace_FullMethodName = "/state.v1.OrgService/CreateWorkspace"
|
||||
OrgService_ListMembers_FullMethodName = "/state.v1.OrgService/ListMembers"
|
||||
OrgService_SetMembership_FullMethodName = "/state.v1.OrgService/SetMembership"
|
||||
OrgService_RemoveMembership_FullMethodName = "/state.v1.OrgService/RemoveMembership"
|
||||
OrgService_ListOrgAgents_FullMethodName = "/state.v1.OrgService/ListOrgAgents"
|
||||
OrgService_AssignAgent_FullMethodName = "/state.v1.OrgService/AssignAgent"
|
||||
)
|
||||
|
||||
// OrgServiceClient is the client API for OrgService 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 OrgServiceClient interface {
|
||||
// CallerModels answers the model aliases the caller's org may use. The org
|
||||
// is the calling principal's; a call with none is the system org's.
|
||||
CallerModels(ctx context.Context, in *CallerModelsRequest, opts ...grpc.CallOption) (*CallerModelsResponse, error)
|
||||
// Orgs, workspaces, memberships and agent assignments
|
||||
// (docs/prds/orgs-and-access.md). Every request names an org, but the
|
||||
// State Store acts in the org the caller's principal carries: a request
|
||||
// org that is not the caller's is ignored, so the contract cannot reach
|
||||
// another tenant. Instance-admin widening is a later change.
|
||||
ListOrgs(ctx context.Context, in *ListOrgsRequest, opts ...grpc.CallOption) (*ListOrgsResponse, error)
|
||||
GetOrg(ctx context.Context, in *GetOrgRequest, opts ...grpc.CallOption) (*GetOrgResponse, error)
|
||||
CreateOrg(ctx context.Context, in *CreateOrgRequest, opts ...grpc.CallOption) (*CreateOrgResponse, error)
|
||||
ListWorkspaces(ctx context.Context, in *ListWorkspacesRequest, opts ...grpc.CallOption) (*ListWorkspacesResponse, error)
|
||||
CreateWorkspace(ctx context.Context, in *CreateWorkspaceRequest, opts ...grpc.CallOption) (*CreateWorkspaceResponse, error)
|
||||
ListMembers(ctx context.Context, in *ListMembersRequest, opts ...grpc.CallOption) (*ListMembersResponse, error)
|
||||
SetMembership(ctx context.Context, in *SetMembershipRequest, opts ...grpc.CallOption) (*SetMembershipResponse, error)
|
||||
RemoveMembership(ctx context.Context, in *RemoveMembershipRequest, opts ...grpc.CallOption) (*RemoveMembershipResponse, error)
|
||||
ListOrgAgents(ctx context.Context, in *ListOrgAgentsRequest, opts ...grpc.CallOption) (*ListOrgAgentsResponse, error)
|
||||
AssignAgent(ctx context.Context, in *AssignAgentRequest, opts ...grpc.CallOption) (*AssignAgentResponse, error)
|
||||
}
|
||||
|
||||
type orgServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewOrgServiceClient(cc grpc.ClientConnInterface) OrgServiceClient {
|
||||
return &orgServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) CallerModels(ctx context.Context, in *CallerModelsRequest, opts ...grpc.CallOption) (*CallerModelsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CallerModelsResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_CallerModels_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) ListOrgs(ctx context.Context, in *ListOrgsRequest, opts ...grpc.CallOption) (*ListOrgsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListOrgsResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_ListOrgs_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) GetOrg(ctx context.Context, in *GetOrgRequest, opts ...grpc.CallOption) (*GetOrgResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetOrgResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_GetOrg_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) CreateOrg(ctx context.Context, in *CreateOrgRequest, opts ...grpc.CallOption) (*CreateOrgResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateOrgResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_CreateOrg_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) ListWorkspaces(ctx context.Context, in *ListWorkspacesRequest, opts ...grpc.CallOption) (*ListWorkspacesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListWorkspacesResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_ListWorkspaces_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) CreateWorkspace(ctx context.Context, in *CreateWorkspaceRequest, opts ...grpc.CallOption) (*CreateWorkspaceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateWorkspaceResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_CreateWorkspace_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) ListMembers(ctx context.Context, in *ListMembersRequest, opts ...grpc.CallOption) (*ListMembersResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListMembersResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_ListMembers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) SetMembership(ctx context.Context, in *SetMembershipRequest, opts ...grpc.CallOption) (*SetMembershipResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetMembershipResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_SetMembership_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) RemoveMembership(ctx context.Context, in *RemoveMembershipRequest, opts ...grpc.CallOption) (*RemoveMembershipResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RemoveMembershipResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_RemoveMembership_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) ListOrgAgents(ctx context.Context, in *ListOrgAgentsRequest, opts ...grpc.CallOption) (*ListOrgAgentsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListOrgAgentsResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_ListOrgAgents_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *orgServiceClient) AssignAgent(ctx context.Context, in *AssignAgentRequest, opts ...grpc.CallOption) (*AssignAgentResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AssignAgentResponse)
|
||||
err := c.cc.Invoke(ctx, OrgService_AssignAgent_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// OrgServiceServer is the server API for OrgService service.
|
||||
// All implementations must embed UnimplementedOrgServiceServer
|
||||
// for forward compatibility.
|
||||
type OrgServiceServer interface {
|
||||
// CallerModels answers the model aliases the caller's org may use. The org
|
||||
// is the calling principal's; a call with none is the system org's.
|
||||
CallerModels(context.Context, *CallerModelsRequest) (*CallerModelsResponse, error)
|
||||
// Orgs, workspaces, memberships and agent assignments
|
||||
// (docs/prds/orgs-and-access.md). Every request names an org, but the
|
||||
// State Store acts in the org the caller's principal carries: a request
|
||||
// org that is not the caller's is ignored, so the contract cannot reach
|
||||
// another tenant. Instance-admin widening is a later change.
|
||||
ListOrgs(context.Context, *ListOrgsRequest) (*ListOrgsResponse, error)
|
||||
GetOrg(context.Context, *GetOrgRequest) (*GetOrgResponse, error)
|
||||
CreateOrg(context.Context, *CreateOrgRequest) (*CreateOrgResponse, error)
|
||||
ListWorkspaces(context.Context, *ListWorkspacesRequest) (*ListWorkspacesResponse, error)
|
||||
CreateWorkspace(context.Context, *CreateWorkspaceRequest) (*CreateWorkspaceResponse, error)
|
||||
ListMembers(context.Context, *ListMembersRequest) (*ListMembersResponse, error)
|
||||
SetMembership(context.Context, *SetMembershipRequest) (*SetMembershipResponse, error)
|
||||
RemoveMembership(context.Context, *RemoveMembershipRequest) (*RemoveMembershipResponse, error)
|
||||
ListOrgAgents(context.Context, *ListOrgAgentsRequest) (*ListOrgAgentsResponse, error)
|
||||
AssignAgent(context.Context, *AssignAgentRequest) (*AssignAgentResponse, error)
|
||||
mustEmbedUnimplementedOrgServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedOrgServiceServer 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 UnimplementedOrgServiceServer struct{}
|
||||
|
||||
func (UnimplementedOrgServiceServer) CallerModels(context.Context, *CallerModelsRequest) (*CallerModelsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CallerModels not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) ListOrgs(context.Context, *ListOrgsRequest) (*ListOrgsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListOrgs not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) GetOrg(context.Context, *GetOrgRequest) (*GetOrgResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetOrg not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) CreateOrg(context.Context, *CreateOrgRequest) (*CreateOrgResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateOrg not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) ListWorkspaces(context.Context, *ListWorkspacesRequest) (*ListWorkspacesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListWorkspaces not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) CreateWorkspace(context.Context, *CreateWorkspaceRequest) (*CreateWorkspaceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateWorkspace not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) ListMembers(context.Context, *ListMembersRequest) (*ListMembersResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListMembers not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) SetMembership(context.Context, *SetMembershipRequest) (*SetMembershipResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetMembership not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) RemoveMembership(context.Context, *RemoveMembershipRequest) (*RemoveMembershipResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RemoveMembership not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) ListOrgAgents(context.Context, *ListOrgAgentsRequest) (*ListOrgAgentsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListOrgAgents not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) AssignAgent(context.Context, *AssignAgentRequest) (*AssignAgentResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AssignAgent not implemented")
|
||||
}
|
||||
func (UnimplementedOrgServiceServer) mustEmbedUnimplementedOrgServiceServer() {}
|
||||
func (UnimplementedOrgServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeOrgServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to OrgServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeOrgServiceServer interface {
|
||||
mustEmbedUnimplementedOrgServiceServer()
|
||||
}
|
||||
|
||||
func RegisterOrgServiceServer(s grpc.ServiceRegistrar, srv OrgServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedOrgServiceServer 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(&OrgService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _OrgService_CallerModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CallerModelsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).CallerModels(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_CallerModels_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).CallerModels(ctx, req.(*CallerModelsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_ListOrgs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListOrgsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).ListOrgs(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_ListOrgs_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).ListOrgs(ctx, req.(*ListOrgsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_GetOrg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetOrgRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).GetOrg(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_GetOrg_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).GetOrg(ctx, req.(*GetOrgRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_CreateOrg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateOrgRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).CreateOrg(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_CreateOrg_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).CreateOrg(ctx, req.(*CreateOrgRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_ListWorkspaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListWorkspacesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).ListWorkspaces(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_ListWorkspaces_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).ListWorkspaces(ctx, req.(*ListWorkspacesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_CreateWorkspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateWorkspaceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).CreateWorkspace(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_CreateWorkspace_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).CreateWorkspace(ctx, req.(*CreateWorkspaceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_ListMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMembersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).ListMembers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_ListMembers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).ListMembers(ctx, req.(*ListMembersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_SetMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetMembershipRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).SetMembership(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_SetMembership_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).SetMembership(ctx, req.(*SetMembershipRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_RemoveMembership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RemoveMembershipRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).RemoveMembership(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_RemoveMembership_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).RemoveMembership(ctx, req.(*RemoveMembershipRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_ListOrgAgents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListOrgAgentsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).ListOrgAgents(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_ListOrgAgents_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).ListOrgAgents(ctx, req.(*ListOrgAgentsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _OrgService_AssignAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AssignAgentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OrgServiceServer).AssignAgent(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: OrgService_AssignAgent_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OrgServiceServer).AssignAgent(ctx, req.(*AssignAgentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// OrgService_ServiceDesc is the grpc.ServiceDesc for OrgService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var OrgService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.OrgService",
|
||||
HandlerType: (*OrgServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CallerModels",
|
||||
Handler: _OrgService_CallerModels_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListOrgs",
|
||||
Handler: _OrgService_ListOrgs_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetOrg",
|
||||
Handler: _OrgService_GetOrg_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateOrg",
|
||||
Handler: _OrgService_CreateOrg_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListWorkspaces",
|
||||
Handler: _OrgService_ListWorkspaces_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateWorkspace",
|
||||
Handler: _OrgService_CreateWorkspace_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMembers",
|
||||
Handler: _OrgService_ListMembers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetMembership",
|
||||
Handler: _OrgService_SetMembership_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RemoveMembership",
|
||||
Handler: _OrgService_RemoveMembership_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListOrgAgents",
|
||||
Handler: _OrgService_ListOrgAgents_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AssignAgent",
|
||||
Handler: _OrgService_AssignAgent_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/org.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,527 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/package.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 (
|
||||
PackageService_InstallPackage_FullMethodName = "/state.v1.PackageService/InstallPackage"
|
||||
PackageService_ListCatalogue_FullMethodName = "/state.v1.PackageService/ListCatalogue"
|
||||
PackageService_InstallFromCatalogue_FullMethodName = "/state.v1.PackageService/InstallFromCatalogue"
|
||||
PackageService_GetInstalledPackage_FullMethodName = "/state.v1.PackageService/GetInstalledPackage"
|
||||
PackageService_ListInstalledPackages_FullMethodName = "/state.v1.PackageService/ListInstalledPackages"
|
||||
PackageService_AcceptPackageAuthority_FullMethodName = "/state.v1.PackageService/AcceptPackageAuthority"
|
||||
PackageService_RemoveInstalledPackage_FullMethodName = "/state.v1.PackageService/RemoveInstalledPackage"
|
||||
PackageService_UpdatePackage_FullMethodName = "/state.v1.PackageService/UpdatePackage"
|
||||
PackageService_ApprovePackageUpdate_FullMethodName = "/state.v1.PackageService/ApprovePackageUpdate"
|
||||
PackageService_RollbackPackage_FullMethodName = "/state.v1.PackageService/RollbackPackage"
|
||||
PackageService_SetPackageUpdatePolicy_FullMethodName = "/state.v1.PackageService/SetPackageUpdatePolicy"
|
||||
)
|
||||
|
||||
// PackageServiceClient is the client API for PackageService 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.
|
||||
//
|
||||
// Installed Archie packages. Administrative until org-scoped principals land.
|
||||
type PackageServiceClient interface {
|
||||
InstallPackage(ctx context.Context, in *InstallPackageRequest, opts ...grpc.CallOption) (*InstallPackageResponse, error)
|
||||
// ListCatalogue returns the packages the instance's verified catalogue
|
||||
// offers; InstallFromCatalogue installs one by name at the digest it lists.
|
||||
ListCatalogue(ctx context.Context, in *ListCatalogueRequest, opts ...grpc.CallOption) (*ListCatalogueResponse, error)
|
||||
InstallFromCatalogue(ctx context.Context, in *InstallFromCatalogueRequest, opts ...grpc.CallOption) (*InstallFromCatalogueResponse, error)
|
||||
GetInstalledPackage(ctx context.Context, in *GetInstalledPackageRequest, opts ...grpc.CallOption) (*GetInstalledPackageResponse, error)
|
||||
ListInstalledPackages(ctx context.Context, in *ListInstalledPackagesRequest, opts ...grpc.CallOption) (*ListInstalledPackagesResponse, error)
|
||||
// AcceptPackageAuthority records the operator's accepted authority against
|
||||
// the pinned digest (the approve action; install is the create action).
|
||||
// Administrative until org-scoped principals land.
|
||||
AcceptPackageAuthority(ctx context.Context, in *AcceptPackageAuthorityRequest, opts ...grpc.CallOption) (*AcceptPackageAuthorityResponse, error)
|
||||
RemoveInstalledPackage(ctx context.Context, in *RemoveInstalledPackageRequest, opts ...grpc.CallOption) (*RemoveInstalledPackageResponse, error)
|
||||
// UpdatePackage moves a package to the digest the verified catalogue lists:
|
||||
// a non-widening update applies, a widening one waits as pending.
|
||||
// ApprovePackageUpdate applies the pending update and accepts its authority;
|
||||
// RollbackPackage restores the previous digest and its accepted authority.
|
||||
UpdatePackage(ctx context.Context, in *UpdatePackageRequest, opts ...grpc.CallOption) (*UpdatePackageResponse, error)
|
||||
ApprovePackageUpdate(ctx context.Context, in *ApprovePackageUpdateRequest, opts ...grpc.CallOption) (*ApprovePackageUpdateResponse, error)
|
||||
RollbackPackage(ctx context.Context, in *RollbackPackageRequest, opts ...grpc.CallOption) (*RollbackPackageResponse, error)
|
||||
// SetPackageUpdatePolicy sets "manual" or "auto"; the State Store updates
|
||||
// auto packages on a timer.
|
||||
SetPackageUpdatePolicy(ctx context.Context, in *SetPackageUpdatePolicyRequest, opts ...grpc.CallOption) (*SetPackageUpdatePolicyResponse, error)
|
||||
}
|
||||
|
||||
type packageServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPackageServiceClient(cc grpc.ClientConnInterface) PackageServiceClient {
|
||||
return &packageServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) InstallPackage(ctx context.Context, in *InstallPackageRequest, opts ...grpc.CallOption) (*InstallPackageResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InstallPackageResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_InstallPackage_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) ListCatalogue(ctx context.Context, in *ListCatalogueRequest, opts ...grpc.CallOption) (*ListCatalogueResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListCatalogueResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_ListCatalogue_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) InstallFromCatalogue(ctx context.Context, in *InstallFromCatalogueRequest, opts ...grpc.CallOption) (*InstallFromCatalogueResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InstallFromCatalogueResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_InstallFromCatalogue_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) GetInstalledPackage(ctx context.Context, in *GetInstalledPackageRequest, opts ...grpc.CallOption) (*GetInstalledPackageResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetInstalledPackageResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_GetInstalledPackage_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) ListInstalledPackages(ctx context.Context, in *ListInstalledPackagesRequest, opts ...grpc.CallOption) (*ListInstalledPackagesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListInstalledPackagesResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_ListInstalledPackages_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) AcceptPackageAuthority(ctx context.Context, in *AcceptPackageAuthorityRequest, opts ...grpc.CallOption) (*AcceptPackageAuthorityResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AcceptPackageAuthorityResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_AcceptPackageAuthority_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) RemoveInstalledPackage(ctx context.Context, in *RemoveInstalledPackageRequest, opts ...grpc.CallOption) (*RemoveInstalledPackageResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RemoveInstalledPackageResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_RemoveInstalledPackage_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) UpdatePackage(ctx context.Context, in *UpdatePackageRequest, opts ...grpc.CallOption) (*UpdatePackageResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdatePackageResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_UpdatePackage_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) ApprovePackageUpdate(ctx context.Context, in *ApprovePackageUpdateRequest, opts ...grpc.CallOption) (*ApprovePackageUpdateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ApprovePackageUpdateResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_ApprovePackageUpdate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) RollbackPackage(ctx context.Context, in *RollbackPackageRequest, opts ...grpc.CallOption) (*RollbackPackageResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RollbackPackageResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_RollbackPackage_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *packageServiceClient) SetPackageUpdatePolicy(ctx context.Context, in *SetPackageUpdatePolicyRequest, opts ...grpc.CallOption) (*SetPackageUpdatePolicyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetPackageUpdatePolicyResponse)
|
||||
err := c.cc.Invoke(ctx, PackageService_SetPackageUpdatePolicy_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PackageServiceServer is the server API for PackageService service.
|
||||
// All implementations must embed UnimplementedPackageServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Installed Archie packages. Administrative until org-scoped principals land.
|
||||
type PackageServiceServer interface {
|
||||
InstallPackage(context.Context, *InstallPackageRequest) (*InstallPackageResponse, error)
|
||||
// ListCatalogue returns the packages the instance's verified catalogue
|
||||
// offers; InstallFromCatalogue installs one by name at the digest it lists.
|
||||
ListCatalogue(context.Context, *ListCatalogueRequest) (*ListCatalogueResponse, error)
|
||||
InstallFromCatalogue(context.Context, *InstallFromCatalogueRequest) (*InstallFromCatalogueResponse, error)
|
||||
GetInstalledPackage(context.Context, *GetInstalledPackageRequest) (*GetInstalledPackageResponse, error)
|
||||
ListInstalledPackages(context.Context, *ListInstalledPackagesRequest) (*ListInstalledPackagesResponse, error)
|
||||
// AcceptPackageAuthority records the operator's accepted authority against
|
||||
// the pinned digest (the approve action; install is the create action).
|
||||
// Administrative until org-scoped principals land.
|
||||
AcceptPackageAuthority(context.Context, *AcceptPackageAuthorityRequest) (*AcceptPackageAuthorityResponse, error)
|
||||
RemoveInstalledPackage(context.Context, *RemoveInstalledPackageRequest) (*RemoveInstalledPackageResponse, error)
|
||||
// UpdatePackage moves a package to the digest the verified catalogue lists:
|
||||
// a non-widening update applies, a widening one waits as pending.
|
||||
// ApprovePackageUpdate applies the pending update and accepts its authority;
|
||||
// RollbackPackage restores the previous digest and its accepted authority.
|
||||
UpdatePackage(context.Context, *UpdatePackageRequest) (*UpdatePackageResponse, error)
|
||||
ApprovePackageUpdate(context.Context, *ApprovePackageUpdateRequest) (*ApprovePackageUpdateResponse, error)
|
||||
RollbackPackage(context.Context, *RollbackPackageRequest) (*RollbackPackageResponse, error)
|
||||
// SetPackageUpdatePolicy sets "manual" or "auto"; the State Store updates
|
||||
// auto packages on a timer.
|
||||
SetPackageUpdatePolicy(context.Context, *SetPackageUpdatePolicyRequest) (*SetPackageUpdatePolicyResponse, error)
|
||||
mustEmbedUnimplementedPackageServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedPackageServiceServer 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 UnimplementedPackageServiceServer struct{}
|
||||
|
||||
func (UnimplementedPackageServiceServer) InstallPackage(context.Context, *InstallPackageRequest) (*InstallPackageResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InstallPackage not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) ListCatalogue(context.Context, *ListCatalogueRequest) (*ListCatalogueResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListCatalogue not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) InstallFromCatalogue(context.Context, *InstallFromCatalogueRequest) (*InstallFromCatalogueResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InstallFromCatalogue not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) GetInstalledPackage(context.Context, *GetInstalledPackageRequest) (*GetInstalledPackageResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetInstalledPackage not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) ListInstalledPackages(context.Context, *ListInstalledPackagesRequest) (*ListInstalledPackagesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListInstalledPackages not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) AcceptPackageAuthority(context.Context, *AcceptPackageAuthorityRequest) (*AcceptPackageAuthorityResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AcceptPackageAuthority not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) RemoveInstalledPackage(context.Context, *RemoveInstalledPackageRequest) (*RemoveInstalledPackageResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RemoveInstalledPackage not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) UpdatePackage(context.Context, *UpdatePackageRequest) (*UpdatePackageResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdatePackage not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) ApprovePackageUpdate(context.Context, *ApprovePackageUpdateRequest) (*ApprovePackageUpdateResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ApprovePackageUpdate not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) RollbackPackage(context.Context, *RollbackPackageRequest) (*RollbackPackageResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RollbackPackage not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) SetPackageUpdatePolicy(context.Context, *SetPackageUpdatePolicyRequest) (*SetPackageUpdatePolicyResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPackageUpdatePolicy not implemented")
|
||||
}
|
||||
func (UnimplementedPackageServiceServer) mustEmbedUnimplementedPackageServiceServer() {}
|
||||
func (UnimplementedPackageServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePackageServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PackageServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePackageServiceServer interface {
|
||||
mustEmbedUnimplementedPackageServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPackageServiceServer(s grpc.ServiceRegistrar, srv PackageServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedPackageServiceServer 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(&PackageService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PackageService_InstallPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InstallPackageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).InstallPackage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_InstallPackage_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).InstallPackage(ctx, req.(*InstallPackageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_ListCatalogue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListCatalogueRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).ListCatalogue(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_ListCatalogue_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).ListCatalogue(ctx, req.(*ListCatalogueRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_InstallFromCatalogue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InstallFromCatalogueRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).InstallFromCatalogue(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_InstallFromCatalogue_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).InstallFromCatalogue(ctx, req.(*InstallFromCatalogueRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_GetInstalledPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetInstalledPackageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).GetInstalledPackage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_GetInstalledPackage_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).GetInstalledPackage(ctx, req.(*GetInstalledPackageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_ListInstalledPackages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListInstalledPackagesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).ListInstalledPackages(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_ListInstalledPackages_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).ListInstalledPackages(ctx, req.(*ListInstalledPackagesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_AcceptPackageAuthority_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AcceptPackageAuthorityRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).AcceptPackageAuthority(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_AcceptPackageAuthority_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).AcceptPackageAuthority(ctx, req.(*AcceptPackageAuthorityRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_RemoveInstalledPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RemoveInstalledPackageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).RemoveInstalledPackage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_RemoveInstalledPackage_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).RemoveInstalledPackage(ctx, req.(*RemoveInstalledPackageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_UpdatePackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdatePackageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).UpdatePackage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_UpdatePackage_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).UpdatePackage(ctx, req.(*UpdatePackageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_ApprovePackageUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ApprovePackageUpdateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).ApprovePackageUpdate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_ApprovePackageUpdate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).ApprovePackageUpdate(ctx, req.(*ApprovePackageUpdateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_RollbackPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RollbackPackageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).RollbackPackage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_RollbackPackage_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).RollbackPackage(ctx, req.(*RollbackPackageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PackageService_SetPackageUpdatePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetPackageUpdatePolicyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PackageServiceServer).SetPackageUpdatePolicy(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PackageService_SetPackageUpdatePolicy_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PackageServiceServer).SetPackageUpdatePolicy(ctx, req.(*SetPackageUpdatePolicyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PackageService_ServiceDesc is the grpc.ServiceDesc for PackageService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PackageService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.PackageService",
|
||||
HandlerType: (*PackageServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "InstallPackage",
|
||||
Handler: _PackageService_InstallPackage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListCatalogue",
|
||||
Handler: _PackageService_ListCatalogue_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InstallFromCatalogue",
|
||||
Handler: _PackageService_InstallFromCatalogue_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetInstalledPackage",
|
||||
Handler: _PackageService_GetInstalledPackage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListInstalledPackages",
|
||||
Handler: _PackageService_ListInstalledPackages_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AcceptPackageAuthority",
|
||||
Handler: _PackageService_AcceptPackageAuthority_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RemoveInstalledPackage",
|
||||
Handler: _PackageService_RemoveInstalledPackage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdatePackage",
|
||||
Handler: _PackageService_UpdatePackage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ApprovePackageUpdate",
|
||||
Handler: _PackageService_ApprovePackageUpdate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RollbackPackage",
|
||||
Handler: _PackageService_RollbackPackage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetPackageUpdatePolicy",
|
||||
Handler: _PackageService_SetPackageUpdatePolicy_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/package.proto",
|
||||
}
|
||||
@@ -0,0 +1,511 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/review.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type RespondReviewGateRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
FromStatus string `protobuf:"bytes,2,opt,name=from_status,json=fromStatus,proto3" json:"from_status,omitempty"`
|
||||
// gate is the whole review_gate document the caller computed: the offer
|
||||
// with the answer filled in. The store persists it unread.
|
||||
Gate string `protobuf:"bytes,3,opt,name=gate,proto3" json:"gate,omitempty"`
|
||||
// rereview increments rereview_rounds in the same write; an approve must
|
||||
// pass false and bumps nothing.
|
||||
Rereview bool `protobuf:"varint,4,opt,name=rereview,proto3" json:"rereview,omitempty"`
|
||||
// cap is the domain's re-review bound (prreview.MaxRereviewRounds). It
|
||||
// crosses so the guard is enforced where the row is locked rather than by
|
||||
// the caller's stale read.
|
||||
Cap int64 `protobuf:"varint,5,opt,name=cap,proto3" json:"cap,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateRequest) Reset() {
|
||||
*x = RespondReviewGateRequest{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RespondReviewGateRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RespondReviewGateRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RespondReviewGateRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RespondReviewGateRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateRequest) GetFromStatus() string {
|
||||
if x != nil {
|
||||
return x.FromStatus
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateRequest) GetGate() string {
|
||||
if x != nil {
|
||||
return x.Gate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateRequest) GetRereview() bool {
|
||||
if x != nil {
|
||||
return x.Rereview
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateRequest) GetCap() int64 {
|
||||
if x != nil {
|
||||
return x.Cap
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type RespondReviewGateResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateResponse) Reset() {
|
||||
*x = RespondReviewGateResponse{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RespondReviewGateResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RespondReviewGateResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RespondReviewGateResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RespondReviewGateResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RespondReviewGateResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type BeginRemediationRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *BeginRemediationRequest) Reset() {
|
||||
*x = BeginRemediationRequest{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *BeginRemediationRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BeginRemediationRequest) ProtoMessage() {}
|
||||
|
||||
func (x *BeginRemediationRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BeginRemediationRequest.ProtoReflect.Descriptor instead.
|
||||
func (*BeginRemediationRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *BeginRemediationRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *BeginRemediationRequest) GetPayload() string {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type BeginRemediationResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *BeginRemediationResponse) Reset() {
|
||||
*x = BeginRemediationResponse{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *BeginRemediationResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BeginRemediationResponse) ProtoMessage() {}
|
||||
|
||||
func (x *BeginRemediationResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BeginRemediationResponse.ProtoReflect.Descriptor instead.
|
||||
func (*BeginRemediationResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
// UpdateReviewPayloadRequest merges payload's comments into the unclaimed
|
||||
// review unit with the same review id, active or pending.
|
||||
type UpdateReviewPayloadRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateReviewPayloadRequest) Reset() {
|
||||
*x = UpdateReviewPayloadRequest{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateReviewPayloadRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateReviewPayloadRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateReviewPayloadRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdateReviewPayloadRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateReviewPayloadRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *UpdateReviewPayloadRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *UpdateReviewPayloadRequest) GetPayload() string {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UpdateReviewPayloadResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateReviewPayloadResponse) Reset() {
|
||||
*x = UpdateReviewPayloadResponse{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateReviewPayloadResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateReviewPayloadResponse) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateReviewPayloadResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdateReviewPayloadResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateReviewPayloadResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
type SetReviewCursorsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
ReviewCursor int64 `protobuf:"varint,2,opt,name=review_cursor,json=reviewCursor,proto3" json:"review_cursor,omitempty"`
|
||||
CommentCursor int64 `protobuf:"varint,3,opt,name=comment_cursor,json=commentCursor,proto3" json:"comment_cursor,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetReviewCursorsRequest) Reset() {
|
||||
*x = SetReviewCursorsRequest{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetReviewCursorsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetReviewCursorsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetReviewCursorsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetReviewCursorsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetReviewCursorsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *SetReviewCursorsRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SetReviewCursorsRequest) GetReviewCursor() int64 {
|
||||
if x != nil {
|
||||
return x.ReviewCursor
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SetReviewCursorsRequest) GetCommentCursor() int64 {
|
||||
if x != nil {
|
||||
return x.CommentCursor
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SetReviewCursorsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetReviewCursorsResponse) Reset() {
|
||||
*x = SetReviewCursorsResponse{}
|
||||
mi := &file_state_v1_review_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetReviewCursorsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetReviewCursorsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetReviewCursorsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_review_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetReviewCursorsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetReviewCursorsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_review_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
var File_state_v1_review_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_review_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x15state/v1/review.proto\x12\bstate.v1\"\x96\x01\n" +
|
||||
"\x18RespondReviewGateRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x1f\n" +
|
||||
"\vfrom_status\x18\x02 \x01(\tR\n" +
|
||||
"fromStatus\x12\x12\n" +
|
||||
"\x04gate\x18\x03 \x01(\tR\x04gate\x12\x1a\n" +
|
||||
"\brereview\x18\x04 \x01(\bR\brereview\x12\x10\n" +
|
||||
"\x03cap\x18\x05 \x01(\x03R\x03cap\"\x1b\n" +
|
||||
"\x19RespondReviewGateResponse\"L\n" +
|
||||
"\x17BeginRemediationRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x18\n" +
|
||||
"\apayload\x18\x02 \x01(\tR\apayload\"\x1a\n" +
|
||||
"\x18BeginRemediationResponse\"O\n" +
|
||||
"\x1aUpdateReviewPayloadRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x18\n" +
|
||||
"\apayload\x18\x02 \x01(\tR\apayload\"\x1d\n" +
|
||||
"\x1bUpdateReviewPayloadResponse\"~\n" +
|
||||
"\x17SetReviewCursorsRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12#\n" +
|
||||
"\rreview_cursor\x18\x02 \x01(\x03R\freviewCursor\x12%\n" +
|
||||
"\x0ecomment_cursor\x18\x03 \x01(\x03R\rcommentCursor\"\x1a\n" +
|
||||
"\x18SetReviewCursorsResponse2\x87\x03\n" +
|
||||
"\rReviewService\x12\\\n" +
|
||||
"\x11RespondReviewGate\x12\".state.v1.RespondReviewGateRequest\x1a#.state.v1.RespondReviewGateResponse\x12Y\n" +
|
||||
"\x10BeginRemediation\x12!.state.v1.BeginRemediationRequest\x1a\".state.v1.BeginRemediationResponse\x12b\n" +
|
||||
"\x13UpdateReviewPayload\x12$.state.v1.UpdateReviewPayloadRequest\x1a%.state.v1.UpdateReviewPayloadResponse\x12Y\n" +
|
||||
"\x10SetReviewCursors\x12!.state.v1.SetReviewCursorsRequest\x1a\".state.v1.SetReviewCursorsResponseB\xa5\x01\n" +
|
||||
"\fcom.state.v1B\vReviewProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_review_proto_rawDescOnce sync.Once
|
||||
file_state_v1_review_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_review_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_review_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_review_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_review_proto_rawDesc), len(file_state_v1_review_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_review_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_review_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_state_v1_review_proto_goTypes = []any{
|
||||
(*RespondReviewGateRequest)(nil), // 0: state.v1.RespondReviewGateRequest
|
||||
(*RespondReviewGateResponse)(nil), // 1: state.v1.RespondReviewGateResponse
|
||||
(*BeginRemediationRequest)(nil), // 2: state.v1.BeginRemediationRequest
|
||||
(*BeginRemediationResponse)(nil), // 3: state.v1.BeginRemediationResponse
|
||||
(*UpdateReviewPayloadRequest)(nil), // 4: state.v1.UpdateReviewPayloadRequest
|
||||
(*UpdateReviewPayloadResponse)(nil), // 5: state.v1.UpdateReviewPayloadResponse
|
||||
(*SetReviewCursorsRequest)(nil), // 6: state.v1.SetReviewCursorsRequest
|
||||
(*SetReviewCursorsResponse)(nil), // 7: state.v1.SetReviewCursorsResponse
|
||||
}
|
||||
var file_state_v1_review_proto_depIdxs = []int32{
|
||||
0, // 0: state.v1.ReviewService.RespondReviewGate:input_type -> state.v1.RespondReviewGateRequest
|
||||
2, // 1: state.v1.ReviewService.BeginRemediation:input_type -> state.v1.BeginRemediationRequest
|
||||
4, // 2: state.v1.ReviewService.UpdateReviewPayload:input_type -> state.v1.UpdateReviewPayloadRequest
|
||||
6, // 3: state.v1.ReviewService.SetReviewCursors:input_type -> state.v1.SetReviewCursorsRequest
|
||||
1, // 4: state.v1.ReviewService.RespondReviewGate:output_type -> state.v1.RespondReviewGateResponse
|
||||
3, // 5: state.v1.ReviewService.BeginRemediation:output_type -> state.v1.BeginRemediationResponse
|
||||
5, // 6: state.v1.ReviewService.UpdateReviewPayload:output_type -> state.v1.UpdateReviewPayloadResponse
|
||||
7, // 7: state.v1.ReviewService.SetReviewCursors:output_type -> state.v1.SetReviewCursorsResponse
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_review_proto_init() }
|
||||
func file_state_v1_review_proto_init() {
|
||||
if File_state_v1_review_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_review_proto_rawDesc), len(file_state_v1_review_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 8,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_review_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_review_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_review_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_review_proto = out.File
|
||||
file_state_v1_review_proto_goTypes = nil
|
||||
file_state_v1_review_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/review.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 (
|
||||
ReviewService_RespondReviewGate_FullMethodName = "/state.v1.ReviewService/RespondReviewGate"
|
||||
ReviewService_BeginRemediation_FullMethodName = "/state.v1.ReviewService/BeginRemediation"
|
||||
ReviewService_UpdateReviewPayload_FullMethodName = "/state.v1.ReviewService/UpdateReviewPayload"
|
||||
ReviewService_SetReviewCursors_FullMethodName = "/state.v1.ReviewService/SetReviewCursors"
|
||||
)
|
||||
|
||||
// ReviewServiceClient is the client API for ReviewService 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 ReviewServiceClient interface {
|
||||
// RespondReviewGate is the operator's answer to the review gate
|
||||
// (docs/prds/pr-review-operator-response.md, Decision 2): one guarded
|
||||
// requeue that records the answer, increments rereview_rounds for a
|
||||
// re-review, and refuses a re-review past cap with the ErrRereviewCapReached
|
||||
// wire sentinel. Admin-only, like every other operator surface: a
|
||||
// task-scoped grant never reaches it.
|
||||
RespondReviewGate(ctx context.Context, in *RespondReviewGateRequest, opts ...grpc.CallOption) (*RespondReviewGateResponse, error)
|
||||
BeginRemediation(ctx context.Context, in *BeginRemediationRequest, opts ...grpc.CallOption) (*BeginRemediationResponse, error)
|
||||
UpdateReviewPayload(ctx context.Context, in *UpdateReviewPayloadRequest, opts ...grpc.CallOption) (*UpdateReviewPayloadResponse, error)
|
||||
SetReviewCursors(ctx context.Context, in *SetReviewCursorsRequest, opts ...grpc.CallOption) (*SetReviewCursorsResponse, error)
|
||||
}
|
||||
|
||||
type reviewServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewReviewServiceClient(cc grpc.ClientConnInterface) ReviewServiceClient {
|
||||
return &reviewServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) RespondReviewGate(ctx context.Context, in *RespondReviewGateRequest, opts ...grpc.CallOption) (*RespondReviewGateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RespondReviewGateResponse)
|
||||
err := c.cc.Invoke(ctx, ReviewService_RespondReviewGate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) BeginRemediation(ctx context.Context, in *BeginRemediationRequest, opts ...grpc.CallOption) (*BeginRemediationResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BeginRemediationResponse)
|
||||
err := c.cc.Invoke(ctx, ReviewService_BeginRemediation_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) UpdateReviewPayload(ctx context.Context, in *UpdateReviewPayloadRequest, opts ...grpc.CallOption) (*UpdateReviewPayloadResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateReviewPayloadResponse)
|
||||
err := c.cc.Invoke(ctx, ReviewService_UpdateReviewPayload_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *reviewServiceClient) SetReviewCursors(ctx context.Context, in *SetReviewCursorsRequest, opts ...grpc.CallOption) (*SetReviewCursorsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetReviewCursorsResponse)
|
||||
err := c.cc.Invoke(ctx, ReviewService_SetReviewCursors_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ReviewServiceServer is the server API for ReviewService service.
|
||||
// All implementations must embed UnimplementedReviewServiceServer
|
||||
// for forward compatibility.
|
||||
type ReviewServiceServer interface {
|
||||
// RespondReviewGate is the operator's answer to the review gate
|
||||
// (docs/prds/pr-review-operator-response.md, Decision 2): one guarded
|
||||
// requeue that records the answer, increments rereview_rounds for a
|
||||
// re-review, and refuses a re-review past cap with the ErrRereviewCapReached
|
||||
// wire sentinel. Admin-only, like every other operator surface: a
|
||||
// task-scoped grant never reaches it.
|
||||
RespondReviewGate(context.Context, *RespondReviewGateRequest) (*RespondReviewGateResponse, error)
|
||||
BeginRemediation(context.Context, *BeginRemediationRequest) (*BeginRemediationResponse, error)
|
||||
UpdateReviewPayload(context.Context, *UpdateReviewPayloadRequest) (*UpdateReviewPayloadResponse, error)
|
||||
SetReviewCursors(context.Context, *SetReviewCursorsRequest) (*SetReviewCursorsResponse, error)
|
||||
mustEmbedUnimplementedReviewServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedReviewServiceServer 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 UnimplementedReviewServiceServer struct{}
|
||||
|
||||
func (UnimplementedReviewServiceServer) RespondReviewGate(context.Context, *RespondReviewGateRequest) (*RespondReviewGateResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RespondReviewGate not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) BeginRemediation(context.Context, *BeginRemediationRequest) (*BeginRemediationResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method BeginRemediation not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) UpdateReviewPayload(context.Context, *UpdateReviewPayloadRequest) (*UpdateReviewPayloadResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateReviewPayload not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) SetReviewCursors(context.Context, *SetReviewCursorsRequest) (*SetReviewCursorsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetReviewCursors not implemented")
|
||||
}
|
||||
func (UnimplementedReviewServiceServer) mustEmbedUnimplementedReviewServiceServer() {}
|
||||
func (UnimplementedReviewServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeReviewServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ReviewServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeReviewServiceServer interface {
|
||||
mustEmbedUnimplementedReviewServiceServer()
|
||||
}
|
||||
|
||||
func RegisterReviewServiceServer(s grpc.ServiceRegistrar, srv ReviewServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedReviewServiceServer 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(&ReviewService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ReviewService_RespondReviewGate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RespondReviewGateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).RespondReviewGate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_RespondReviewGate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).RespondReviewGate(ctx, req.(*RespondReviewGateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ReviewService_BeginRemediation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BeginRemediationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).BeginRemediation(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_BeginRemediation_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).BeginRemediation(ctx, req.(*BeginRemediationRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ReviewService_UpdateReviewPayload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateReviewPayloadRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).UpdateReviewPayload(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_UpdateReviewPayload_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).UpdateReviewPayload(ctx, req.(*UpdateReviewPayloadRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ReviewService_SetReviewCursors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetReviewCursorsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ReviewServiceServer).SetReviewCursors(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ReviewService_SetReviewCursors_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ReviewServiceServer).SetReviewCursors(ctx, req.(*SetReviewCursorsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ReviewService_ServiceDesc is the grpc.ServiceDesc for ReviewService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ReviewService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.ReviewService",
|
||||
HandlerType: (*ReviewServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "RespondReviewGate",
|
||||
Handler: _ReviewService_RespondReviewGate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BeginRemediation",
|
||||
Handler: _ReviewService_BeginRemediation_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateReviewPayload",
|
||||
Handler: _ReviewService_UpdateReviewPayload_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetReviewCursors",
|
||||
Handler: _ReviewService_SetReviewCursors_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/review.proto",
|
||||
}
|
||||
@@ -0,0 +1,975 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/source.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Source mirrors internal/domain/source.Source.
|
||||
type Source struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
Signing string `protobuf:"bytes,2,opt,name=signing,proto3" json:"signing,omitempty"`
|
||||
Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
|
||||
DeliveryHeader string `protobuf:"bytes,7,opt,name=delivery_header,json=deliveryHeader,proto3" json:"delivery_header,omitempty"`
|
||||
// org_id is the source's owning org, read-only here. workspace_id is the
|
||||
// org's workspace it is created in, the default one when empty.
|
||||
OrgId string `protobuf:"bytes,8,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
|
||||
WorkspaceId string `protobuf:"bytes,9,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Source) Reset() {
|
||||
*x = Source{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Source) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Source) ProtoMessage() {}
|
||||
|
||||
func (x *Source) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Source.ProtoReflect.Descriptor instead.
|
||||
func (*Source) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Source) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Source) GetSigning() string {
|
||||
if x != nil {
|
||||
return x.Signing
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Source) GetSecret() string {
|
||||
if x != nil {
|
||||
return x.Secret
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Source) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Source) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Source) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Source) GetDeliveryHeader() string {
|
||||
if x != nil {
|
||||
return x.DeliveryHeader
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Source) GetOrgId() string {
|
||||
if x != nil {
|
||||
return x.OrgId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Source) GetWorkspaceId() string {
|
||||
if x != nil {
|
||||
return x.WorkspaceId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SetSourceNameRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceNameRequest) Reset() {
|
||||
*x = SetSourceNameRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceNameRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceNameRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceNameRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceNameRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceNameRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SetSourceNameRequest) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SetSourceNameRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SetSourceNameResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceNameResponse) Reset() {
|
||||
*x = SetSourceNameResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceNameResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceNameResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceNameResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceNameResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceNameResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
type SetSourceDeliveryHeaderRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
Header string `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderRequest) Reset() {
|
||||
*x = SetSourceDeliveryHeaderRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceDeliveryHeaderRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceDeliveryHeaderRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceDeliveryHeaderRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderRequest) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderRequest) GetHeader() string {
|
||||
if x != nil {
|
||||
return x.Header
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SetSourceDeliveryHeaderResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderResponse) Reset() {
|
||||
*x = SetSourceDeliveryHeaderResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceDeliveryHeaderResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceDeliveryHeaderResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceDeliveryHeaderResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceDeliveryHeaderResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
type DeleteSourceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteSourceRequest) Reset() {
|
||||
*x = DeleteSourceRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteSourceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteSourceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteSourceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteSourceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteSourceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *DeleteSourceRequest) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteSourceResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteSourceResponse) Reset() {
|
||||
*x = DeleteSourceResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteSourceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteSourceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteSourceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteSourceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteSourceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
type InsertSourceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Source *Source `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertSourceRequest) Reset() {
|
||||
*x = InsertSourceRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertSourceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertSourceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *InsertSourceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertSourceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*InsertSourceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *InsertSourceRequest) GetSource() *Source {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type InsertSourceResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertSourceResponse) Reset() {
|
||||
*x = InsertSourceResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertSourceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertSourceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *InsertSourceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertSourceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*InsertSourceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
type GetSourceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSourceRequest) Reset() {
|
||||
*x = GetSourceRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSourceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSourceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetSourceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetSourceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetSourceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *GetSourceRequest) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetSourceResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Source *Source `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetSourceResponse) Reset() {
|
||||
*x = GetSourceResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetSourceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetSourceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetSourceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetSourceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetSourceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *GetSourceResponse) GetSource() *Source {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetSourceResponse) GetFound() bool {
|
||||
if x != nil {
|
||||
return x.Found
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ListSourcesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSourcesRequest) Reset() {
|
||||
*x = ListSourcesRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSourcesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSourcesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListSourcesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[11]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSourcesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListSourcesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
type ListSourcesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Sources []*Source `protobuf:"bytes,1,rep,name=sources,proto3" json:"sources,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSourcesResponse) Reset() {
|
||||
*x = ListSourcesResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSourcesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSourcesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListSourcesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[12]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSourcesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListSourcesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *ListSourcesResponse) GetSources() []*Source {
|
||||
if x != nil {
|
||||
return x.Sources
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SetSourceSigningRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
|
||||
To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceSigningRequest) Reset() {
|
||||
*x = SetSourceSigningRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceSigningRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceSigningRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceSigningRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[13]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceSigningRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceSigningRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *SetSourceSigningRequest) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SetSourceSigningRequest) GetFrom() string {
|
||||
if x != nil {
|
||||
return x.From
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SetSourceSigningRequest) GetTo() string {
|
||||
if x != nil {
|
||||
return x.To
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SetSourceSigningResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceSigningResponse) Reset() {
|
||||
*x = SetSourceSigningResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceSigningResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceSigningResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceSigningResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[14]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceSigningResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceSigningResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{14}
|
||||
}
|
||||
|
||||
type SetSourceSecretRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
Secret string `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceSecretRequest) Reset() {
|
||||
*x = SetSourceSecretRequest{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[15]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceSecretRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceSecretRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceSecretRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[15]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceSecretRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceSecretRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{15}
|
||||
}
|
||||
|
||||
func (x *SetSourceSecretRequest) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SetSourceSecretRequest) GetSecret() string {
|
||||
if x != nil {
|
||||
return x.Secret
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SetSourceSecretResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetSourceSecretResponse) Reset() {
|
||||
*x = SetSourceSecretResponse{}
|
||||
mi := &file_state_v1_source_proto_msgTypes[16]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetSourceSecretResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetSourceSecretResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetSourceSecretResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_source_proto_msgTypes[16]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetSourceSecretResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetSourceSecretResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_source_proto_rawDescGZIP(), []int{16}
|
||||
}
|
||||
|
||||
var File_state_v1_source_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_source_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x15state/v1/source.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbb\x02\n" +
|
||||
"\x06Source\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\x12\x18\n" +
|
||||
"\asigning\x18\x02 \x01(\tR\asigning\x12\x16\n" +
|
||||
"\x06secret\x18\x03 \x01(\tR\x06secret\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x12\n" +
|
||||
"\x04name\x18\x06 \x01(\tR\x04name\x12'\n" +
|
||||
"\x0fdelivery_header\x18\a \x01(\tR\x0edeliveryHeader\x12\x15\n" +
|
||||
"\x06org_id\x18\b \x01(\tR\x05orgId\x12!\n" +
|
||||
"\fworkspace_id\x18\t \x01(\tR\vworkspaceId\">\n" +
|
||||
"\x14SetSourceNameRequest\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" +
|
||||
"\x04name\x18\x02 \x01(\tR\x04name\"\x17\n" +
|
||||
"\x15SetSourceNameResponse\"L\n" +
|
||||
"\x1eSetSourceDeliveryHeaderRequest\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\x12\x16\n" +
|
||||
"\x06header\x18\x02 \x01(\tR\x06header\"!\n" +
|
||||
"\x1fSetSourceDeliveryHeaderResponse\")\n" +
|
||||
"\x13DeleteSourceRequest\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\"\x16\n" +
|
||||
"\x14DeleteSourceResponse\"?\n" +
|
||||
"\x13InsertSourceRequest\x12(\n" +
|
||||
"\x06source\x18\x01 \x01(\v2\x10.state.v1.SourceR\x06source\"\x16\n" +
|
||||
"\x14InsertSourceResponse\"&\n" +
|
||||
"\x10GetSourceRequest\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\"S\n" +
|
||||
"\x11GetSourceResponse\x12(\n" +
|
||||
"\x06source\x18\x01 \x01(\v2\x10.state.v1.SourceR\x06source\x12\x14\n" +
|
||||
"\x05found\x18\x02 \x01(\bR\x05found\"\x14\n" +
|
||||
"\x12ListSourcesRequest\"A\n" +
|
||||
"\x13ListSourcesResponse\x12*\n" +
|
||||
"\asources\x18\x01 \x03(\v2\x10.state.v1.SourceR\asources\"Q\n" +
|
||||
"\x17SetSourceSigningRequest\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" +
|
||||
"\x04from\x18\x02 \x01(\tR\x04from\x12\x0e\n" +
|
||||
"\x02to\x18\x03 \x01(\tR\x02to\"\x1a\n" +
|
||||
"\x18SetSourceSigningResponse\"D\n" +
|
||||
"\x16SetSourceSecretRequest\x12\x12\n" +
|
||||
"\x04path\x18\x01 \x01(\tR\x04path\x12\x16\n" +
|
||||
"\x06secret\x18\x02 \x01(\tR\x06secret\"\x19\n" +
|
||||
"\x17SetSourceSecretResponse2\xb4\x05\n" +
|
||||
"\rSourceService\x12M\n" +
|
||||
"\fInsertSource\x12\x1d.state.v1.InsertSourceRequest\x1a\x1e.state.v1.InsertSourceResponse\x12D\n" +
|
||||
"\tGetSource\x12\x1a.state.v1.GetSourceRequest\x1a\x1b.state.v1.GetSourceResponse\x12J\n" +
|
||||
"\vListSources\x12\x1c.state.v1.ListSourcesRequest\x1a\x1d.state.v1.ListSourcesResponse\x12Y\n" +
|
||||
"\x10SetSourceSigning\x12!.state.v1.SetSourceSigningRequest\x1a\".state.v1.SetSourceSigningResponse\x12V\n" +
|
||||
"\x0fSetSourceSecret\x12 .state.v1.SetSourceSecretRequest\x1a!.state.v1.SetSourceSecretResponse\x12P\n" +
|
||||
"\rSetSourceName\x12\x1e.state.v1.SetSourceNameRequest\x1a\x1f.state.v1.SetSourceNameResponse\x12n\n" +
|
||||
"\x17SetSourceDeliveryHeader\x12(.state.v1.SetSourceDeliveryHeaderRequest\x1a).state.v1.SetSourceDeliveryHeaderResponse\x12M\n" +
|
||||
"\fDeleteSource\x12\x1d.state.v1.DeleteSourceRequest\x1a\x1e.state.v1.DeleteSourceResponseB\xa5\x01\n" +
|
||||
"\fcom.state.v1B\vSourceProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_source_proto_rawDescOnce sync.Once
|
||||
file_state_v1_source_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_source_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_source_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_source_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_source_proto_rawDesc), len(file_state_v1_source_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_source_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_source_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
|
||||
var file_state_v1_source_proto_goTypes = []any{
|
||||
(*Source)(nil), // 0: state.v1.Source
|
||||
(*SetSourceNameRequest)(nil), // 1: state.v1.SetSourceNameRequest
|
||||
(*SetSourceNameResponse)(nil), // 2: state.v1.SetSourceNameResponse
|
||||
(*SetSourceDeliveryHeaderRequest)(nil), // 3: state.v1.SetSourceDeliveryHeaderRequest
|
||||
(*SetSourceDeliveryHeaderResponse)(nil), // 4: state.v1.SetSourceDeliveryHeaderResponse
|
||||
(*DeleteSourceRequest)(nil), // 5: state.v1.DeleteSourceRequest
|
||||
(*DeleteSourceResponse)(nil), // 6: state.v1.DeleteSourceResponse
|
||||
(*InsertSourceRequest)(nil), // 7: state.v1.InsertSourceRequest
|
||||
(*InsertSourceResponse)(nil), // 8: state.v1.InsertSourceResponse
|
||||
(*GetSourceRequest)(nil), // 9: state.v1.GetSourceRequest
|
||||
(*GetSourceResponse)(nil), // 10: state.v1.GetSourceResponse
|
||||
(*ListSourcesRequest)(nil), // 11: state.v1.ListSourcesRequest
|
||||
(*ListSourcesResponse)(nil), // 12: state.v1.ListSourcesResponse
|
||||
(*SetSourceSigningRequest)(nil), // 13: state.v1.SetSourceSigningRequest
|
||||
(*SetSourceSigningResponse)(nil), // 14: state.v1.SetSourceSigningResponse
|
||||
(*SetSourceSecretRequest)(nil), // 15: state.v1.SetSourceSecretRequest
|
||||
(*SetSourceSecretResponse)(nil), // 16: state.v1.SetSourceSecretResponse
|
||||
(*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp
|
||||
}
|
||||
var file_state_v1_source_proto_depIdxs = []int32{
|
||||
17, // 0: state.v1.Source.created_at:type_name -> google.protobuf.Timestamp
|
||||
17, // 1: state.v1.Source.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 2: state.v1.InsertSourceRequest.source:type_name -> state.v1.Source
|
||||
0, // 3: state.v1.GetSourceResponse.source:type_name -> state.v1.Source
|
||||
0, // 4: state.v1.ListSourcesResponse.sources:type_name -> state.v1.Source
|
||||
7, // 5: state.v1.SourceService.InsertSource:input_type -> state.v1.InsertSourceRequest
|
||||
9, // 6: state.v1.SourceService.GetSource:input_type -> state.v1.GetSourceRequest
|
||||
11, // 7: state.v1.SourceService.ListSources:input_type -> state.v1.ListSourcesRequest
|
||||
13, // 8: state.v1.SourceService.SetSourceSigning:input_type -> state.v1.SetSourceSigningRequest
|
||||
15, // 9: state.v1.SourceService.SetSourceSecret:input_type -> state.v1.SetSourceSecretRequest
|
||||
1, // 10: state.v1.SourceService.SetSourceName:input_type -> state.v1.SetSourceNameRequest
|
||||
3, // 11: state.v1.SourceService.SetSourceDeliveryHeader:input_type -> state.v1.SetSourceDeliveryHeaderRequest
|
||||
5, // 12: state.v1.SourceService.DeleteSource:input_type -> state.v1.DeleteSourceRequest
|
||||
8, // 13: state.v1.SourceService.InsertSource:output_type -> state.v1.InsertSourceResponse
|
||||
10, // 14: state.v1.SourceService.GetSource:output_type -> state.v1.GetSourceResponse
|
||||
12, // 15: state.v1.SourceService.ListSources:output_type -> state.v1.ListSourcesResponse
|
||||
14, // 16: state.v1.SourceService.SetSourceSigning:output_type -> state.v1.SetSourceSigningResponse
|
||||
16, // 17: state.v1.SourceService.SetSourceSecret:output_type -> state.v1.SetSourceSecretResponse
|
||||
2, // 18: state.v1.SourceService.SetSourceName:output_type -> state.v1.SetSourceNameResponse
|
||||
4, // 19: state.v1.SourceService.SetSourceDeliveryHeader:output_type -> state.v1.SetSourceDeliveryHeaderResponse
|
||||
6, // 20: state.v1.SourceService.DeleteSource:output_type -> state.v1.DeleteSourceResponse
|
||||
13, // [13:21] is the sub-list for method output_type
|
||||
5, // [5:13] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_source_proto_init() }
|
||||
func file_state_v1_source_proto_init() {
|
||||
if File_state_v1_source_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_source_proto_rawDesc), len(file_state_v1_source_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 17,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_source_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_source_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_source_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_source_proto = out.File
|
||||
file_state_v1_source_proto_goTypes = nil
|
||||
file_state_v1_source_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,393 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/source.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 (
|
||||
SourceService_InsertSource_FullMethodName = "/state.v1.SourceService/InsertSource"
|
||||
SourceService_GetSource_FullMethodName = "/state.v1.SourceService/GetSource"
|
||||
SourceService_ListSources_FullMethodName = "/state.v1.SourceService/ListSources"
|
||||
SourceService_SetSourceSigning_FullMethodName = "/state.v1.SourceService/SetSourceSigning"
|
||||
SourceService_SetSourceSecret_FullMethodName = "/state.v1.SourceService/SetSourceSecret"
|
||||
SourceService_SetSourceName_FullMethodName = "/state.v1.SourceService/SetSourceName"
|
||||
SourceService_SetSourceDeliveryHeader_FullMethodName = "/state.v1.SourceService/SetSourceDeliveryHeader"
|
||||
SourceService_DeleteSource_FullMethodName = "/state.v1.SourceService/DeleteSource"
|
||||
)
|
||||
|
||||
// SourceServiceClient is the client API for SourceService 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.
|
||||
//
|
||||
// Sources: the capture endpoint and its signing setting. Secrets travel in
|
||||
// plaintext; the store encrypts at rest.
|
||||
type SourceServiceClient interface {
|
||||
InsertSource(ctx context.Context, in *InsertSourceRequest, opts ...grpc.CallOption) (*InsertSourceResponse, error)
|
||||
GetSource(ctx context.Context, in *GetSourceRequest, opts ...grpc.CallOption) (*GetSourceResponse, error)
|
||||
ListSources(ctx context.Context, in *ListSourcesRequest, opts ...grpc.CallOption) (*ListSourcesResponse, error)
|
||||
SetSourceSigning(ctx context.Context, in *SetSourceSigningRequest, opts ...grpc.CallOption) (*SetSourceSigningResponse, error)
|
||||
SetSourceSecret(ctx context.Context, in *SetSourceSecretRequest, opts ...grpc.CallOption) (*SetSourceSecretResponse, error)
|
||||
SetSourceName(ctx context.Context, in *SetSourceNameRequest, opts ...grpc.CallOption) (*SetSourceNameResponse, error)
|
||||
SetSourceDeliveryHeader(ctx context.Context, in *SetSourceDeliveryHeaderRequest, opts ...grpc.CallOption) (*SetSourceDeliveryHeaderResponse, error)
|
||||
DeleteSource(ctx context.Context, in *DeleteSourceRequest, opts ...grpc.CallOption) (*DeleteSourceResponse, error)
|
||||
}
|
||||
|
||||
type sourceServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSourceServiceClient(cc grpc.ClientConnInterface) SourceServiceClient {
|
||||
return &sourceServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) InsertSource(ctx context.Context, in *InsertSourceRequest, opts ...grpc.CallOption) (*InsertSourceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InsertSourceResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_InsertSource_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) GetSource(ctx context.Context, in *GetSourceRequest, opts ...grpc.CallOption) (*GetSourceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetSourceResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_GetSource_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) ListSources(ctx context.Context, in *ListSourcesRequest, opts ...grpc.CallOption) (*ListSourcesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListSourcesResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_ListSources_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) SetSourceSigning(ctx context.Context, in *SetSourceSigningRequest, opts ...grpc.CallOption) (*SetSourceSigningResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetSourceSigningResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_SetSourceSigning_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) SetSourceSecret(ctx context.Context, in *SetSourceSecretRequest, opts ...grpc.CallOption) (*SetSourceSecretResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetSourceSecretResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_SetSourceSecret_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) SetSourceName(ctx context.Context, in *SetSourceNameRequest, opts ...grpc.CallOption) (*SetSourceNameResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetSourceNameResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_SetSourceName_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) SetSourceDeliveryHeader(ctx context.Context, in *SetSourceDeliveryHeaderRequest, opts ...grpc.CallOption) (*SetSourceDeliveryHeaderResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetSourceDeliveryHeaderResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_SetSourceDeliveryHeader_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *sourceServiceClient) DeleteSource(ctx context.Context, in *DeleteSourceRequest, opts ...grpc.CallOption) (*DeleteSourceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteSourceResponse)
|
||||
err := c.cc.Invoke(ctx, SourceService_DeleteSource_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SourceServiceServer is the server API for SourceService service.
|
||||
// All implementations must embed UnimplementedSourceServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Sources: the capture endpoint and its signing setting. Secrets travel in
|
||||
// plaintext; the store encrypts at rest.
|
||||
type SourceServiceServer interface {
|
||||
InsertSource(context.Context, *InsertSourceRequest) (*InsertSourceResponse, error)
|
||||
GetSource(context.Context, *GetSourceRequest) (*GetSourceResponse, error)
|
||||
ListSources(context.Context, *ListSourcesRequest) (*ListSourcesResponse, error)
|
||||
SetSourceSigning(context.Context, *SetSourceSigningRequest) (*SetSourceSigningResponse, error)
|
||||
SetSourceSecret(context.Context, *SetSourceSecretRequest) (*SetSourceSecretResponse, error)
|
||||
SetSourceName(context.Context, *SetSourceNameRequest) (*SetSourceNameResponse, error)
|
||||
SetSourceDeliveryHeader(context.Context, *SetSourceDeliveryHeaderRequest) (*SetSourceDeliveryHeaderResponse, error)
|
||||
DeleteSource(context.Context, *DeleteSourceRequest) (*DeleteSourceResponse, error)
|
||||
mustEmbedUnimplementedSourceServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedSourceServiceServer 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 UnimplementedSourceServiceServer struct{}
|
||||
|
||||
func (UnimplementedSourceServiceServer) InsertSource(context.Context, *InsertSourceRequest) (*InsertSourceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InsertSource not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) GetSource(context.Context, *GetSourceRequest) (*GetSourceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSource not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) ListSources(context.Context, *ListSourcesRequest) (*ListSourcesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListSources not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) SetSourceSigning(context.Context, *SetSourceSigningRequest) (*SetSourceSigningResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetSourceSigning not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) SetSourceSecret(context.Context, *SetSourceSecretRequest) (*SetSourceSecretResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetSourceSecret not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) SetSourceName(context.Context, *SetSourceNameRequest) (*SetSourceNameResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetSourceName not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) SetSourceDeliveryHeader(context.Context, *SetSourceDeliveryHeaderRequest) (*SetSourceDeliveryHeaderResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetSourceDeliveryHeader not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) DeleteSource(context.Context, *DeleteSourceRequest) (*DeleteSourceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteSource not implemented")
|
||||
}
|
||||
func (UnimplementedSourceServiceServer) mustEmbedUnimplementedSourceServiceServer() {}
|
||||
func (UnimplementedSourceServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSourceServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SourceServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSourceServiceServer interface {
|
||||
mustEmbedUnimplementedSourceServiceServer()
|
||||
}
|
||||
|
||||
func RegisterSourceServiceServer(s grpc.ServiceRegistrar, srv SourceServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedSourceServiceServer 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(&SourceService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SourceService_InsertSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InsertSourceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).InsertSource(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_InsertSource_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).InsertSource(ctx, req.(*InsertSourceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SourceService_GetSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSourceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).GetSource(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_GetSource_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).GetSource(ctx, req.(*GetSourceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SourceService_ListSources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListSourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).ListSources(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_ListSources_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).ListSources(ctx, req.(*ListSourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SourceService_SetSourceSigning_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetSourceSigningRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).SetSourceSigning(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_SetSourceSigning_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).SetSourceSigning(ctx, req.(*SetSourceSigningRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SourceService_SetSourceSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetSourceSecretRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).SetSourceSecret(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_SetSourceSecret_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).SetSourceSecret(ctx, req.(*SetSourceSecretRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SourceService_SetSourceName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetSourceNameRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).SetSourceName(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_SetSourceName_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).SetSourceName(ctx, req.(*SetSourceNameRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SourceService_SetSourceDeliveryHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetSourceDeliveryHeaderRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).SetSourceDeliveryHeader(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_SetSourceDeliveryHeader_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).SetSourceDeliveryHeader(ctx, req.(*SetSourceDeliveryHeaderRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SourceService_DeleteSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteSourceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SourceServiceServer).DeleteSource(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SourceService_DeleteSource_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SourceServiceServer).DeleteSource(ctx, req.(*DeleteSourceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SourceService_ServiceDesc is the grpc.ServiceDesc for SourceService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SourceService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.SourceService",
|
||||
HandlerType: (*SourceServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "InsertSource",
|
||||
Handler: _SourceService_InsertSource_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSource",
|
||||
Handler: _SourceService_GetSource_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListSources",
|
||||
Handler: _SourceService_ListSources_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetSourceSigning",
|
||||
Handler: _SourceService_SetSourceSigning_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetSourceSecret",
|
||||
Handler: _SourceService_SetSourceSecret_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetSourceName",
|
||||
Handler: _SourceService_SetSourceName_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetSourceDeliveryHeader",
|
||||
Handler: _SourceService_SetSourceDeliveryHeader_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteSource",
|
||||
Handler: _SourceService_DeleteSource_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/source.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,710 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/stats.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// WorkflowStat mirrors storecontract.WorkflowStat.
|
||||
type WorkflowStat struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Workflow string `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"`
|
||||
Runs int64 `protobuf:"varint,2,opt,name=runs,proto3" json:"runs,omitempty"`
|
||||
Merged int64 `protobuf:"varint,3,opt,name=merged,proto3" json:"merged,omitempty"`
|
||||
PrOpen int64 `protobuf:"varint,4,opt,name=pr_open,json=prOpen,proto3" json:"pr_open,omitempty"`
|
||||
Parked int64 `protobuf:"varint,5,opt,name=parked,proto3" json:"parked,omitempty"`
|
||||
AvgTokens int64 `protobuf:"varint,6,opt,name=avg_tokens,json=avgTokens,proto3" json:"avg_tokens,omitempty"`
|
||||
AvgSteps float64 `protobuf:"fixed64,7,opt,name=avg_steps,json=avgSteps,proto3" json:"avg_steps,omitempty"`
|
||||
TotalTokens int64 `protobuf:"varint,8,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"`
|
||||
Completed int64 `protobuf:"varint,9,opt,name=completed,proto3" json:"completed,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) Reset() {
|
||||
*x = WorkflowStat{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*WorkflowStat) ProtoMessage() {}
|
||||
|
||||
func (x *WorkflowStat) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use WorkflowStat.ProtoReflect.Descriptor instead.
|
||||
func (*WorkflowStat) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetWorkflow() string {
|
||||
if x != nil {
|
||||
return x.Workflow
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetRuns() int64 {
|
||||
if x != nil {
|
||||
return x.Runs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetMerged() int64 {
|
||||
if x != nil {
|
||||
return x.Merged
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetPrOpen() int64 {
|
||||
if x != nil {
|
||||
return x.PrOpen
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetParked() int64 {
|
||||
if x != nil {
|
||||
return x.Parked
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetAvgTokens() int64 {
|
||||
if x != nil {
|
||||
return x.AvgTokens
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetAvgSteps() float64 {
|
||||
if x != nil {
|
||||
return x.AvgSteps
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetTotalTokens() int64 {
|
||||
if x != nil {
|
||||
return x.TotalTokens
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *WorkflowStat) GetCompleted() int64 {
|
||||
if x != nil {
|
||||
return x.Completed
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// StageStat mirrors storecontract.StageStat.
|
||||
type StageStat struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Workflow string `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"`
|
||||
Stage string `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"`
|
||||
Runs int64 `protobuf:"varint,3,opt,name=runs,proto3" json:"runs,omitempty"`
|
||||
AvgMs int64 `protobuf:"varint,4,opt,name=avg_ms,json=avgMs,proto3" json:"avg_ms,omitempty"`
|
||||
Errors int64 `protobuf:"varint,5,opt,name=errors,proto3" json:"errors,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StageStat) Reset() {
|
||||
*x = StageStat{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StageStat) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StageStat) ProtoMessage() {}
|
||||
|
||||
func (x *StageStat) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StageStat.ProtoReflect.Descriptor instead.
|
||||
func (*StageStat) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *StageStat) GetWorkflow() string {
|
||||
if x != nil {
|
||||
return x.Workflow
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StageStat) GetStage() string {
|
||||
if x != nil {
|
||||
return x.Stage
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StageStat) GetRuns() int64 {
|
||||
if x != nil {
|
||||
return x.Runs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StageStat) GetAvgMs() int64 {
|
||||
if x != nil {
|
||||
return x.AvgMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StageStat) GetErrors() int64 {
|
||||
if x != nil {
|
||||
return x.Errors
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// DayTokens mirrors storecontract.DayTokens.
|
||||
type DayTokens struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"`
|
||||
Tokens int64 `protobuf:"varint,2,opt,name=tokens,proto3" json:"tokens,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DayTokens) Reset() {
|
||||
*x = DayTokens{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DayTokens) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DayTokens) ProtoMessage() {}
|
||||
|
||||
func (x *DayTokens) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DayTokens.ProtoReflect.Descriptor instead.
|
||||
func (*DayTokens) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DayTokens) GetDay() string {
|
||||
if x != nil {
|
||||
return x.Day
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DayTokens) GetTokens() int64 {
|
||||
if x != nil {
|
||||
return x.Tokens
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type StatusCountsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StatusCountsRequest) Reset() {
|
||||
*x = StatusCountsRequest{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StatusCountsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatusCountsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StatusCountsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusCountsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StatusCountsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
type StatusCountsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Counts map[string]int64 `protobuf:"bytes,1,rep,name=counts,proto3" json:"counts,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StatusCountsResponse) Reset() {
|
||||
*x = StatusCountsResponse{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StatusCountsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatusCountsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StatusCountsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusCountsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StatusCountsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *StatusCountsResponse) GetCounts() map[string]int64 {
|
||||
if x != nil {
|
||||
return x.Counts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type WorkflowStatsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *WorkflowStatsRequest) Reset() {
|
||||
*x = WorkflowStatsRequest{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *WorkflowStatsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*WorkflowStatsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *WorkflowStatsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use WorkflowStatsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*WorkflowStatsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
type WorkflowStatsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Stats []*WorkflowStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *WorkflowStatsResponse) Reset() {
|
||||
*x = WorkflowStatsResponse{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *WorkflowStatsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*WorkflowStatsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *WorkflowStatsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use WorkflowStatsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*WorkflowStatsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *WorkflowStatsResponse) GetStats() []*WorkflowStat {
|
||||
if x != nil {
|
||||
return x.Stats
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StageStatsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StageStatsRequest) Reset() {
|
||||
*x = StageStatsRequest{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StageStatsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StageStatsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StageStatsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StageStatsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StageStatsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
type StageStatsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Stats []*StageStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StageStatsResponse) Reset() {
|
||||
*x = StageStatsResponse{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StageStatsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StageStatsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StageStatsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StageStatsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StageStatsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *StageStatsResponse) GetStats() []*StageStat {
|
||||
if x != nil {
|
||||
return x.Stats
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TokensByDayRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Days int64 `protobuf:"varint,1,opt,name=days,proto3" json:"days,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TokensByDayRequest) Reset() {
|
||||
*x = TokensByDayRequest{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TokensByDayRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TokensByDayRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TokensByDayRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TokensByDayRequest.ProtoReflect.Descriptor instead.
|
||||
func (*TokensByDayRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *TokensByDayRequest) GetDays() int64 {
|
||||
if x != nil {
|
||||
return x.Days
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type TokensByDayResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Tokens []*DayTokens `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TokensByDayResponse) Reset() {
|
||||
*x = TokensByDayResponse{}
|
||||
mi := &file_state_v1_stats_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TokensByDayResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TokensByDayResponse) ProtoMessage() {}
|
||||
|
||||
func (x *TokensByDayResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_stats_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TokensByDayResponse.ProtoReflect.Descriptor instead.
|
||||
func (*TokensByDayResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_stats_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *TokensByDayResponse) GetTokens() []*DayTokens {
|
||||
if x != nil {
|
||||
return x.Tokens
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_state_v1_stats_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_stats_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x14state/v1/stats.proto\x12\bstate.v1\"\x84\x02\n" +
|
||||
"\fWorkflowStat\x12\x1a\n" +
|
||||
"\bworkflow\x18\x01 \x01(\tR\bworkflow\x12\x12\n" +
|
||||
"\x04runs\x18\x02 \x01(\x03R\x04runs\x12\x16\n" +
|
||||
"\x06merged\x18\x03 \x01(\x03R\x06merged\x12\x17\n" +
|
||||
"\apr_open\x18\x04 \x01(\x03R\x06prOpen\x12\x16\n" +
|
||||
"\x06parked\x18\x05 \x01(\x03R\x06parked\x12\x1d\n" +
|
||||
"\n" +
|
||||
"avg_tokens\x18\x06 \x01(\x03R\tavgTokens\x12\x1b\n" +
|
||||
"\tavg_steps\x18\a \x01(\x01R\bavgSteps\x12!\n" +
|
||||
"\ftotal_tokens\x18\b \x01(\x03R\vtotalTokens\x12\x1c\n" +
|
||||
"\tcompleted\x18\t \x01(\x03R\tcompleted\"\x80\x01\n" +
|
||||
"\tStageStat\x12\x1a\n" +
|
||||
"\bworkflow\x18\x01 \x01(\tR\bworkflow\x12\x14\n" +
|
||||
"\x05stage\x18\x02 \x01(\tR\x05stage\x12\x12\n" +
|
||||
"\x04runs\x18\x03 \x01(\x03R\x04runs\x12\x15\n" +
|
||||
"\x06avg_ms\x18\x04 \x01(\x03R\x05avgMs\x12\x16\n" +
|
||||
"\x06errors\x18\x05 \x01(\x03R\x06errors\"5\n" +
|
||||
"\tDayTokens\x12\x10\n" +
|
||||
"\x03day\x18\x01 \x01(\tR\x03day\x12\x16\n" +
|
||||
"\x06tokens\x18\x02 \x01(\x03R\x06tokens\"\x15\n" +
|
||||
"\x13StatusCountsRequest\"\x95\x01\n" +
|
||||
"\x14StatusCountsResponse\x12B\n" +
|
||||
"\x06counts\x18\x01 \x03(\v2*.state.v1.StatusCountsResponse.CountsEntryR\x06counts\x1a9\n" +
|
||||
"\vCountsEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\x03R\x05value:\x028\x01\"\x16\n" +
|
||||
"\x14WorkflowStatsRequest\"E\n" +
|
||||
"\x15WorkflowStatsResponse\x12,\n" +
|
||||
"\x05stats\x18\x01 \x03(\v2\x16.state.v1.WorkflowStatR\x05stats\"\x13\n" +
|
||||
"\x11StageStatsRequest\"?\n" +
|
||||
"\x12StageStatsResponse\x12)\n" +
|
||||
"\x05stats\x18\x01 \x03(\v2\x13.state.v1.StageStatR\x05stats\"(\n" +
|
||||
"\x12TokensByDayRequest\x12\x12\n" +
|
||||
"\x04days\x18\x01 \x01(\x03R\x04days\"B\n" +
|
||||
"\x13TokensByDayResponse\x12+\n" +
|
||||
"\x06tokens\x18\x01 \x03(\v2\x13.state.v1.DayTokensR\x06tokens2\xc4\x02\n" +
|
||||
"\fStatsService\x12M\n" +
|
||||
"\fStatusCounts\x12\x1d.state.v1.StatusCountsRequest\x1a\x1e.state.v1.StatusCountsResponse\x12P\n" +
|
||||
"\rWorkflowStats\x12\x1e.state.v1.WorkflowStatsRequest\x1a\x1f.state.v1.WorkflowStatsResponse\x12G\n" +
|
||||
"\n" +
|
||||
"StageStats\x12\x1b.state.v1.StageStatsRequest\x1a\x1c.state.v1.StageStatsResponse\x12J\n" +
|
||||
"\vTokensByDay\x12\x1c.state.v1.TokensByDayRequest\x1a\x1d.state.v1.TokensByDayResponseB\xa4\x01\n" +
|
||||
"\fcom.state.v1B\n" +
|
||||
"StatsProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_stats_proto_rawDescOnce sync.Once
|
||||
file_state_v1_stats_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_stats_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_stats_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_stats_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_stats_proto_rawDesc), len(file_state_v1_stats_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_stats_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||
var file_state_v1_stats_proto_goTypes = []any{
|
||||
(*WorkflowStat)(nil), // 0: state.v1.WorkflowStat
|
||||
(*StageStat)(nil), // 1: state.v1.StageStat
|
||||
(*DayTokens)(nil), // 2: state.v1.DayTokens
|
||||
(*StatusCountsRequest)(nil), // 3: state.v1.StatusCountsRequest
|
||||
(*StatusCountsResponse)(nil), // 4: state.v1.StatusCountsResponse
|
||||
(*WorkflowStatsRequest)(nil), // 5: state.v1.WorkflowStatsRequest
|
||||
(*WorkflowStatsResponse)(nil), // 6: state.v1.WorkflowStatsResponse
|
||||
(*StageStatsRequest)(nil), // 7: state.v1.StageStatsRequest
|
||||
(*StageStatsResponse)(nil), // 8: state.v1.StageStatsResponse
|
||||
(*TokensByDayRequest)(nil), // 9: state.v1.TokensByDayRequest
|
||||
(*TokensByDayResponse)(nil), // 10: state.v1.TokensByDayResponse
|
||||
nil, // 11: state.v1.StatusCountsResponse.CountsEntry
|
||||
}
|
||||
var file_state_v1_stats_proto_depIdxs = []int32{
|
||||
11, // 0: state.v1.StatusCountsResponse.counts:type_name -> state.v1.StatusCountsResponse.CountsEntry
|
||||
0, // 1: state.v1.WorkflowStatsResponse.stats:type_name -> state.v1.WorkflowStat
|
||||
1, // 2: state.v1.StageStatsResponse.stats:type_name -> state.v1.StageStat
|
||||
2, // 3: state.v1.TokensByDayResponse.tokens:type_name -> state.v1.DayTokens
|
||||
3, // 4: state.v1.StatsService.StatusCounts:input_type -> state.v1.StatusCountsRequest
|
||||
5, // 5: state.v1.StatsService.WorkflowStats:input_type -> state.v1.WorkflowStatsRequest
|
||||
7, // 6: state.v1.StatsService.StageStats:input_type -> state.v1.StageStatsRequest
|
||||
9, // 7: state.v1.StatsService.TokensByDay:input_type -> state.v1.TokensByDayRequest
|
||||
4, // 8: state.v1.StatsService.StatusCounts:output_type -> state.v1.StatusCountsResponse
|
||||
6, // 9: state.v1.StatsService.WorkflowStats:output_type -> state.v1.WorkflowStatsResponse
|
||||
8, // 10: state.v1.StatsService.StageStats:output_type -> state.v1.StageStatsResponse
|
||||
10, // 11: state.v1.StatsService.TokensByDay:output_type -> state.v1.TokensByDayResponse
|
||||
8, // [8:12] is the sub-list for method output_type
|
||||
4, // [4:8] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_stats_proto_init() }
|
||||
func file_state_v1_stats_proto_init() {
|
||||
if File_state_v1_stats_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_stats_proto_rawDesc), len(file_state_v1_stats_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 12,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_stats_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_stats_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_stats_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_stats_proto = out.File
|
||||
file_state_v1_stats_proto_goTypes = nil
|
||||
file_state_v1_stats_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/stats.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 (
|
||||
StatsService_StatusCounts_FullMethodName = "/state.v1.StatsService/StatusCounts"
|
||||
StatsService_WorkflowStats_FullMethodName = "/state.v1.StatsService/WorkflowStats"
|
||||
StatsService_StageStats_FullMethodName = "/state.v1.StatsService/StageStats"
|
||||
StatsService_TokensByDay_FullMethodName = "/state.v1.StatsService/TokensByDay"
|
||||
)
|
||||
|
||||
// StatsServiceClient is the client API for StatsService 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 StatsServiceClient interface {
|
||||
StatusCounts(ctx context.Context, in *StatusCountsRequest, opts ...grpc.CallOption) (*StatusCountsResponse, error)
|
||||
WorkflowStats(ctx context.Context, in *WorkflowStatsRequest, opts ...grpc.CallOption) (*WorkflowStatsResponse, error)
|
||||
StageStats(ctx context.Context, in *StageStatsRequest, opts ...grpc.CallOption) (*StageStatsResponse, error)
|
||||
TokensByDay(ctx context.Context, in *TokensByDayRequest, opts ...grpc.CallOption) (*TokensByDayResponse, error)
|
||||
}
|
||||
|
||||
type statsServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewStatsServiceClient(cc grpc.ClientConnInterface) StatsServiceClient {
|
||||
return &statsServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *statsServiceClient) StatusCounts(ctx context.Context, in *StatusCountsRequest, opts ...grpc.CallOption) (*StatusCountsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusCountsResponse)
|
||||
err := c.cc.Invoke(ctx, StatsService_StatusCounts_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statsServiceClient) WorkflowStats(ctx context.Context, in *WorkflowStatsRequest, opts ...grpc.CallOption) (*WorkflowStatsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(WorkflowStatsResponse)
|
||||
err := c.cc.Invoke(ctx, StatsService_WorkflowStats_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statsServiceClient) StageStats(ctx context.Context, in *StageStatsRequest, opts ...grpc.CallOption) (*StageStatsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StageStatsResponse)
|
||||
err := c.cc.Invoke(ctx, StatsService_StageStats_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statsServiceClient) TokensByDay(ctx context.Context, in *TokensByDayRequest, opts ...grpc.CallOption) (*TokensByDayResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TokensByDayResponse)
|
||||
err := c.cc.Invoke(ctx, StatsService_TokensByDay_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// StatsServiceServer is the server API for StatsService service.
|
||||
// All implementations must embed UnimplementedStatsServiceServer
|
||||
// for forward compatibility.
|
||||
type StatsServiceServer interface {
|
||||
StatusCounts(context.Context, *StatusCountsRequest) (*StatusCountsResponse, error)
|
||||
WorkflowStats(context.Context, *WorkflowStatsRequest) (*WorkflowStatsResponse, error)
|
||||
StageStats(context.Context, *StageStatsRequest) (*StageStatsResponse, error)
|
||||
TokensByDay(context.Context, *TokensByDayRequest) (*TokensByDayResponse, error)
|
||||
mustEmbedUnimplementedStatsServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedStatsServiceServer 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 UnimplementedStatsServiceServer struct{}
|
||||
|
||||
func (UnimplementedStatsServiceServer) StatusCounts(context.Context, *StatusCountsRequest) (*StatusCountsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method StatusCounts not implemented")
|
||||
}
|
||||
func (UnimplementedStatsServiceServer) WorkflowStats(context.Context, *WorkflowStatsRequest) (*WorkflowStatsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method WorkflowStats not implemented")
|
||||
}
|
||||
func (UnimplementedStatsServiceServer) StageStats(context.Context, *StageStatsRequest) (*StageStatsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method StageStats not implemented")
|
||||
}
|
||||
func (UnimplementedStatsServiceServer) TokensByDay(context.Context, *TokensByDayRequest) (*TokensByDayResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method TokensByDay not implemented")
|
||||
}
|
||||
func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer() {}
|
||||
func (UnimplementedStatsServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeStatsServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to StatsServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeStatsServiceServer interface {
|
||||
mustEmbedUnimplementedStatsServiceServer()
|
||||
}
|
||||
|
||||
func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedStatsServiceServer 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(&StatsService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _StatsService_StatusCounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StatusCountsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatsServiceServer).StatusCounts(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatsService_StatusCounts_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatsServiceServer).StatusCounts(ctx, req.(*StatusCountsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatsService_WorkflowStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(WorkflowStatsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatsServiceServer).WorkflowStats(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatsService_WorkflowStats_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatsServiceServer).WorkflowStats(ctx, req.(*WorkflowStatsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatsService_StageStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StageStatsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatsServiceServer).StageStats(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatsService_StageStats_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatsServiceServer).StageStats(ctx, req.(*StageStatsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatsService_TokensByDay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TokensByDayRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatsServiceServer).TokensByDay(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatsService_TokensByDay_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatsServiceServer).TokensByDay(ctx, req.(*TokensByDayRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// StatsService_ServiceDesc is the grpc.ServiceDesc for StatsService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var StatsService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.StatsService",
|
||||
HandlerType: (*StatsServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "StatusCounts",
|
||||
Handler: _StatsService_StatusCounts_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "WorkflowStats",
|
||||
Handler: _StatsService_WorkflowStats_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "StageStats",
|
||||
Handler: _StatsService_StageStats_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "TokensByDay",
|
||||
Handler: _StatsService_TokensByDay_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/stats.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,461 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/status.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 (
|
||||
StatusService_RecentLogs_FullMethodName = "/state.v1.StatusService/RecentLogs"
|
||||
StatusService_PutConfigSnapshot_FullMethodName = "/state.v1.StatusService/PutConfigSnapshot"
|
||||
StatusService_GetConfigSnapshot_FullMethodName = "/state.v1.StatusService/GetConfigSnapshot"
|
||||
StatusService_PutChannelStatus_FullMethodName = "/state.v1.StatusService/PutChannelStatus"
|
||||
StatusService_ListChannelStatus_FullMethodName = "/state.v1.StatusService/ListChannelStatus"
|
||||
StatusService_PutApplyStatus_FullMethodName = "/state.v1.StatusService/PutApplyStatus"
|
||||
StatusService_ListApplyStatus_FullMethodName = "/state.v1.StatusService/ListApplyStatus"
|
||||
StatusService_PutPresence_FullMethodName = "/state.v1.StatusService/PutPresence"
|
||||
StatusService_ListPresence_FullMethodName = "/state.v1.StatusService/ListPresence"
|
||||
)
|
||||
|
||||
// StatusServiceClient is the client API for StatusService 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 StatusServiceClient interface {
|
||||
RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error)
|
||||
// Configuration snapshot: the running configuration as the dashboard
|
||||
// renders it, published by the owner of configuration for the process that
|
||||
// displays it. PutConfigSnapshot is administrative; GetConfigSnapshot is
|
||||
// the UI's read (docs/architecture/migration-decisions.md, "Dashboard
|
||||
// configuration page").
|
||||
PutConfigSnapshot(ctx context.Context, in *PutConfigSnapshotRequest, opts ...grpc.CallOption) (*PutConfigSnapshotResponse, error)
|
||||
GetConfigSnapshot(ctx context.Context, in *GetConfigSnapshotRequest, opts ...grpc.CallOption) (*GetConfigSnapshotResponse, error)
|
||||
// Channel status is what the process HOSTING the channels observes about them:
|
||||
// one row per channel, written by the Messaging Service and read by the UI
|
||||
// process. Administrative like the config snapshot, and for the same reason --
|
||||
// a task-scoped grant reaches neither, so authorizesTaskScopedCall admits only
|
||||
// the administrative token. It is runtime state rather than a settings
|
||||
// document, which is why it is not a ControlPlaneService resource kind.
|
||||
PutChannelStatus(ctx context.Context, in *PutChannelStatusRequest, opts ...grpc.CallOption) (*PutChannelStatusResponse, error)
|
||||
ListChannelStatus(ctx context.Context, in *ListChannelStatusRequest, opts ...grpc.CallOption) (*ListChannelStatusResponse, error)
|
||||
// Apply status: which version of a control-plane resource each process is
|
||||
// running, and why it could not. Every process that applies a resource
|
||||
// publishes; the UI process reads (docs/prds/control-plane-apply-status.md).
|
||||
// Both are administrative.
|
||||
PutApplyStatus(ctx context.Context, in *PutApplyStatusRequest, opts ...grpc.CallOption) (*PutApplyStatusResponse, error)
|
||||
ListApplyStatus(ctx context.Context, in *ListApplyStatusRequest, opts ...grpc.CallOption) (*ListApplyStatusResponse, error)
|
||||
// Presence: every running service instance re-stamps one record, so a
|
||||
// record past the staleness window means that instance is down.
|
||||
// Administrative.
|
||||
PutPresence(ctx context.Context, in *PutPresenceRequest, opts ...grpc.CallOption) (*PutPresenceResponse, error)
|
||||
ListPresence(ctx context.Context, in *ListPresenceRequest, opts ...grpc.CallOption) (*ListPresenceResponse, error)
|
||||
}
|
||||
|
||||
type statusServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewStatusServiceClient(cc grpc.ClientConnInterface) StatusServiceClient {
|
||||
return &statusServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecentLogsResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_RecentLogs_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) PutConfigSnapshot(ctx context.Context, in *PutConfigSnapshotRequest, opts ...grpc.CallOption) (*PutConfigSnapshotResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PutConfigSnapshotResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_PutConfigSnapshot_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) GetConfigSnapshot(ctx context.Context, in *GetConfigSnapshotRequest, opts ...grpc.CallOption) (*GetConfigSnapshotResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetConfigSnapshotResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_GetConfigSnapshot_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) PutChannelStatus(ctx context.Context, in *PutChannelStatusRequest, opts ...grpc.CallOption) (*PutChannelStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PutChannelStatusResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_PutChannelStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) ListChannelStatus(ctx context.Context, in *ListChannelStatusRequest, opts ...grpc.CallOption) (*ListChannelStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListChannelStatusResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_ListChannelStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) PutApplyStatus(ctx context.Context, in *PutApplyStatusRequest, opts ...grpc.CallOption) (*PutApplyStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PutApplyStatusResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_PutApplyStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) ListApplyStatus(ctx context.Context, in *ListApplyStatusRequest, opts ...grpc.CallOption) (*ListApplyStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListApplyStatusResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_ListApplyStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) PutPresence(ctx context.Context, in *PutPresenceRequest, opts ...grpc.CallOption) (*PutPresenceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PutPresenceResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_PutPresence_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *statusServiceClient) ListPresence(ctx context.Context, in *ListPresenceRequest, opts ...grpc.CallOption) (*ListPresenceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPresenceResponse)
|
||||
err := c.cc.Invoke(ctx, StatusService_ListPresence_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// StatusServiceServer is the server API for StatusService service.
|
||||
// All implementations must embed UnimplementedStatusServiceServer
|
||||
// for forward compatibility.
|
||||
type StatusServiceServer interface {
|
||||
RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error)
|
||||
// Configuration snapshot: the running configuration as the dashboard
|
||||
// renders it, published by the owner of configuration for the process that
|
||||
// displays it. PutConfigSnapshot is administrative; GetConfigSnapshot is
|
||||
// the UI's read (docs/architecture/migration-decisions.md, "Dashboard
|
||||
// configuration page").
|
||||
PutConfigSnapshot(context.Context, *PutConfigSnapshotRequest) (*PutConfigSnapshotResponse, error)
|
||||
GetConfigSnapshot(context.Context, *GetConfigSnapshotRequest) (*GetConfigSnapshotResponse, error)
|
||||
// Channel status is what the process HOSTING the channels observes about them:
|
||||
// one row per channel, written by the Messaging Service and read by the UI
|
||||
// process. Administrative like the config snapshot, and for the same reason --
|
||||
// a task-scoped grant reaches neither, so authorizesTaskScopedCall admits only
|
||||
// the administrative token. It is runtime state rather than a settings
|
||||
// document, which is why it is not a ControlPlaneService resource kind.
|
||||
PutChannelStatus(context.Context, *PutChannelStatusRequest) (*PutChannelStatusResponse, error)
|
||||
ListChannelStatus(context.Context, *ListChannelStatusRequest) (*ListChannelStatusResponse, error)
|
||||
// Apply status: which version of a control-plane resource each process is
|
||||
// running, and why it could not. Every process that applies a resource
|
||||
// publishes; the UI process reads (docs/prds/control-plane-apply-status.md).
|
||||
// Both are administrative.
|
||||
PutApplyStatus(context.Context, *PutApplyStatusRequest) (*PutApplyStatusResponse, error)
|
||||
ListApplyStatus(context.Context, *ListApplyStatusRequest) (*ListApplyStatusResponse, error)
|
||||
// Presence: every running service instance re-stamps one record, so a
|
||||
// record past the staleness window means that instance is down.
|
||||
// Administrative.
|
||||
PutPresence(context.Context, *PutPresenceRequest) (*PutPresenceResponse, error)
|
||||
ListPresence(context.Context, *ListPresenceRequest) (*ListPresenceResponse, error)
|
||||
mustEmbedUnimplementedStatusServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedStatusServiceServer 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 UnimplementedStatusServiceServer struct{}
|
||||
|
||||
func (UnimplementedStatusServiceServer) RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RecentLogs not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) PutConfigSnapshot(context.Context, *PutConfigSnapshotRequest) (*PutConfigSnapshotResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PutConfigSnapshot not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) GetConfigSnapshot(context.Context, *GetConfigSnapshotRequest) (*GetConfigSnapshotResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetConfigSnapshot not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) PutChannelStatus(context.Context, *PutChannelStatusRequest) (*PutChannelStatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PutChannelStatus not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) ListChannelStatus(context.Context, *ListChannelStatusRequest) (*ListChannelStatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListChannelStatus not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) PutApplyStatus(context.Context, *PutApplyStatusRequest) (*PutApplyStatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PutApplyStatus not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) ListApplyStatus(context.Context, *ListApplyStatusRequest) (*ListApplyStatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListApplyStatus not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) PutPresence(context.Context, *PutPresenceRequest) (*PutPresenceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method PutPresence not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) ListPresence(context.Context, *ListPresenceRequest) (*ListPresenceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPresence not implemented")
|
||||
}
|
||||
func (UnimplementedStatusServiceServer) mustEmbedUnimplementedStatusServiceServer() {}
|
||||
func (UnimplementedStatusServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeStatusServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to StatusServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeStatusServiceServer interface {
|
||||
mustEmbedUnimplementedStatusServiceServer()
|
||||
}
|
||||
|
||||
func RegisterStatusServiceServer(s grpc.ServiceRegistrar, srv StatusServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedStatusServiceServer 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(&StatusService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _StatusService_RecentLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecentLogsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).RecentLogs(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_RecentLogs_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).RecentLogs(ctx, req.(*RecentLogsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_PutConfigSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PutConfigSnapshotRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).PutConfigSnapshot(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_PutConfigSnapshot_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).PutConfigSnapshot(ctx, req.(*PutConfigSnapshotRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_GetConfigSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetConfigSnapshotRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).GetConfigSnapshot(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_GetConfigSnapshot_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).GetConfigSnapshot(ctx, req.(*GetConfigSnapshotRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_PutChannelStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PutChannelStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).PutChannelStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_PutChannelStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).PutChannelStatus(ctx, req.(*PutChannelStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_ListChannelStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListChannelStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).ListChannelStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_ListChannelStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).ListChannelStatus(ctx, req.(*ListChannelStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_PutApplyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PutApplyStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).PutApplyStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_PutApplyStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).PutApplyStatus(ctx, req.(*PutApplyStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_ListApplyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListApplyStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).ListApplyStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_ListApplyStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).ListApplyStatus(ctx, req.(*ListApplyStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_PutPresence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PutPresenceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).PutPresence(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_PutPresence_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).PutPresence(ctx, req.(*PutPresenceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StatusService_ListPresence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPresenceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StatusServiceServer).ListPresence(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StatusService_ListPresence_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StatusServiceServer).ListPresence(ctx, req.(*ListPresenceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// StatusService_ServiceDesc is the grpc.ServiceDesc for StatusService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var StatusService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.StatusService",
|
||||
HandlerType: (*StatusServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "RecentLogs",
|
||||
Handler: _StatusService_RecentLogs_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PutConfigSnapshot",
|
||||
Handler: _StatusService_PutConfigSnapshot_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetConfigSnapshot",
|
||||
Handler: _StatusService_GetConfigSnapshot_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PutChannelStatus",
|
||||
Handler: _StatusService_PutChannelStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListChannelStatus",
|
||||
Handler: _StatusService_ListChannelStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PutApplyStatus",
|
||||
Handler: _StatusService_PutApplyStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListApplyStatus",
|
||||
Handler: _StatusService_ListApplyStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PutPresence",
|
||||
Handler: _StatusService_PutPresence_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListPresence",
|
||||
Handler: _StatusService_ListPresence_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/status.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,388 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/task_event.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type InsertEventRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertEventRequest) Reset() {
|
||||
*x = InsertEventRequest{}
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertEventRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertEventRequest) ProtoMessage() {}
|
||||
|
||||
func (x *InsertEventRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertEventRequest.ProtoReflect.Descriptor instead.
|
||||
func (*InsertEventRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_event_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *InsertEventRequest) GetEvent() *Event {
|
||||
if x != nil {
|
||||
return x.Event
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type InsertEventResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *InsertEventResponse) Reset() {
|
||||
*x = InsertEventResponse{}
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *InsertEventResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*InsertEventResponse) ProtoMessage() {}
|
||||
|
||||
func (x *InsertEventResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use InsertEventResponse.ProtoReflect.Descriptor instead.
|
||||
func (*InsertEventResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_event_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *InsertEventResponse) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type EventsSinceRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// since_id is the opaque resume cursor returned by the previous page (the SSE
|
||||
// id: field, echoed back as Last-Event-ID). Empty means "from the
|
||||
// beginning". The field keeps its name and number so the wire name stays
|
||||
// put; only its type widened, from the SQLite rowid to the fixed-width
|
||||
// "<at>|<row id>" cursor.
|
||||
SinceId string `protobuf:"bytes,1,opt,name=since_id,json=sinceId,proto3" json:"since_id,omitempty"`
|
||||
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EventsSinceRequest) Reset() {
|
||||
*x = EventsSinceRequest{}
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EventsSinceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EventsSinceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EventsSinceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EventsSinceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EventsSinceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_event_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *EventsSinceRequest) GetSinceId() string {
|
||||
if x != nil {
|
||||
return x.SinceId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EventsSinceRequest) GetLimit() int64 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type EventsSinceResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EventsSinceResponse) Reset() {
|
||||
*x = EventsSinceResponse{}
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EventsSinceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EventsSinceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *EventsSinceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EventsSinceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*EventsSinceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_event_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *EventsSinceResponse) GetEvents() []*Event {
|
||||
if x != nil {
|
||||
return x.Events
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TaskEventsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskEventsRequest) Reset() {
|
||||
*x = TaskEventsRequest{}
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TaskEventsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskEventsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TaskEventsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TaskEventsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*TaskEventsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_event_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *TaskEventsRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type TaskEventsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskEventsResponse) Reset() {
|
||||
*x = TaskEventsResponse{}
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TaskEventsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskEventsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *TaskEventsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_event_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TaskEventsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*TaskEventsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_event_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *TaskEventsResponse) GetEvents() []*Event {
|
||||
if x != nil {
|
||||
return x.Events
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_state_v1_task_event_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_task_event_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x19state/v1/task_event.proto\x12\bstate.v1\x1a\x14state/v1/types.proto\";\n" +
|
||||
"\x12InsertEventRequest\x12%\n" +
|
||||
"\x05event\x18\x01 \x01(\v2\x0f.state.v1.EventR\x05event\"%\n" +
|
||||
"\x13InsertEventResponse\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\"E\n" +
|
||||
"\x12EventsSinceRequest\x12\x19\n" +
|
||||
"\bsince_id\x18\x01 \x01(\tR\asinceId\x12\x14\n" +
|
||||
"\x05limit\x18\x02 \x01(\x03R\x05limit\">\n" +
|
||||
"\x13EventsSinceResponse\x12'\n" +
|
||||
"\x06events\x18\x01 \x03(\v2\x0f.state.v1.EventR\x06events\",\n" +
|
||||
"\x11TaskEventsRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\"=\n" +
|
||||
"\x12TaskEventsResponse\x12'\n" +
|
||||
"\x06events\x18\x01 \x03(\v2\x0f.state.v1.EventR\x06events2\xf3\x01\n" +
|
||||
"\x10TaskEventService\x12J\n" +
|
||||
"\vInsertEvent\x12\x1c.state.v1.InsertEventRequest\x1a\x1d.state.v1.InsertEventResponse\x12J\n" +
|
||||
"\vEventsSince\x12\x1c.state.v1.EventsSinceRequest\x1a\x1d.state.v1.EventsSinceResponse\x12G\n" +
|
||||
"\n" +
|
||||
"TaskEvents\x12\x1b.state.v1.TaskEventsRequest\x1a\x1c.state.v1.TaskEventsResponseB\xa8\x01\n" +
|
||||
"\fcom.state.v1B\x0eTaskEventProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_task_event_proto_rawDescOnce sync.Once
|
||||
file_state_v1_task_event_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_task_event_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_task_event_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_task_event_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_task_event_proto_rawDesc), len(file_state_v1_task_event_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_task_event_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_task_event_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_state_v1_task_event_proto_goTypes = []any{
|
||||
(*InsertEventRequest)(nil), // 0: state.v1.InsertEventRequest
|
||||
(*InsertEventResponse)(nil), // 1: state.v1.InsertEventResponse
|
||||
(*EventsSinceRequest)(nil), // 2: state.v1.EventsSinceRequest
|
||||
(*EventsSinceResponse)(nil), // 3: state.v1.EventsSinceResponse
|
||||
(*TaskEventsRequest)(nil), // 4: state.v1.TaskEventsRequest
|
||||
(*TaskEventsResponse)(nil), // 5: state.v1.TaskEventsResponse
|
||||
(*Event)(nil), // 6: state.v1.Event
|
||||
}
|
||||
var file_state_v1_task_event_proto_depIdxs = []int32{
|
||||
6, // 0: state.v1.InsertEventRequest.event:type_name -> state.v1.Event
|
||||
6, // 1: state.v1.EventsSinceResponse.events:type_name -> state.v1.Event
|
||||
6, // 2: state.v1.TaskEventsResponse.events:type_name -> state.v1.Event
|
||||
0, // 3: state.v1.TaskEventService.InsertEvent:input_type -> state.v1.InsertEventRequest
|
||||
2, // 4: state.v1.TaskEventService.EventsSince:input_type -> state.v1.EventsSinceRequest
|
||||
4, // 5: state.v1.TaskEventService.TaskEvents:input_type -> state.v1.TaskEventsRequest
|
||||
1, // 6: state.v1.TaskEventService.InsertEvent:output_type -> state.v1.InsertEventResponse
|
||||
3, // 7: state.v1.TaskEventService.EventsSince:output_type -> state.v1.EventsSinceResponse
|
||||
5, // 8: state.v1.TaskEventService.TaskEvents:output_type -> state.v1.TaskEventsResponse
|
||||
6, // [6:9] is the sub-list for method output_type
|
||||
3, // [3:6] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_task_event_proto_init() }
|
||||
func file_state_v1_task_event_proto_init() {
|
||||
if File_state_v1_task_event_proto != nil {
|
||||
return
|
||||
}
|
||||
file_state_v1_types_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_task_event_proto_rawDesc), len(file_state_v1_task_event_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_task_event_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_task_event_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_task_event_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_task_event_proto = out.File
|
||||
file_state_v1_task_event_proto_goTypes = nil
|
||||
file_state_v1_task_event_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/task_event.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 (
|
||||
TaskEventService_InsertEvent_FullMethodName = "/state.v1.TaskEventService/InsertEvent"
|
||||
TaskEventService_EventsSince_FullMethodName = "/state.v1.TaskEventService/EventsSince"
|
||||
TaskEventService_TaskEvents_FullMethodName = "/state.v1.TaskEventService/TaskEvents"
|
||||
)
|
||||
|
||||
// TaskEventServiceClient is the client API for TaskEventService 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 TaskEventServiceClient interface {
|
||||
InsertEvent(ctx context.Context, in *InsertEventRequest, opts ...grpc.CallOption) (*InsertEventResponse, error)
|
||||
EventsSince(ctx context.Context, in *EventsSinceRequest, opts ...grpc.CallOption) (*EventsSinceResponse, error)
|
||||
TaskEvents(ctx context.Context, in *TaskEventsRequest, opts ...grpc.CallOption) (*TaskEventsResponse, error)
|
||||
}
|
||||
|
||||
type taskEventServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTaskEventServiceClient(cc grpc.ClientConnInterface) TaskEventServiceClient {
|
||||
return &taskEventServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskEventServiceClient) InsertEvent(ctx context.Context, in *InsertEventRequest, opts ...grpc.CallOption) (*InsertEventResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InsertEventResponse)
|
||||
err := c.cc.Invoke(ctx, TaskEventService_InsertEvent_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskEventServiceClient) EventsSince(ctx context.Context, in *EventsSinceRequest, opts ...grpc.CallOption) (*EventsSinceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(EventsSinceResponse)
|
||||
err := c.cc.Invoke(ctx, TaskEventService_EventsSince_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskEventServiceClient) TaskEvents(ctx context.Context, in *TaskEventsRequest, opts ...grpc.CallOption) (*TaskEventsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TaskEventsResponse)
|
||||
err := c.cc.Invoke(ctx, TaskEventService_TaskEvents_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TaskEventServiceServer is the server API for TaskEventService service.
|
||||
// All implementations must embed UnimplementedTaskEventServiceServer
|
||||
// for forward compatibility.
|
||||
type TaskEventServiceServer interface {
|
||||
InsertEvent(context.Context, *InsertEventRequest) (*InsertEventResponse, error)
|
||||
EventsSince(context.Context, *EventsSinceRequest) (*EventsSinceResponse, error)
|
||||
TaskEvents(context.Context, *TaskEventsRequest) (*TaskEventsResponse, error)
|
||||
mustEmbedUnimplementedTaskEventServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskEventServiceServer 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 UnimplementedTaskEventServiceServer struct{}
|
||||
|
||||
func (UnimplementedTaskEventServiceServer) InsertEvent(context.Context, *InsertEventRequest) (*InsertEventResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InsertEvent not implemented")
|
||||
}
|
||||
func (UnimplementedTaskEventServiceServer) EventsSince(context.Context, *EventsSinceRequest) (*EventsSinceResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method EventsSince not implemented")
|
||||
}
|
||||
func (UnimplementedTaskEventServiceServer) TaskEvents(context.Context, *TaskEventsRequest) (*TaskEventsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method TaskEvents not implemented")
|
||||
}
|
||||
func (UnimplementedTaskEventServiceServer) mustEmbedUnimplementedTaskEventServiceServer() {}
|
||||
func (UnimplementedTaskEventServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTaskEventServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskEventServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTaskEventServiceServer interface {
|
||||
mustEmbedUnimplementedTaskEventServiceServer()
|
||||
}
|
||||
|
||||
func RegisterTaskEventServiceServer(s grpc.ServiceRegistrar, srv TaskEventServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedTaskEventServiceServer 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(&TaskEventService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _TaskEventService_InsertEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InsertEventRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskEventServiceServer).InsertEvent(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskEventService_InsertEvent_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskEventServiceServer).InsertEvent(ctx, req.(*InsertEventRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskEventService_EventsSince_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EventsSinceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskEventServiceServer).EventsSince(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskEventService_EventsSince_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskEventServiceServer).EventsSince(ctx, req.(*EventsSinceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskEventService_TaskEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TaskEventsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskEventServiceServer).TaskEvents(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskEventService_TaskEvents_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskEventServiceServer).TaskEvents(ctx, req.(*TaskEventsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// TaskEventService_ServiceDesc is the grpc.ServiceDesc for TaskEventService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var TaskEventService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.TaskEventService",
|
||||
HandlerType: (*TaskEventServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "InsertEvent",
|
||||
Handler: _TaskEventService_InsertEvent_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EventsSince",
|
||||
Handler: _TaskEventService_EventsSince_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "TaskEvents",
|
||||
Handler: _TaskEventService_TaskEvents_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/task_event.proto",
|
||||
}
|
||||
@@ -0,0 +1,390 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/task_grant.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type RegisterTaskGrantRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
|
||||
LifetimeSeconds int64 `protobuf:"varint,3,opt,name=lifetime_seconds,json=lifetimeSeconds,proto3" json:"lifetime_seconds,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RegisterTaskGrantRequest) Reset() {
|
||||
*x = RegisterTaskGrantRequest{}
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RegisterTaskGrantRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegisterTaskGrantRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RegisterTaskGrantRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegisterTaskGrantRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RegisterTaskGrantRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_grant_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *RegisterTaskGrantRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RegisterTaskGrantRequest) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RegisterTaskGrantRequest) GetLifetimeSeconds() int64 {
|
||||
if x != nil {
|
||||
return x.LifetimeSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type RegisterTaskGrantResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RegisterTaskGrantResponse) Reset() {
|
||||
*x = RegisterTaskGrantResponse{}
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RegisterTaskGrantResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegisterTaskGrantResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RegisterTaskGrantResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegisterTaskGrantResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RegisterTaskGrantResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_grant_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type RevokeTaskGrantRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RevokeTaskGrantRequest) Reset() {
|
||||
*x = RevokeTaskGrantRequest{}
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RevokeTaskGrantRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RevokeTaskGrantRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RevokeTaskGrantRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RevokeTaskGrantRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RevokeTaskGrantRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_grant_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *RevokeTaskGrantRequest) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RevokeTaskGrantResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RevokeTaskGrantResponse) Reset() {
|
||||
*x = RevokeTaskGrantResponse{}
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RevokeTaskGrantResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RevokeTaskGrantResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RevokeTaskGrantResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RevokeTaskGrantResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RevokeTaskGrantResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_grant_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
// ResolveTaskGrantRequest names a run credential; the response is the task
|
||||
// it was issued for.
|
||||
type ResolveTaskGrantRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantRequest) Reset() {
|
||||
*x = ResolveTaskGrantRequest{}
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ResolveTaskGrantRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ResolveTaskGrantRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResolveTaskGrantRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ResolveTaskGrantRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_grant_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantRequest) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ResolveTaskGrantResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
// Canonical execution identity; empty names the instance root RPC route.
|
||||
ExecutionIdentity string `protobuf:"bytes,2,opt,name=execution_identity,json=executionIdentity,proto3" json:"execution_identity,omitempty"`
|
||||
// Canonical principal, including the instance root.
|
||||
PrincipalId string `protobuf:"bytes,3,opt,name=principal_id,json=principalId,proto3" json:"principal_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) Reset() {
|
||||
*x = ResolveTaskGrantResponse{}
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ResolveTaskGrantResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_grant_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResolveTaskGrantResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ResolveTaskGrantResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_grant_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) GetExecutionIdentity() string {
|
||||
if x != nil {
|
||||
return x.ExecutionIdentity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ResolveTaskGrantResponse) GetPrincipalId() string {
|
||||
if x != nil {
|
||||
return x.PrincipalId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_state_v1_task_grant_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_task_grant_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x19state/v1/task_grant.proto\x12\bstate.v1\"t\n" +
|
||||
"\x18RegisterTaskGrantRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x14\n" +
|
||||
"\x05token\x18\x02 \x01(\tR\x05token\x12)\n" +
|
||||
"\x10lifetime_seconds\x18\x03 \x01(\x03R\x0flifetimeSeconds\"\x1b\n" +
|
||||
"\x19RegisterTaskGrantResponse\".\n" +
|
||||
"\x16RevokeTaskGrantRequest\x12\x14\n" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\"\x19\n" +
|
||||
"\x17RevokeTaskGrantResponse\"/\n" +
|
||||
"\x17ResolveTaskGrantRequest\x12\x14\n" +
|
||||
"\x05token\x18\x01 \x01(\tR\x05token\"\x85\x01\n" +
|
||||
"\x18ResolveTaskGrantResponse\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12-\n" +
|
||||
"\x12execution_identity\x18\x02 \x01(\tR\x11executionIdentity\x12!\n" +
|
||||
"\fprincipal_id\x18\x03 \x01(\tR\vprincipalId2\xa3\x02\n" +
|
||||
"\x10TaskGrantService\x12\\\n" +
|
||||
"\x11RegisterTaskGrant\x12\".state.v1.RegisterTaskGrantRequest\x1a#.state.v1.RegisterTaskGrantResponse\x12V\n" +
|
||||
"\x0fRevokeTaskGrant\x12 .state.v1.RevokeTaskGrantRequest\x1a!.state.v1.RevokeTaskGrantResponse\x12Y\n" +
|
||||
"\x10ResolveTaskGrant\x12!.state.v1.ResolveTaskGrantRequest\x1a\".state.v1.ResolveTaskGrantResponseB\xa8\x01\n" +
|
||||
"\fcom.state.v1B\x0eTaskGrantProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_task_grant_proto_rawDescOnce sync.Once
|
||||
file_state_v1_task_grant_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_task_grant_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_task_grant_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_task_grant_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_task_grant_proto_rawDesc), len(file_state_v1_task_grant_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_task_grant_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_task_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_state_v1_task_grant_proto_goTypes = []any{
|
||||
(*RegisterTaskGrantRequest)(nil), // 0: state.v1.RegisterTaskGrantRequest
|
||||
(*RegisterTaskGrantResponse)(nil), // 1: state.v1.RegisterTaskGrantResponse
|
||||
(*RevokeTaskGrantRequest)(nil), // 2: state.v1.RevokeTaskGrantRequest
|
||||
(*RevokeTaskGrantResponse)(nil), // 3: state.v1.RevokeTaskGrantResponse
|
||||
(*ResolveTaskGrantRequest)(nil), // 4: state.v1.ResolveTaskGrantRequest
|
||||
(*ResolveTaskGrantResponse)(nil), // 5: state.v1.ResolveTaskGrantResponse
|
||||
}
|
||||
var file_state_v1_task_grant_proto_depIdxs = []int32{
|
||||
0, // 0: state.v1.TaskGrantService.RegisterTaskGrant:input_type -> state.v1.RegisterTaskGrantRequest
|
||||
2, // 1: state.v1.TaskGrantService.RevokeTaskGrant:input_type -> state.v1.RevokeTaskGrantRequest
|
||||
4, // 2: state.v1.TaskGrantService.ResolveTaskGrant:input_type -> state.v1.ResolveTaskGrantRequest
|
||||
1, // 3: state.v1.TaskGrantService.RegisterTaskGrant:output_type -> state.v1.RegisterTaskGrantResponse
|
||||
3, // 4: state.v1.TaskGrantService.RevokeTaskGrant:output_type -> state.v1.RevokeTaskGrantResponse
|
||||
5, // 5: state.v1.TaskGrantService.ResolveTaskGrant:output_type -> state.v1.ResolveTaskGrantResponse
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_task_grant_proto_init() }
|
||||
func file_state_v1_task_grant_proto_init() {
|
||||
if File_state_v1_task_grant_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_task_grant_proto_rawDesc), len(file_state_v1_task_grant_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_task_grant_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_task_grant_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_task_grant_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_task_grant_proto = out.File
|
||||
file_state_v1_task_grant_proto_goTypes = nil
|
||||
file_state_v1_task_grant_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/task_grant.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 (
|
||||
TaskGrantService_RegisterTaskGrant_FullMethodName = "/state.v1.TaskGrantService/RegisterTaskGrant"
|
||||
TaskGrantService_RevokeTaskGrant_FullMethodName = "/state.v1.TaskGrantService/RevokeTaskGrant"
|
||||
TaskGrantService_ResolveTaskGrant_FullMethodName = "/state.v1.TaskGrantService/ResolveTaskGrant"
|
||||
)
|
||||
|
||||
// TaskGrantServiceClient is the client API for TaskGrantService 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.
|
||||
//
|
||||
// Administrative task credential lifecycle. Worker credentials cannot call these.
|
||||
type TaskGrantServiceClient interface {
|
||||
RegisterTaskGrant(ctx context.Context, in *RegisterTaskGrantRequest, opts ...grpc.CallOption) (*RegisterTaskGrantResponse, error)
|
||||
RevokeTaskGrant(ctx context.Context, in *RevokeTaskGrantRequest, opts ...grpc.CallOption) (*RevokeTaskGrantResponse, error)
|
||||
ResolveTaskGrant(ctx context.Context, in *ResolveTaskGrantRequest, opts ...grpc.CallOption) (*ResolveTaskGrantResponse, error)
|
||||
}
|
||||
|
||||
type taskGrantServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTaskGrantServiceClient(cc grpc.ClientConnInterface) TaskGrantServiceClient {
|
||||
return &taskGrantServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskGrantServiceClient) RegisterTaskGrant(ctx context.Context, in *RegisterTaskGrantRequest, opts ...grpc.CallOption) (*RegisterTaskGrantResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RegisterTaskGrantResponse)
|
||||
err := c.cc.Invoke(ctx, TaskGrantService_RegisterTaskGrant_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskGrantServiceClient) RevokeTaskGrant(ctx context.Context, in *RevokeTaskGrantRequest, opts ...grpc.CallOption) (*RevokeTaskGrantResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RevokeTaskGrantResponse)
|
||||
err := c.cc.Invoke(ctx, TaskGrantService_RevokeTaskGrant_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskGrantServiceClient) ResolveTaskGrant(ctx context.Context, in *ResolveTaskGrantRequest, opts ...grpc.CallOption) (*ResolveTaskGrantResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ResolveTaskGrantResponse)
|
||||
err := c.cc.Invoke(ctx, TaskGrantService_ResolveTaskGrant_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TaskGrantServiceServer is the server API for TaskGrantService service.
|
||||
// All implementations must embed UnimplementedTaskGrantServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Administrative task credential lifecycle. Worker credentials cannot call these.
|
||||
type TaskGrantServiceServer interface {
|
||||
RegisterTaskGrant(context.Context, *RegisterTaskGrantRequest) (*RegisterTaskGrantResponse, error)
|
||||
RevokeTaskGrant(context.Context, *RevokeTaskGrantRequest) (*RevokeTaskGrantResponse, error)
|
||||
ResolveTaskGrant(context.Context, *ResolveTaskGrantRequest) (*ResolveTaskGrantResponse, error)
|
||||
mustEmbedUnimplementedTaskGrantServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskGrantServiceServer 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 UnimplementedTaskGrantServiceServer struct{}
|
||||
|
||||
func (UnimplementedTaskGrantServiceServer) RegisterTaskGrant(context.Context, *RegisterTaskGrantRequest) (*RegisterTaskGrantResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RegisterTaskGrant not implemented")
|
||||
}
|
||||
func (UnimplementedTaskGrantServiceServer) RevokeTaskGrant(context.Context, *RevokeTaskGrantRequest) (*RevokeTaskGrantResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RevokeTaskGrant not implemented")
|
||||
}
|
||||
func (UnimplementedTaskGrantServiceServer) ResolveTaskGrant(context.Context, *ResolveTaskGrantRequest) (*ResolveTaskGrantResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ResolveTaskGrant not implemented")
|
||||
}
|
||||
func (UnimplementedTaskGrantServiceServer) mustEmbedUnimplementedTaskGrantServiceServer() {}
|
||||
func (UnimplementedTaskGrantServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTaskGrantServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskGrantServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTaskGrantServiceServer interface {
|
||||
mustEmbedUnimplementedTaskGrantServiceServer()
|
||||
}
|
||||
|
||||
func RegisterTaskGrantServiceServer(s grpc.ServiceRegistrar, srv TaskGrantServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedTaskGrantServiceServer 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(&TaskGrantService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _TaskGrantService_RegisterTaskGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterTaskGrantRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskGrantServiceServer).RegisterTaskGrant(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskGrantService_RegisterTaskGrant_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskGrantServiceServer).RegisterTaskGrant(ctx, req.(*RegisterTaskGrantRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskGrantService_RevokeTaskGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RevokeTaskGrantRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskGrantServiceServer).RevokeTaskGrant(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskGrantService_RevokeTaskGrant_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskGrantServiceServer).RevokeTaskGrant(ctx, req.(*RevokeTaskGrantRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskGrantService_ResolveTaskGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ResolveTaskGrantRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskGrantServiceServer).ResolveTaskGrant(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskGrantService_ResolveTaskGrant_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskGrantServiceServer).ResolveTaskGrant(ctx, req.(*ResolveTaskGrantRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// TaskGrantService_ServiceDesc is the grpc.ServiceDesc for TaskGrantService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var TaskGrantService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.TaskGrantService",
|
||||
HandlerType: (*TaskGrantServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "RegisterTaskGrant",
|
||||
Handler: _TaskGrantService_RegisterTaskGrant_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RevokeTaskGrant",
|
||||
Handler: _TaskGrantService_RevokeTaskGrant_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ResolveTaskGrant",
|
||||
Handler: _TaskGrantService_ResolveTaskGrant_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "state/v1/task_grant.proto",
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,566 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/task_log.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// TaskLogEntry mirrors internal/logging.Entry: one decoded log line. fields
|
||||
// carries every remaining key as a JSON object string, the same way Event
|
||||
// carries its data, so structured context survives the hop without this
|
||||
// contract having to know what a call site attached.
|
||||
type TaskLogEntry struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Time *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"`
|
||||
Level string `protobuf:"bytes,3,opt,name=level,proto3" json:"level,omitempty"`
|
||||
Msg string `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
FieldsJson string `protobuf:"bytes,5,opt,name=fields_json,json=fieldsJson,proto3" json:"fields_json,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *TaskLogEntry) Reset() {
|
||||
*x = TaskLogEntry{}
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *TaskLogEntry) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskLogEntry) ProtoMessage() {}
|
||||
|
||||
func (x *TaskLogEntry) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TaskLogEntry.ProtoReflect.Descriptor instead.
|
||||
func (*TaskLogEntry) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_log_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TaskLogEntry) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TaskLogEntry) GetTime() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.Time
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *TaskLogEntry) GetLevel() string {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TaskLogEntry) GetMsg() string {
|
||||
if x != nil {
|
||||
return x.Msg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *TaskLogEntry) GetFieldsJson() string {
|
||||
if x != nil {
|
||||
return x.FieldsJson
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// ReadTaskLog returns a page of one task attempt's decoded log. attempt is the
|
||||
// attempt the caller resolved (the dashboard sends the task's current attempt
|
||||
// when the request omitted one). levels, component, contains, since and until
|
||||
// carry the whole query the logging package's Tail accepts -- the wire mirrors
|
||||
// that query rather than a subset of it, so a filter cannot silently stop
|
||||
// working by crossing the boundary. limit is caller-capped
|
||||
// (docs/prds/state-store-contract.md §8: the log cap is 2000).
|
||||
type ReadTaskLogRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Attempt int64 `protobuf:"varint,2,opt,name=attempt,proto3" json:"attempt,omitempty"`
|
||||
Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||
Levels []string `protobuf:"bytes,4,rep,name=levels,proto3" json:"levels,omitempty"`
|
||||
Component string `protobuf:"bytes,5,opt,name=component,proto3" json:"component,omitempty"`
|
||||
Contains string `protobuf:"bytes,6,opt,name=contains,proto3" json:"contains,omitempty"`
|
||||
Since *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=since,proto3" json:"since,omitempty"`
|
||||
Until *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=until,proto3" json:"until,omitempty"`
|
||||
// stage filters on an entry's own "stage" field. Only entries a stage
|
||||
// tagged carry one -- agent and tool output is logged without a stage, so a
|
||||
// stage filter narrows the file rather than covering it. Empty means any.
|
||||
Stage string `protobuf:"bytes,9,opt,name=stage,proto3" json:"stage,omitempty"`
|
||||
// before_id is the byte-offset cursor a previous page returned as cursor: the
|
||||
// read returns the most recent matching entries ending at or before it. Zero
|
||||
// reads the tail, which is the page the dashboard opens on.
|
||||
BeforeId int64 `protobuf:"varint,10,opt,name=before_id,json=beforeId,proto3" json:"before_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) Reset() {
|
||||
*x = ReadTaskLogRequest{}
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ReadTaskLogRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ReadTaskLogRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ReadTaskLogRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ReadTaskLogRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_log_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetAttempt() int64 {
|
||||
if x != nil {
|
||||
return x.Attempt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetLimit() int64 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetLevels() []string {
|
||||
if x != nil {
|
||||
return x.Levels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetComponent() string {
|
||||
if x != nil {
|
||||
return x.Component
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetContains() string {
|
||||
if x != nil {
|
||||
return x.Contains
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetSince() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.Since
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetUntil() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.Until
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetStage() string {
|
||||
if x != nil {
|
||||
return x.Stage
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetBeforeId() int64 {
|
||||
if x != nil {
|
||||
return x.BeforeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// found=false is not an error: the task has no log file for that attempt.
|
||||
// That is a different condition from a process that cannot read logs at all
|
||||
// (codes.Unavailable), and the dashboard reports them differently.
|
||||
type ReadTaskLogResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Entries []*TaskLogEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
|
||||
Truncated bool `protobuf:"varint,2,opt,name=truncated,proto3" json:"truncated,omitempty"`
|
||||
Attempt int64 `protobuf:"varint,3,opt,name=attempt,proto3" json:"attempt,omitempty"`
|
||||
Found bool `protobuf:"varint,4,opt,name=found,proto3" json:"found,omitempty"`
|
||||
Components []string `protobuf:"bytes,5,rep,name=components,proto3" json:"components,omitempty"`
|
||||
// file is the path read, so the page can name where the log came from. It
|
||||
// is the state directory's own layout, reported to an already-authenticated
|
||||
// operator; no caller is expected to open it.
|
||||
File string `protobuf:"bytes,6,opt,name=file,proto3" json:"file,omitempty"`
|
||||
// more_available reports matching entries did not fit in this page; cursor
|
||||
// is the before_id for the next older one. truncated is separate: it means
|
||||
// the log is larger than the readable scan window, so its oldest entries
|
||||
// cannot be reached by paging at all.
|
||||
MoreAvailable bool `protobuf:"varint,7,opt,name=more_available,json=moreAvailable,proto3" json:"more_available,omitempty"`
|
||||
Cursor int64 `protobuf:"varint,8,opt,name=cursor,proto3" json:"cursor,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) Reset() {
|
||||
*x = ReadTaskLogResponse{}
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ReadTaskLogResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ReadTaskLogResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ReadTaskLogResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ReadTaskLogResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_log_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetEntries() []*TaskLogEntry {
|
||||
if x != nil {
|
||||
return x.Entries
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetTruncated() bool {
|
||||
if x != nil {
|
||||
return x.Truncated
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetAttempt() int64 {
|
||||
if x != nil {
|
||||
return x.Attempt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetFound() bool {
|
||||
if x != nil {
|
||||
return x.Found
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetComponents() []string {
|
||||
if x != nil {
|
||||
return x.Components
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetFile() string {
|
||||
if x != nil {
|
||||
return x.File
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetMoreAvailable() bool {
|
||||
if x != nil {
|
||||
return x.MoreAvailable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetCursor() int64 {
|
||||
if x != nil {
|
||||
return x.Cursor
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// StreamTaskLogContent returns one attempt's log verbatim, for a download. The
|
||||
// bytes are the file's own JSONL, not a re-encoding of it: this contract
|
||||
// transports the log, it does not restate the format. found=false, with no
|
||||
// chunks, means the attempt has no log file -- not an error.
|
||||
type StreamTaskLogContentRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Attempt int64 `protobuf:"varint,2,opt,name=attempt,proto3" json:"attempt,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentRequest) Reset() {
|
||||
*x = StreamTaskLogContentRequest{}
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamTaskLogContentRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StreamTaskLogContentRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamTaskLogContentRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StreamTaskLogContentRequest) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_log_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentRequest) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentRequest) GetAttempt() int64 {
|
||||
if x != nil {
|
||||
return x.Attempt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type StreamTaskLogContentResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"`
|
||||
Attempt int64 `protobuf:"varint,2,opt,name=attempt,proto3" json:"attempt,omitempty"`
|
||||
Found bool `protobuf:"varint,3,opt,name=found,proto3" json:"found,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentResponse) Reset() {
|
||||
*x = StreamTaskLogContentResponse{}
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StreamTaskLogContentResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StreamTaskLogContentResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_task_log_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StreamTaskLogContentResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StreamTaskLogContentResponse) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_task_log_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentResponse) GetChunk() []byte {
|
||||
if x != nil {
|
||||
return x.Chunk
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentResponse) GetAttempt() int64 {
|
||||
if x != nil {
|
||||
return x.Attempt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StreamTaskLogContentResponse) GetFound() bool {
|
||||
if x != nil {
|
||||
return x.Found
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_state_v1_task_log_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_task_log_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x17state/v1/task_log.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x97\x01\n" +
|
||||
"\fTaskLogEntry\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12.\n" +
|
||||
"\x04time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x12\x14\n" +
|
||||
"\x05level\x18\x03 \x01(\tR\x05level\x12\x10\n" +
|
||||
"\x03msg\x18\x04 \x01(\tR\x03msg\x12\x1f\n" +
|
||||
"\vfields_json\x18\x05 \x01(\tR\n" +
|
||||
"fieldsJson\"\xc6\x02\n" +
|
||||
"\x12ReadTaskLogRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x18\n" +
|
||||
"\aattempt\x18\x02 \x01(\x03R\aattempt\x12\x14\n" +
|
||||
"\x05limit\x18\x03 \x01(\x03R\x05limit\x12\x16\n" +
|
||||
"\x06levels\x18\x04 \x03(\tR\x06levels\x12\x1c\n" +
|
||||
"\tcomponent\x18\x05 \x01(\tR\tcomponent\x12\x1a\n" +
|
||||
"\bcontains\x18\x06 \x01(\tR\bcontains\x120\n" +
|
||||
"\x05since\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\x05since\x120\n" +
|
||||
"\x05until\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\x05until\x12\x14\n" +
|
||||
"\x05stage\x18\t \x01(\tR\x05stage\x12\x1b\n" +
|
||||
"\tbefore_id\x18\n" +
|
||||
" \x01(\x03R\bbeforeId\"\x88\x02\n" +
|
||||
"\x13ReadTaskLogResponse\x120\n" +
|
||||
"\aentries\x18\x01 \x03(\v2\x16.state.v1.TaskLogEntryR\aentries\x12\x1c\n" +
|
||||
"\ttruncated\x18\x02 \x01(\bR\ttruncated\x12\x18\n" +
|
||||
"\aattempt\x18\x03 \x01(\x03R\aattempt\x12\x14\n" +
|
||||
"\x05found\x18\x04 \x01(\bR\x05found\x12\x1e\n" +
|
||||
"\n" +
|
||||
"components\x18\x05 \x03(\tR\n" +
|
||||
"components\x12\x12\n" +
|
||||
"\x04file\x18\x06 \x01(\tR\x04file\x12%\n" +
|
||||
"\x0emore_available\x18\a \x01(\bR\rmoreAvailable\x12\x16\n" +
|
||||
"\x06cursor\x18\b \x01(\x03R\x06cursor\"P\n" +
|
||||
"\x1bStreamTaskLogContentRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x18\n" +
|
||||
"\aattempt\x18\x02 \x01(\x03R\aattempt\"d\n" +
|
||||
"\x1cStreamTaskLogContentResponse\x12\x14\n" +
|
||||
"\x05chunk\x18\x01 \x01(\fR\x05chunk\x12\x18\n" +
|
||||
"\aattempt\x18\x02 \x01(\x03R\aattempt\x12\x14\n" +
|
||||
"\x05found\x18\x03 \x01(\bR\x05found2\xc5\x01\n" +
|
||||
"\x0eTaskLogService\x12J\n" +
|
||||
"\vReadTaskLog\x12\x1c.state.v1.ReadTaskLogRequest\x1a\x1d.state.v1.ReadTaskLogResponse\x12g\n" +
|
||||
"\x14StreamTaskLogContent\x12%.state.v1.StreamTaskLogContentRequest\x1a&.state.v1.StreamTaskLogContentResponse0\x01B\xa6\x01\n" +
|
||||
"\fcom.state.v1B\fTaskLogProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_task_log_proto_rawDescOnce sync.Once
|
||||
file_state_v1_task_log_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_task_log_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_task_log_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_task_log_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_task_log_proto_rawDesc), len(file_state_v1_task_log_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_task_log_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_task_log_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_state_v1_task_log_proto_goTypes = []any{
|
||||
(*TaskLogEntry)(nil), // 0: state.v1.TaskLogEntry
|
||||
(*ReadTaskLogRequest)(nil), // 1: state.v1.ReadTaskLogRequest
|
||||
(*ReadTaskLogResponse)(nil), // 2: state.v1.ReadTaskLogResponse
|
||||
(*StreamTaskLogContentRequest)(nil), // 3: state.v1.StreamTaskLogContentRequest
|
||||
(*StreamTaskLogContentResponse)(nil), // 4: state.v1.StreamTaskLogContentResponse
|
||||
(*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp
|
||||
}
|
||||
var file_state_v1_task_log_proto_depIdxs = []int32{
|
||||
5, // 0: state.v1.TaskLogEntry.time:type_name -> google.protobuf.Timestamp
|
||||
5, // 1: state.v1.ReadTaskLogRequest.since:type_name -> google.protobuf.Timestamp
|
||||
5, // 2: state.v1.ReadTaskLogRequest.until:type_name -> google.protobuf.Timestamp
|
||||
0, // 3: state.v1.ReadTaskLogResponse.entries:type_name -> state.v1.TaskLogEntry
|
||||
1, // 4: state.v1.TaskLogService.ReadTaskLog:input_type -> state.v1.ReadTaskLogRequest
|
||||
3, // 5: state.v1.TaskLogService.StreamTaskLogContent:input_type -> state.v1.StreamTaskLogContentRequest
|
||||
2, // 6: state.v1.TaskLogService.ReadTaskLog:output_type -> state.v1.ReadTaskLogResponse
|
||||
4, // 7: state.v1.TaskLogService.StreamTaskLogContent:output_type -> state.v1.StreamTaskLogContentResponse
|
||||
6, // [6:8] is the sub-list for method output_type
|
||||
4, // [4:6] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_task_log_proto_init() }
|
||||
func file_state_v1_task_log_proto_init() {
|
||||
if File_state_v1_task_log_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_task_log_proto_rawDesc), len(file_state_v1_task_log_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_state_v1_task_log_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_task_log_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_task_log_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_task_log_proto = out.File
|
||||
file_state_v1_task_log_proto_goTypes = nil
|
||||
file_state_v1_task_log_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: state/v1/task_log.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 (
|
||||
TaskLogService_ReadTaskLog_FullMethodName = "/state.v1.TaskLogService/ReadTaskLog"
|
||||
TaskLogService_StreamTaskLogContent_FullMethodName = "/state.v1.TaskLogService/StreamTaskLogContent"
|
||||
)
|
||||
|
||||
// TaskLogServiceClient is the client API for TaskLogService 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.
|
||||
//
|
||||
// One task attempt's persisted log. Task log files live in the state
|
||||
// directory this process owns, so the dashboard reads them over this contract
|
||||
// rather than opening them itself
|
||||
// (deployments/README.md).
|
||||
type TaskLogServiceClient interface {
|
||||
ReadTaskLog(ctx context.Context, in *ReadTaskLogRequest, opts ...grpc.CallOption) (*ReadTaskLogResponse, error)
|
||||
// StreamTaskLogContent returns one attempt's log verbatim, one chunk per
|
||||
// message, for a download. A log file is unbounded input (it rotates at
|
||||
// DefaultMaxSizeMB), so a unary response would exceed gRPC's 4MiB message
|
||||
// cap on a real log -- the same reason ListCaptures was superseded by
|
||||
// StreamCaptures.
|
||||
StreamTaskLogContent(ctx context.Context, in *StreamTaskLogContentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamTaskLogContentResponse], error)
|
||||
}
|
||||
|
||||
type taskLogServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTaskLogServiceClient(cc grpc.ClientConnInterface) TaskLogServiceClient {
|
||||
return &taskLogServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskLogServiceClient) ReadTaskLog(ctx context.Context, in *ReadTaskLogRequest, opts ...grpc.CallOption) (*ReadTaskLogResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ReadTaskLogResponse)
|
||||
err := c.cc.Invoke(ctx, TaskLogService_ReadTaskLog_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskLogServiceClient) StreamTaskLogContent(ctx context.Context, in *StreamTaskLogContentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamTaskLogContentResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &TaskLogService_ServiceDesc.Streams[0], TaskLogService_StreamTaskLogContent_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[StreamTaskLogContentRequest, StreamTaskLogContentResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type TaskLogService_StreamTaskLogContentClient = grpc.ServerStreamingClient[StreamTaskLogContentResponse]
|
||||
|
||||
// TaskLogServiceServer is the server API for TaskLogService service.
|
||||
// All implementations must embed UnimplementedTaskLogServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// One task attempt's persisted log. Task log files live in the state
|
||||
// directory this process owns, so the dashboard reads them over this contract
|
||||
// rather than opening them itself
|
||||
// (deployments/README.md).
|
||||
type TaskLogServiceServer interface {
|
||||
ReadTaskLog(context.Context, *ReadTaskLogRequest) (*ReadTaskLogResponse, error)
|
||||
// StreamTaskLogContent returns one attempt's log verbatim, one chunk per
|
||||
// message, for a download. A log file is unbounded input (it rotates at
|
||||
// DefaultMaxSizeMB), so a unary response would exceed gRPC's 4MiB message
|
||||
// cap on a real log -- the same reason ListCaptures was superseded by
|
||||
// StreamCaptures.
|
||||
StreamTaskLogContent(*StreamTaskLogContentRequest, grpc.ServerStreamingServer[StreamTaskLogContentResponse]) error
|
||||
mustEmbedUnimplementedTaskLogServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskLogServiceServer 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 UnimplementedTaskLogServiceServer struct{}
|
||||
|
||||
func (UnimplementedTaskLogServiceServer) ReadTaskLog(context.Context, *ReadTaskLogRequest) (*ReadTaskLogResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ReadTaskLog not implemented")
|
||||
}
|
||||
func (UnimplementedTaskLogServiceServer) StreamTaskLogContent(*StreamTaskLogContentRequest, grpc.ServerStreamingServer[StreamTaskLogContentResponse]) error {
|
||||
return status.Error(codes.Unimplemented, "method StreamTaskLogContent not implemented")
|
||||
}
|
||||
func (UnimplementedTaskLogServiceServer) mustEmbedUnimplementedTaskLogServiceServer() {}
|
||||
func (UnimplementedTaskLogServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTaskLogServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskLogServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTaskLogServiceServer interface {
|
||||
mustEmbedUnimplementedTaskLogServiceServer()
|
||||
}
|
||||
|
||||
func RegisterTaskLogServiceServer(s grpc.ServiceRegistrar, srv TaskLogServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedTaskLogServiceServer 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(&TaskLogService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _TaskLogService_ReadTaskLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ReadTaskLogRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskLogServiceServer).ReadTaskLog(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: TaskLogService_ReadTaskLog_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskLogServiceServer).ReadTaskLog(ctx, req.(*ReadTaskLogRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _TaskLogService_StreamTaskLogContent_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(StreamTaskLogContentRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(TaskLogServiceServer).StreamTaskLogContent(m, &grpc.GenericServerStream[StreamTaskLogContentRequest, StreamTaskLogContentResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type TaskLogService_StreamTaskLogContentServer = grpc.ServerStreamingServer[StreamTaskLogContentResponse]
|
||||
|
||||
// TaskLogService_ServiceDesc is the grpc.ServiceDesc for TaskLogService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var TaskLogService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "state.v1.TaskLogService",
|
||||
HandlerType: (*TaskLogServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ReadTaskLog",
|
||||
Handler: _TaskLogService_ReadTaskLog_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "StreamTaskLogContent",
|
||||
Handler: _TaskLogService_StreamTaskLogContent_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "state/v1/task_log.proto",
|
||||
}
|
||||
@@ -0,0 +1,927 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc (unknown)
|
||||
// source: state/v1/types.proto
|
||||
|
||||
package statev1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Identity struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
|
||||
DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
|
||||
Lifecycle string `protobuf:"bytes,4,opt,name=lifecycle,proto3" json:"lifecycle,omitempty"`
|
||||
Version int64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Identity) Reset() {
|
||||
*x = Identity{}
|
||||
mi := &file_state_v1_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Identity) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Identity) ProtoMessage() {}
|
||||
|
||||
func (x *Identity) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_types_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Identity.ProtoReflect.Descriptor instead.
|
||||
func (*Identity) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Identity) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Identity) GetKind() string {
|
||||
if x != nil {
|
||||
return x.Kind
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Identity) GetDisplayName() string {
|
||||
if x != nil {
|
||||
return x.DisplayName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Identity) GetLifecycle() string {
|
||||
if x != nil {
|
||||
return x.Lifecycle
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Identity) GetVersion() int64 {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Identity) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Identity) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Task mirrors internal/domain/workflow.Task.
|
||||
type Task struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
|
||||
Repo string `protobuf:"bytes,3,opt,name=repo,proto3" json:"repo,omitempty"`
|
||||
IssueNumber int64 `protobuf:"varint,4,opt,name=issue_number,json=issueNumber,proto3" json:"issue_number,omitempty"`
|
||||
Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Body string `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"`
|
||||
Labels string `protobuf:"bytes,7,opt,name=labels,proto3" json:"labels,omitempty"`
|
||||
Status string `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"`
|
||||
Workflow string `protobuf:"bytes,9,opt,name=workflow,proto3" json:"workflow,omitempty"`
|
||||
// Retired: the per-task "current stage" column was overwritten as
|
||||
// workflow.Run advanced and carried no history. step_executions is the
|
||||
// durable per-step record now (docs/prds/execution-tree-state-machine.md);
|
||||
// ListSteps is its read.
|
||||
//
|
||||
// Deprecated: Marked as deprecated in state/v1/types.proto.
|
||||
Stage string `protobuf:"bytes,10,opt,name=stage,proto3" json:"stage,omitempty"`
|
||||
Branch string `protobuf:"bytes,11,opt,name=branch,proto3" json:"branch,omitempty"`
|
||||
Plan string `protobuf:"bytes,12,opt,name=plan,proto3" json:"plan,omitempty"`
|
||||
Notes string `protobuf:"bytes,13,opt,name=notes,proto3" json:"notes,omitempty"`
|
||||
PrNumber int64 `protobuf:"varint,14,opt,name=pr_number,json=prNumber,proto3" json:"pr_number,omitempty"`
|
||||
TokensUsed int64 `protobuf:"varint,15,opt,name=tokens_used,json=tokensUsed,proto3" json:"tokens_used,omitempty"`
|
||||
Iterations int64 `protobuf:"varint,16,opt,name=iterations,proto3" json:"iterations,omitempty"`
|
||||
Attempt int64 `protobuf:"varint,17,opt,name=attempt,proto3" json:"attempt,omitempty"`
|
||||
ParkReason string `protobuf:"bytes,18,opt,name=park_reason,json=parkReason,proto3" json:"park_reason,omitempty"`
|
||||
RetryCount int64 `protobuf:"varint,19,opt,name=retry_count,json=retryCount,proto3" json:"retry_count,omitempty"`
|
||||
WatchCommentId int64 `protobuf:"varint,20,opt,name=watch_comment_id,json=watchCommentId,proto3" json:"watch_comment_id,omitempty"`
|
||||
Source string `protobuf:"bytes,21,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Identity string `protobuf:"bytes,22,opt,name=identity,proto3" json:"identity,omitempty"`
|
||||
BindingId string `protobuf:"bytes,23,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"`
|
||||
BindingVersion int64 `protobuf:"varint,24,opt,name=binding_version,json=bindingVersion,proto3" json:"binding_version,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,25,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,26,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
// review_payload is the JSON-encoded review unit the remediate workflow's
|
||||
// current run must address (docs/prds/pr-review-remediation.md decision 4).
|
||||
ReviewPayload string `protobuf:"bytes,27,opt,name=review_payload,json=reviewPayload,proto3" json:"review_payload,omitempty"`
|
||||
// The workflow pin: the exact definition version this run started with.
|
||||
// It has to cross the wire for the daemon's digest guard to hold, because
|
||||
// a retry reads the task back over this contract before deciding whether
|
||||
// to reuse the pinned YAML (docs/prds/runtime-control-plane.md:95).
|
||||
WorkflowDefinitionVersion int64 `protobuf:"varint,28,opt,name=workflow_definition_version,json=workflowDefinitionVersion,proto3" json:"workflow_definition_version,omitempty"`
|
||||
WorkflowDefinitionDigest string `protobuf:"bytes,29,opt,name=workflow_definition_digest,json=workflowDefinitionDigest,proto3" json:"workflow_definition_digest,omitempty"`
|
||||
WorkflowDefinitionYaml string `protobuf:"bytes,30,opt,name=workflow_definition_yaml,json=workflowDefinitionYaml,proto3" json:"workflow_definition_yaml,omitempty"`
|
||||
// review_cursor is the poll backstop's high-water mark over forge review
|
||||
// IDs for this task. It is separate from watch_comment_id (the review-
|
||||
// comment cursor) because the two forge sequences are independent; one
|
||||
// combined cursor would silently skip reviews once a larger comment ID
|
||||
// landed (docs/prds/pr-review-remediation.md decision 2).
|
||||
ReviewCursor int64 `protobuf:"varint,31,opt,name=review_cursor,json=reviewCursor,proto3" json:"review_cursor,omitempty"`
|
||||
// park_class is the producer-recorded answer to "what kind of
|
||||
// intervention does this park need?" (taskstate.ParkClass:
|
||||
// needs_decision, transient, terminal). Store-side normalization makes
|
||||
// empty and unknown values needs_decision, so the class is advisory on
|
||||
// the wire and authoritative only as recorded at the park site.
|
||||
ParkClass string `protobuf:"bytes,32,opt,name=park_class,json=parkClass,proto3" json:"park_class,omitempty"`
|
||||
// remediation_rounds counts review-triggered remediation rounds
|
||||
// separately from retry_count, so an operator's manual retries no
|
||||
// longer draw down the review-remediation budget (and vice versa).
|
||||
RemediationRounds int32 `protobuf:"varint,33,opt,name=remediation_rounds,json=remediationRounds,proto3" json:"remediation_rounds,omitempty"`
|
||||
// inputs_json is the JSON object of workflow inputs a binding dispatch
|
||||
// resolved (task.EncodeInputs); empty for a task no binding started.
|
||||
InputsJson string `protobuf:"bytes,34,opt,name=inputs_json,json=inputsJson,proto3" json:"inputs_json,omitempty"`
|
||||
// org is the org the task belongs to, derived store-side from the task's
|
||||
// identity when the row is written; a task of a single-operator install
|
||||
// belongs to the default org (docs/prds/orgs-and-access.md).
|
||||
Org string `protobuf:"bytes,35,opt,name=org,proto3" json:"org,omitempty"`
|
||||
// The workflow.call linkage (docs/prds/workflow-calls.md): the task whose
|
||||
// workflow.call step started this one (0 on a root run) and how many
|
||||
// call hops this row is from that root. Columns default, so an older
|
||||
// writer reads as a depth-0 root run.
|
||||
CallParentTaskId int64 `protobuf:"varint,36,opt,name=call_parent_task_id,json=callParentTaskId,proto3" json:"call_parent_task_id,omitempty"`
|
||||
CallDepth int32 `protobuf:"varint,37,opt,name=call_depth,json=callDepth,proto3" json:"call_depth,omitempty"`
|
||||
// outputs_json is the JSON object of declared-output values this run wrote
|
||||
// (task.EncodeOutputs), empty for a run that wrote none. The container's
|
||||
// Update sends the whole row, so a column the message cannot carry is a
|
||||
// column that write drops (docs/prds/workflow-call-outputs.md, "Storage and
|
||||
// wire").
|
||||
OutputsJson string `protobuf:"bytes,38,opt,name=outputs_json,json=outputsJson,proto3" json:"outputs_json,omitempty"`
|
||||
// review_gate is the operator-approval gate's whole conversation with the
|
||||
// operator (docs/prds/pr-review-operator-response.md): the offer the gate
|
||||
// wrote before waiting, and the answer the response path filled in. It is
|
||||
// opaque here -- internal/domain/workflow/prreview owns the encoding -- but
|
||||
// it must cross so the dashboard can render the offer and the resumed run
|
||||
// can read the answer.
|
||||
ReviewGate string `protobuf:"bytes,39,opt,name=review_gate,json=reviewGate,proto3" json:"review_gate,omitempty"`
|
||||
// rereview_rounds counts granted operator re-reviews, capped by
|
||||
// prreview.MaxRereviewRounds in the guarded response write. It is separate
|
||||
// from retry_count and remediation_rounds for the same reason those are
|
||||
// separate from each other.
|
||||
RereviewRounds int64 `protobuf:"varint,40,opt,name=rereview_rounds,json=rereviewRounds,proto3" json:"rereview_rounds,omitempty"`
|
||||
// retry_mode is the operator's worktree choice for the next dispatch
|
||||
// (taskstate.RetryMode: refresh_onto_base, continue_pushed_work). The retry
|
||||
// action writes it and the daemon's prepareWorkspace reads it, so it must
|
||||
// cross the wire for a retry to land on the source the operator chose. The
|
||||
// empty string reads as refresh_onto_base.
|
||||
RetryMode string `protobuf:"bytes,41,opt,name=retry_mode,json=retryMode,proto3" json:"retry_mode,omitempty"`
|
||||
// resume_from is the stage the next attempt starts at; empty runs every
|
||||
// stage. resume_results are the step results (JSON) it starts with.
|
||||
ResumeFrom string `protobuf:"bytes,42,opt,name=resume_from,json=resumeFrom,proto3" json:"resume_from,omitempty"`
|
||||
ResumeResults []byte `protobuf:"bytes,43,opt,name=resume_results,json=resumeResults,proto3" json:"resume_results,omitempty"`
|
||||
// origin names the conversation that created the task; empty for none.
|
||||
Origin string `protobuf:"bytes,44,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
// workspace is the workspace of its org the task belongs to; read-only
|
||||
// here.
|
||||
Workspace string `protobuf:"bytes,45,opt,name=workspace,proto3" json:"workspace,omitempty"`
|
||||
// binding_signature and binding_addr are the signature result and address
|
||||
// of the captured event that started a binding task.
|
||||
BindingSignature string `protobuf:"bytes,46,opt,name=binding_signature,json=bindingSignature,proto3" json:"binding_signature,omitempty"`
|
||||
BindingAddr string `protobuf:"bytes,47,opt,name=binding_addr,json=bindingAddr,proto3" json:"binding_addr,omitempty"`
|
||||
// park_blocker names what a parked task is missing (taskstate.Blocker),
|
||||
// recorded at the park site; empty when the park has no known fix.
|
||||
ParkBlocker string `protobuf:"bytes,48,opt,name=park_blocker,json=parkBlocker,proto3" json:"park_blocker,omitempty"`
|
||||
// plan_document is the structured plan (JSON) plan was rendered from.
|
||||
PlanDocument string `protobuf:"bytes,50,opt,name=plan_document,json=planDocument,proto3" json:"plan_document,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Task) Reset() {
|
||||
*x = Task{}
|
||||
mi := &file_state_v1_types_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Task) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Task) ProtoMessage() {}
|
||||
|
||||
func (x *Task) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_types_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Task.ProtoReflect.Descriptor instead.
|
||||
func (*Task) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_types_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Task) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetOwner() string {
|
||||
if x != nil {
|
||||
return x.Owner
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetRepo() string {
|
||||
if x != nil {
|
||||
return x.Repo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetIssueNumber() int64 {
|
||||
if x != nil {
|
||||
return x.IssueNumber
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetBody() string {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetLabels() string {
|
||||
if x != nil {
|
||||
return x.Labels
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetStatus() string {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetWorkflow() string {
|
||||
if x != nil {
|
||||
return x.Workflow
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Deprecated: Marked as deprecated in state/v1/types.proto.
|
||||
func (x *Task) GetStage() string {
|
||||
if x != nil {
|
||||
return x.Stage
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetBranch() string {
|
||||
if x != nil {
|
||||
return x.Branch
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetPlan() string {
|
||||
if x != nil {
|
||||
return x.Plan
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetNotes() string {
|
||||
if x != nil {
|
||||
return x.Notes
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetPrNumber() int64 {
|
||||
if x != nil {
|
||||
return x.PrNumber
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetTokensUsed() int64 {
|
||||
if x != nil {
|
||||
return x.TokensUsed
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetIterations() int64 {
|
||||
if x != nil {
|
||||
return x.Iterations
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetAttempt() int64 {
|
||||
if x != nil {
|
||||
return x.Attempt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetParkReason() string {
|
||||
if x != nil {
|
||||
return x.ParkReason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetRetryCount() int64 {
|
||||
if x != nil {
|
||||
return x.RetryCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetWatchCommentId() int64 {
|
||||
if x != nil {
|
||||
return x.WatchCommentId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetSource() string {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetIdentity() string {
|
||||
if x != nil {
|
||||
return x.Identity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetBindingId() string {
|
||||
if x != nil {
|
||||
return x.BindingId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetBindingVersion() int64 {
|
||||
if x != nil {
|
||||
return x.BindingVersion
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetCreatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Task) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Task) GetReviewPayload() string {
|
||||
if x != nil {
|
||||
return x.ReviewPayload
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetWorkflowDefinitionVersion() int64 {
|
||||
if x != nil {
|
||||
return x.WorkflowDefinitionVersion
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetWorkflowDefinitionDigest() string {
|
||||
if x != nil {
|
||||
return x.WorkflowDefinitionDigest
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetWorkflowDefinitionYaml() string {
|
||||
if x != nil {
|
||||
return x.WorkflowDefinitionYaml
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetReviewCursor() int64 {
|
||||
if x != nil {
|
||||
return x.ReviewCursor
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetParkClass() string {
|
||||
if x != nil {
|
||||
return x.ParkClass
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetRemediationRounds() int32 {
|
||||
if x != nil {
|
||||
return x.RemediationRounds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetInputsJson() string {
|
||||
if x != nil {
|
||||
return x.InputsJson
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetOrg() string {
|
||||
if x != nil {
|
||||
return x.Org
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetCallParentTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.CallParentTaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetCallDepth() int32 {
|
||||
if x != nil {
|
||||
return x.CallDepth
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetOutputsJson() string {
|
||||
if x != nil {
|
||||
return x.OutputsJson
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetReviewGate() string {
|
||||
if x != nil {
|
||||
return x.ReviewGate
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetRereviewRounds() int64 {
|
||||
if x != nil {
|
||||
return x.RereviewRounds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Task) GetRetryMode() string {
|
||||
if x != nil {
|
||||
return x.RetryMode
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetResumeFrom() string {
|
||||
if x != nil {
|
||||
return x.ResumeFrom
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetResumeResults() []byte {
|
||||
if x != nil {
|
||||
return x.ResumeResults
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Task) GetOrigin() string {
|
||||
if x != nil {
|
||||
return x.Origin
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetWorkspace() string {
|
||||
if x != nil {
|
||||
return x.Workspace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetBindingSignature() string {
|
||||
if x != nil {
|
||||
return x.BindingSignature
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetBindingAddr() string {
|
||||
if x != nil {
|
||||
return x.BindingAddr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetParkBlocker() string {
|
||||
if x != nil {
|
||||
return x.ParkBlocker
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Task) GetPlanDocument() string {
|
||||
if x != nil {
|
||||
return x.PlanDocument
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Event mirrors internal/events.Event. Data is carried as a JSON object
|
||||
// string (matching the store's own on-disk representation) rather than
|
||||
// google.protobuf.Struct, to stay a direct mirror of the existing column.
|
||||
type Event struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
At *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=at,proto3" json:"at,omitempty"`
|
||||
Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"`
|
||||
TaskId int64 `protobuf:"varint,4,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
|
||||
Repo string `protobuf:"bytes,5,opt,name=repo,proto3" json:"repo,omitempty"`
|
||||
Issue int64 `protobuf:"varint,6,opt,name=issue,proto3" json:"issue,omitempty"`
|
||||
Workflow string `protobuf:"bytes,7,opt,name=workflow,proto3" json:"workflow,omitempty"`
|
||||
Stage string `protobuf:"bytes,8,opt,name=stage,proto3" json:"stage,omitempty"`
|
||||
// attempt is the run this event belongs to. Zero means UNATTRIBUTED, not a
|
||||
// first attempt: rows written before the field existed, and the deliberately
|
||||
// task-agnostic producers, all carry zero. A reader must report those as
|
||||
// unattributable rather than presenting them as one run.
|
||||
Attempt int64 `protobuf:"varint,11,opt,name=attempt,proto3" json:"attempt,omitempty"`
|
||||
Detail string `protobuf:"bytes,9,opt,name=detail,proto3" json:"detail,omitempty"`
|
||||
DataJson string `protobuf:"bytes,10,opt,name=data_json,json=dataJson,proto3" json:"data_json,omitempty"`
|
||||
// Attribution. actor_id is the identity that performed the action and
|
||||
// actor_kind its kind, so a reader can tell an agent's action from a person's
|
||||
// without resolving the identity. principal_id is the identity whose authority
|
||||
// the action used, which is a different fact when an agent acts under a
|
||||
// person's standing approval; empty means unattributed. All three must cross
|
||||
// this boundary: a record whose attribution survives only in `detail` is not
|
||||
// queryable, which is the attribution this design exists to replace.
|
||||
ActorId string `protobuf:"bytes,12,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
|
||||
ActorKind string `protobuf:"bytes,13,opt,name=actor_kind,json=actorKind,proto3" json:"actor_kind,omitempty"`
|
||||
PrincipalId string `protobuf:"bytes,14,opt,name=principal_id,json=principalId,proto3" json:"principal_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Event) Reset() {
|
||||
*x = Event{}
|
||||
mi := &file_state_v1_types_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Event) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Event) ProtoMessage() {}
|
||||
|
||||
func (x *Event) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_state_v1_types_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Event.ProtoReflect.Descriptor instead.
|
||||
func (*Event) Descriptor() ([]byte, []int) {
|
||||
return file_state_v1_types_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Event) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Event) GetAt() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.At
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Event) GetKind() string {
|
||||
if x != nil {
|
||||
return x.Kind
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetTaskId() int64 {
|
||||
if x != nil {
|
||||
return x.TaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Event) GetRepo() string {
|
||||
if x != nil {
|
||||
return x.Repo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetIssue() int64 {
|
||||
if x != nil {
|
||||
return x.Issue
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Event) GetWorkflow() string {
|
||||
if x != nil {
|
||||
return x.Workflow
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetStage() string {
|
||||
if x != nil {
|
||||
return x.Stage
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetAttempt() int64 {
|
||||
if x != nil {
|
||||
return x.Attempt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Event) GetDetail() string {
|
||||
if x != nil {
|
||||
return x.Detail
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetDataJson() string {
|
||||
if x != nil {
|
||||
return x.DataJson
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetActorId() string {
|
||||
if x != nil {
|
||||
return x.ActorId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetActorKind() string {
|
||||
if x != nil {
|
||||
return x.ActorKind
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Event) GetPrincipalId() string {
|
||||
if x != nil {
|
||||
return x.PrincipalId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_state_v1_types_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_state_v1_types_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x14state/v1/types.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xff\x01\n" +
|
||||
"\bIdentity\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04kind\x18\x02 \x01(\tR\x04kind\x12!\n" +
|
||||
"\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12\x1c\n" +
|
||||
"\tlifecycle\x18\x04 \x01(\tR\tlifecycle\x12\x18\n" +
|
||||
"\aversion\x18\x05 \x01(\x03R\aversion\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\x91\r\n" +
|
||||
"\x04Task\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x14\n" +
|
||||
"\x05owner\x18\x02 \x01(\tR\x05owner\x12\x12\n" +
|
||||
"\x04repo\x18\x03 \x01(\tR\x04repo\x12!\n" +
|
||||
"\fissue_number\x18\x04 \x01(\x03R\vissueNumber\x12\x14\n" +
|
||||
"\x05title\x18\x05 \x01(\tR\x05title\x12\x12\n" +
|
||||
"\x04body\x18\x06 \x01(\tR\x04body\x12\x16\n" +
|
||||
"\x06labels\x18\a \x01(\tR\x06labels\x12\x16\n" +
|
||||
"\x06status\x18\b \x01(\tR\x06status\x12\x1a\n" +
|
||||
"\bworkflow\x18\t \x01(\tR\bworkflow\x12\x18\n" +
|
||||
"\x05stage\x18\n" +
|
||||
" \x01(\tB\x02\x18\x01R\x05stage\x12\x16\n" +
|
||||
"\x06branch\x18\v \x01(\tR\x06branch\x12\x12\n" +
|
||||
"\x04plan\x18\f \x01(\tR\x04plan\x12\x14\n" +
|
||||
"\x05notes\x18\r \x01(\tR\x05notes\x12\x1b\n" +
|
||||
"\tpr_number\x18\x0e \x01(\x03R\bprNumber\x12\x1f\n" +
|
||||
"\vtokens_used\x18\x0f \x01(\x03R\n" +
|
||||
"tokensUsed\x12\x1e\n" +
|
||||
"\n" +
|
||||
"iterations\x18\x10 \x01(\x03R\n" +
|
||||
"iterations\x12\x18\n" +
|
||||
"\aattempt\x18\x11 \x01(\x03R\aattempt\x12\x1f\n" +
|
||||
"\vpark_reason\x18\x12 \x01(\tR\n" +
|
||||
"parkReason\x12\x1f\n" +
|
||||
"\vretry_count\x18\x13 \x01(\x03R\n" +
|
||||
"retryCount\x12(\n" +
|
||||
"\x10watch_comment_id\x18\x14 \x01(\x03R\x0ewatchCommentId\x12\x16\n" +
|
||||
"\x06source\x18\x15 \x01(\tR\x06source\x12\x1a\n" +
|
||||
"\bidentity\x18\x16 \x01(\tR\bidentity\x12\x1d\n" +
|
||||
"\n" +
|
||||
"binding_id\x18\x17 \x01(\tR\tbindingId\x12'\n" +
|
||||
"\x0fbinding_version\x18\x18 \x01(\x03R\x0ebindingVersion\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x19 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\x1a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12%\n" +
|
||||
"\x0ereview_payload\x18\x1b \x01(\tR\rreviewPayload\x12>\n" +
|
||||
"\x1bworkflow_definition_version\x18\x1c \x01(\x03R\x19workflowDefinitionVersion\x12<\n" +
|
||||
"\x1aworkflow_definition_digest\x18\x1d \x01(\tR\x18workflowDefinitionDigest\x128\n" +
|
||||
"\x18workflow_definition_yaml\x18\x1e \x01(\tR\x16workflowDefinitionYaml\x12#\n" +
|
||||
"\rreview_cursor\x18\x1f \x01(\x03R\freviewCursor\x12\x1d\n" +
|
||||
"\n" +
|
||||
"park_class\x18 \x01(\tR\tparkClass\x12-\n" +
|
||||
"\x12remediation_rounds\x18! \x01(\x05R\x11remediationRounds\x12\x1f\n" +
|
||||
"\vinputs_json\x18\" \x01(\tR\n" +
|
||||
"inputsJson\x12\x10\n" +
|
||||
"\x03org\x18# \x01(\tR\x03org\x12-\n" +
|
||||
"\x13call_parent_task_id\x18$ \x01(\x03R\x10callParentTaskId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"call_depth\x18% \x01(\x05R\tcallDepth\x12!\n" +
|
||||
"\foutputs_json\x18& \x01(\tR\voutputsJson\x12\x1f\n" +
|
||||
"\vreview_gate\x18' \x01(\tR\n" +
|
||||
"reviewGate\x12'\n" +
|
||||
"\x0frereview_rounds\x18( \x01(\x03R\x0erereviewRounds\x12\x1d\n" +
|
||||
"\n" +
|
||||
"retry_mode\x18) \x01(\tR\tretryMode\x12\x1f\n" +
|
||||
"\vresume_from\x18* \x01(\tR\n" +
|
||||
"resumeFrom\x12%\n" +
|
||||
"\x0eresume_results\x18+ \x01(\fR\rresumeResults\x12\x16\n" +
|
||||
"\x06origin\x18, \x01(\tR\x06origin\x12\x1c\n" +
|
||||
"\tworkspace\x18- \x01(\tR\tworkspace\x12+\n" +
|
||||
"\x11binding_signature\x18. \x01(\tR\x10bindingSignature\x12!\n" +
|
||||
"\fbinding_addr\x18/ \x01(\tR\vbindingAddr\x12!\n" +
|
||||
"\fpark_blocker\x180 \x01(\tR\vparkBlocker\x12#\n" +
|
||||
"\rplan_document\x182 \x01(\tR\fplanDocumentJ\x04\b1\x102R\tplan_view\"\xf8\x02\n" +
|
||||
"\x05Event\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12*\n" +
|
||||
"\x02at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x02at\x12\x12\n" +
|
||||
"\x04kind\x18\x03 \x01(\tR\x04kind\x12\x17\n" +
|
||||
"\atask_id\x18\x04 \x01(\x03R\x06taskId\x12\x12\n" +
|
||||
"\x04repo\x18\x05 \x01(\tR\x04repo\x12\x14\n" +
|
||||
"\x05issue\x18\x06 \x01(\x03R\x05issue\x12\x1a\n" +
|
||||
"\bworkflow\x18\a \x01(\tR\bworkflow\x12\x14\n" +
|
||||
"\x05stage\x18\b \x01(\tR\x05stage\x12\x18\n" +
|
||||
"\aattempt\x18\v \x01(\x03R\aattempt\x12\x16\n" +
|
||||
"\x06detail\x18\t \x01(\tR\x06detail\x12\x1b\n" +
|
||||
"\tdata_json\x18\n" +
|
||||
" \x01(\tR\bdataJson\x12\x19\n" +
|
||||
"\bactor_id\x18\f \x01(\tR\aactorId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"actor_kind\x18\r \x01(\tR\tactorKind\x12!\n" +
|
||||
"\fprincipal_id\x18\x0e \x01(\tR\vprincipalIdB\xa4\x01\n" +
|
||||
"\fcom.state.v1B\n" +
|
||||
"TypesProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_state_v1_types_proto_rawDescOnce sync.Once
|
||||
file_state_v1_types_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_state_v1_types_proto_rawDescGZIP() []byte {
|
||||
file_state_v1_types_proto_rawDescOnce.Do(func() {
|
||||
file_state_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_types_proto_rawDesc), len(file_state_v1_types_proto_rawDesc)))
|
||||
})
|
||||
return file_state_v1_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_state_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_state_v1_types_proto_goTypes = []any{
|
||||
(*Identity)(nil), // 0: state.v1.Identity
|
||||
(*Task)(nil), // 1: state.v1.Task
|
||||
(*Event)(nil), // 2: state.v1.Event
|
||||
(*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp
|
||||
}
|
||||
var file_state_v1_types_proto_depIdxs = []int32{
|
||||
3, // 0: state.v1.Identity.created_at:type_name -> google.protobuf.Timestamp
|
||||
3, // 1: state.v1.Identity.updated_at:type_name -> google.protobuf.Timestamp
|
||||
3, // 2: state.v1.Task.created_at:type_name -> google.protobuf.Timestamp
|
||||
3, // 3: state.v1.Task.updated_at:type_name -> google.protobuf.Timestamp
|
||||
3, // 4: state.v1.Event.at:type_name -> google.protobuf.Timestamp
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_state_v1_types_proto_init() }
|
||||
func file_state_v1_types_proto_init() {
|
||||
if File_state_v1_types_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_types_proto_rawDesc), len(file_state_v1_types_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_state_v1_types_proto_goTypes,
|
||||
DependencyIndexes: file_state_v1_types_proto_depIdxs,
|
||||
MessageInfos: file_state_v1_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_state_v1_types_proto = out.File
|
||||
file_state_v1_types_proto_goTypes = nil
|
||||
file_state_v1_types_proto_depIdxs = nil
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func accessDenialValue(d *pb.AccessDenial) access.Denial {
|
||||
return value
|
||||
}
|
||||
|
||||
func (s *server) GetPrincipal(ctx context.Context, request *pb.GetPrincipalRequest) (*pb.GetPrincipalResponse, error) {
|
||||
func (s *accessServer) GetPrincipal(ctx context.Context, request *pb.GetPrincipalRequest) (*pb.GetPrincipalResponse, error) {
|
||||
if s.deps.Principals == nil {
|
||||
return nil, status.Error(codes.Unavailable, "identity store unavailable")
|
||||
}
|
||||
@@ -98,7 +98,7 @@ func (s *server) GetPrincipal(ctx context.Context, request *pb.GetPrincipalReque
|
||||
}}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListPolicies(ctx context.Context, _ *pb.ListPoliciesRequest) (*pb.ListPoliciesResponse, error) {
|
||||
func (s *accessServer) ListPolicies(ctx context.Context, _ *pb.ListPoliciesRequest) (*pb.ListPoliciesResponse, error) {
|
||||
if s.deps.Policies == nil {
|
||||
return nil, errPoliciesUnavailable
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func (s *server) ListPolicies(ctx context.Context, _ *pb.ListPoliciesRequest) (*
|
||||
return &pb.ListPoliciesResponse{Policies: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetPoliciesVersion(ctx context.Context, _ *pb.GetPoliciesVersionRequest) (*pb.GetPoliciesVersionResponse, error) {
|
||||
func (s *accessServer) GetPoliciesVersion(ctx context.Context, _ *pb.GetPoliciesVersionRequest) (*pb.GetPoliciesVersionResponse, error) {
|
||||
if s.deps.Policies == nil {
|
||||
return nil, errPoliciesUnavailable
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func (s *server) GetPoliciesVersion(ctx context.Context, _ *pb.GetPoliciesVersio
|
||||
return &pb.GetPoliciesVersionResponse{Version: version}, nil
|
||||
}
|
||||
|
||||
func (s *server) PutPolicy(ctx context.Context, request *pb.PutPolicyRequest) (*pb.PutPolicyResponse, error) {
|
||||
func (s *accessServer) PutPolicy(ctx context.Context, request *pb.PutPolicyRequest) (*pb.PutPolicyResponse, error) {
|
||||
if s.deps.Policies == nil {
|
||||
return nil, errPoliciesUnavailable
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func (s *server) PutPolicy(ctx context.Context, request *pb.PutPolicyRequest) (*
|
||||
return &pb.PutPolicyResponse{Version: version}, nil
|
||||
}
|
||||
|
||||
func (s *server) DeletePolicy(ctx context.Context, request *pb.DeletePolicyRequest) (*pb.DeletePolicyResponse, error) {
|
||||
func (s *accessServer) DeletePolicy(ctx context.Context, request *pb.DeletePolicyRequest) (*pb.DeletePolicyResponse, error) {
|
||||
if s.deps.Policies == nil {
|
||||
return nil, errPoliciesUnavailable
|
||||
}
|
||||
@@ -145,7 +145,7 @@ func (s *server) DeletePolicy(ctx context.Context, request *pb.DeletePolicyReque
|
||||
return &pb.DeletePolicyResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) EnsureShippedOrgPolicies(ctx context.Context, request *pb.EnsureShippedOrgPoliciesRequest) (*pb.EnsureShippedOrgPoliciesResponse, error) {
|
||||
func (s *accessServer) EnsureShippedOrgPolicies(ctx context.Context, request *pb.EnsureShippedOrgPoliciesRequest) (*pb.EnsureShippedOrgPoliciesResponse, error) {
|
||||
if s.deps.Policies == nil {
|
||||
return nil, errPoliciesUnavailable
|
||||
}
|
||||
@@ -155,7 +155,7 @@ func (s *server) EnsureShippedOrgPolicies(ctx context.Context, request *pb.Ensur
|
||||
return &pb.EnsureShippedOrgPoliciesResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) RecordDenial(ctx context.Context, request *pb.RecordDenialRequest) (*pb.RecordDenialResponse, error) {
|
||||
func (s *accessServer) RecordDenial(ctx context.Context, request *pb.RecordDenialRequest) (*pb.RecordDenialResponse, error) {
|
||||
if s.deps.Denials == nil {
|
||||
return nil, errDenialsUnavailable
|
||||
}
|
||||
@@ -165,7 +165,7 @@ func (s *server) RecordDenial(ctx context.Context, request *pb.RecordDenialReque
|
||||
return &pb.RecordDenialResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListDenials(ctx context.Context, request *pb.ListDenialsRequest) (*pb.ListDenialsResponse, error) {
|
||||
func (s *accessServer) ListDenials(ctx context.Context, request *pb.ListDenialsRequest) (*pb.ListDenialsResponse, error) {
|
||||
if s.deps.Denials == nil {
|
||||
return nil, errDenialsUnavailable
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ var (
|
||||
)
|
||||
|
||||
func (c *Client) PrincipalFor(ctx context.Context, id identity.IdentityID) (access.Principal, error) {
|
||||
r, err := c.client.GetPrincipal(ctx, &pb.GetPrincipalRequest{IdentityId: string(id)})
|
||||
r, err := c.access.GetPrincipal(ctx, &pb.GetPrincipalRequest{IdentityId: string(id)})
|
||||
if err != nil {
|
||||
return access.Principal{}, unmapError(err)
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func (c *Client) PrincipalFor(ctx context.Context, id identity.IdentityID) (acce
|
||||
}
|
||||
|
||||
func (c *Client) ListPolicies(ctx context.Context) ([]access.Policy, error) {
|
||||
r, err := c.client.ListPolicies(ctx, &pb.ListPoliciesRequest{})
|
||||
r, err := c.access.ListPolicies(ctx, &pb.ListPoliciesRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func (c *Client) ListPolicies(ctx context.Context) ([]access.Policy, error) {
|
||||
}
|
||||
|
||||
func (c *Client) PoliciesVersion(ctx context.Context) (int64, error) {
|
||||
r, err := c.client.GetPoliciesVersion(ctx, &pb.GetPoliciesVersionRequest{})
|
||||
r, err := c.access.GetPoliciesVersion(ctx, &pb.GetPoliciesVersionRequest{})
|
||||
if err != nil {
|
||||
return 0, unmapError(err)
|
||||
}
|
||||
@@ -61,7 +61,7 @@ func (c *Client) PoliciesVersion(ctx context.Context) (int64, error) {
|
||||
}
|
||||
|
||||
func (c *Client) PutPolicy(ctx context.Context, p access.Policy) (int64, error) {
|
||||
r, err := c.client.PutPolicy(ctx, &pb.PutPolicyRequest{Policy: accessPolicyProto(p)})
|
||||
r, err := c.access.PutPolicy(ctx, &pb.PutPolicyRequest{Policy: accessPolicyProto(p)})
|
||||
if err != nil {
|
||||
return 0, unmapError(err)
|
||||
}
|
||||
@@ -69,16 +69,16 @@ func (c *Client) PutPolicy(ctx context.Context, p access.Policy) (int64, error)
|
||||
}
|
||||
|
||||
func (c *Client) DeletePolicy(ctx context.Context, p access.Policy) error {
|
||||
_, err := c.client.DeletePolicy(ctx, &pb.DeletePolicyRequest{Policy: accessPolicyProto(p)})
|
||||
_, err := c.access.DeletePolicy(ctx, &pb.DeletePolicyRequest{Policy: accessPolicyProto(p)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) EnsureShippedOrgPolicies(ctx context.Context, orgID org.OrgID) error {
|
||||
_, err := c.client.EnsureShippedOrgPolicies(ctx, &pb.EnsureShippedOrgPoliciesRequest{OrgId: string(orgID)})
|
||||
_, err := c.access.EnsureShippedOrgPolicies(ctx, &pb.EnsureShippedOrgPoliciesRequest{OrgId: string(orgID)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) RecordDenial(ctx context.Context, d access.Denial) error {
|
||||
_, err := c.client.RecordDenial(ctx, &pb.RecordDenialRequest{Denial: accessDenialProto(d)})
|
||||
_, err := c.access.RecordDenial(ctx, &pb.RecordDenialRequest{Denial: accessDenialProto(d)})
|
||||
return unmapError(err)
|
||||
}
|
||||
@@ -19,7 +19,7 @@ func (s *server) accountSecurity() (identity.AccountSecurity, error) {
|
||||
return store, nil
|
||||
}
|
||||
|
||||
func (s *server) OpenAccountSession(ctx context.Context, r *pb.OpenAccountSessionRequest) (*pb.OpenAccountSessionResponse, error) {
|
||||
func (s *accountServer) OpenAccountSession(ctx context.Context, r *pb.OpenAccountSessionRequest) (*pb.OpenAccountSessionResponse, error) {
|
||||
store, err := s.accountSecurity()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -31,7 +31,7 @@ func (s *server) OpenAccountSession(ctx context.Context, r *pb.OpenAccountSessio
|
||||
return &pb.OpenAccountSessionResponse{Identity: identityProto(value.Identity), Token: value.Token, ExpiresAt: timestamp(value.Expires)}, nil
|
||||
}
|
||||
|
||||
func (s *server) RequireFreshAccountSession(ctx context.Context, r *pb.RequireFreshAccountSessionRequest) (*pb.RequireFreshAccountSessionResponse, error) {
|
||||
func (s *accountServer) RequireFreshAccountSession(ctx context.Context, r *pb.RequireFreshAccountSessionRequest) (*pb.RequireFreshAccountSessionResponse, error) {
|
||||
store, err := s.accountSecurity()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -39,7 +39,7 @@ func (s *server) RequireFreshAccountSession(ctx context.Context, r *pb.RequireFr
|
||||
return &pb.RequireFreshAccountSessionResponse{}, accountStatus(store.RequireFreshAccountSession(ctx, r.Token))
|
||||
}
|
||||
|
||||
func (s *server) CreateAccountRecovery(ctx context.Context, _ *pb.CreateAccountRecoveryRequest) (*pb.CreateAccountRecoveryResponse, error) {
|
||||
func (s *accountServer) CreateAccountRecovery(ctx context.Context, _ *pb.CreateAccountRecoveryRequest) (*pb.CreateAccountRecoveryResponse, error) {
|
||||
store, err := s.accountSecurity()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -51,7 +51,7 @@ func (s *server) CreateAccountRecovery(ctx context.Context, _ *pb.CreateAccountR
|
||||
return &pb.CreateAccountRecoveryResponse{Code: code}, nil
|
||||
}
|
||||
|
||||
func (s *server) RecoverAccount(ctx context.Context, r *pb.RecoverAccountRequest) (*pb.RecoverAccountResponse, error) {
|
||||
func (s *accountServer) RecoverAccount(ctx context.Context, r *pb.RecoverAccountRequest) (*pb.RecoverAccountResponse, error) {
|
||||
store, err := s.accountSecurity()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -60,7 +60,7 @@ func (s *server) RecoverAccount(ctx context.Context, r *pb.RecoverAccountRequest
|
||||
}
|
||||
|
||||
func (c *Client) OpenAccountSession(ctx context.Context, expires time.Time) (identity.AccountSession, error) {
|
||||
r, err := c.client.OpenAccountSession(ctx, &pb.OpenAccountSessionRequest{ExpiresAt: timestamp(expires)})
|
||||
r, err := c.account.OpenAccountSession(ctx, &pb.OpenAccountSessionRequest{ExpiresAt: timestamp(expires)})
|
||||
if err != nil {
|
||||
return identity.AccountSession{}, accountClientError(err)
|
||||
}
|
||||
@@ -68,12 +68,12 @@ func (c *Client) OpenAccountSession(ctx context.Context, expires time.Time) (ide
|
||||
}
|
||||
|
||||
func (c *Client) RequireFreshAccountSession(ctx context.Context, token string) error {
|
||||
_, err := c.client.RequireFreshAccountSession(ctx, &pb.RequireFreshAccountSessionRequest{Token: token})
|
||||
_, err := c.account.RequireFreshAccountSession(ctx, &pb.RequireFreshAccountSessionRequest{Token: token})
|
||||
return accountClientError(err)
|
||||
}
|
||||
|
||||
func (c *Client) CreateAccountRecovery(ctx context.Context) (string, error) {
|
||||
r, err := c.client.CreateAccountRecovery(ctx, &pb.CreateAccountRecoveryRequest{})
|
||||
r, err := c.account.CreateAccountRecovery(ctx, &pb.CreateAccountRecoveryRequest{})
|
||||
if err != nil {
|
||||
return "", accountClientError(err)
|
||||
}
|
||||
@@ -81,6 +81,6 @@ func (c *Client) CreateAccountRecovery(ctx context.Context) (string, error) {
|
||||
}
|
||||
|
||||
func (c *Client) RecoverAccount(ctx context.Context, email, code, password string) error {
|
||||
_, err := c.client.RecoverAccount(ctx, &pb.RecoverAccountRequest{Email: email, Code: code, Password: password})
|
||||
_, err := c.account.RecoverAccount(ctx, &pb.RecoverAccountRequest{Email: email, Code: code, Password: password})
|
||||
return accountClientError(err)
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func (s *server) accountStore() (identity.Accounts, error) {
|
||||
return s.deps.Accounts, nil
|
||||
}
|
||||
|
||||
func (s *server) AccountSetup(ctx context.Context, _ *pb.AccountSetupRequest) (*pb.AccountSetupResponse, error) {
|
||||
func (s *accountServer) AccountSetup(ctx context.Context, _ *pb.AccountSetupRequest) (*pb.AccountSetupResponse, error) {
|
||||
store, err := s.accountStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -54,7 +54,7 @@ func (s *server) AccountSetup(ctx context.Context, _ *pb.AccountSetupRequest) (*
|
||||
return &pb.AccountSetupResponse{Required: required}, accountStatus(err)
|
||||
}
|
||||
|
||||
func (s *server) RegisterAccount(ctx context.Context, r *pb.RegisterAccountRequest) (*pb.RegisterAccountResponse, error) {
|
||||
func (s *accountServer) RegisterAccount(ctx context.Context, r *pb.RegisterAccountRequest) (*pb.RegisterAccountResponse, error) {
|
||||
store, err := s.accountStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -71,7 +71,7 @@ func (s *server) RegisterAccount(ctx context.Context, r *pb.RegisterAccountReque
|
||||
return &pb.RegisterAccountResponse{Identity: identityProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) SignInAccount(ctx context.Context, r *pb.SignInAccountRequest) (*pb.SignInAccountResponse, error) {
|
||||
func (s *accountServer) SignInAccount(ctx context.Context, r *pb.SignInAccountRequest) (*pb.SignInAccountResponse, error) {
|
||||
store, err := s.accountStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -83,7 +83,7 @@ func (s *server) SignInAccount(ctx context.Context, r *pb.SignInAccountRequest)
|
||||
return &pb.SignInAccountResponse{Identity: identityProto(value.Identity), Token: value.Token, ExpiresAt: timestamp(value.Expires)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ResolveAccountSession(ctx context.Context, r *pb.ResolveAccountSessionRequest) (*pb.ResolveAccountSessionResponse, error) {
|
||||
func (s *accountServer) ResolveAccountSession(ctx context.Context, r *pb.ResolveAccountSessionRequest) (*pb.ResolveAccountSessionResponse, error) {
|
||||
store, err := s.accountStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -95,7 +95,7 @@ func (s *server) ResolveAccountSession(ctx context.Context, r *pb.ResolveAccount
|
||||
return &pb.ResolveAccountSessionResponse{Identity: identityProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) SignOutAccount(ctx context.Context, r *pb.SignOutAccountRequest) (*pb.SignOutAccountResponse, error) {
|
||||
func (s *accountServer) SignOutAccount(ctx context.Context, r *pb.SignOutAccountRequest) (*pb.SignOutAccountResponse, error) {
|
||||
store, err := s.accountStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -103,7 +103,7 @@ func (s *server) SignOutAccount(ctx context.Context, r *pb.SignOutAccountRequest
|
||||
return &pb.SignOutAccountResponse{}, accountStatus(store.SignOutAccount(ctx, r.Token))
|
||||
}
|
||||
|
||||
func (s *server) ChangeAccountPassword(ctx context.Context, r *pb.ChangeAccountPasswordRequest) (*pb.ChangeAccountPasswordResponse, error) {
|
||||
func (s *accountServer) ChangeAccountPassword(ctx context.Context, r *pb.ChangeAccountPasswordRequest) (*pb.ChangeAccountPasswordResponse, error) {
|
||||
store, err := s.accountStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -112,12 +112,12 @@ func (s *server) ChangeAccountPassword(ctx context.Context, r *pb.ChangeAccountP
|
||||
}
|
||||
|
||||
func (c *Client) AccountSetupRequired(ctx context.Context) (bool, error) {
|
||||
r, err := c.client.AccountSetup(ctx, &pb.AccountSetupRequest{})
|
||||
r, err := c.account.AccountSetup(ctx, &pb.AccountSetupRequest{})
|
||||
return r.GetRequired(), accountClientError(err)
|
||||
}
|
||||
|
||||
func (c *Client) RegisterAccount(ctx context.Context, r identity.AccountRegistration, bootstrap bool) (identity.Identity, error) {
|
||||
out, err := c.client.RegisterAccount(ctx, &pb.RegisterAccountRequest{Email: r.Email, DisplayName: r.DisplayName, Password: r.Password, Role: r.Role, Bootstrap: bootstrap, OrganisationName: r.OrganisationName, WorkspaceName: r.WorkspaceName, PublicUrl: r.PublicURL})
|
||||
out, err := c.account.RegisterAccount(ctx, &pb.RegisterAccountRequest{Email: r.Email, DisplayName: r.DisplayName, Password: r.Password, Role: r.Role, Bootstrap: bootstrap, OrganisationName: r.OrganisationName, WorkspaceName: r.WorkspaceName, PublicUrl: r.PublicURL})
|
||||
if err != nil {
|
||||
return identity.Identity{}, accountClientError(err)
|
||||
}
|
||||
@@ -125,7 +125,7 @@ func (c *Client) RegisterAccount(ctx context.Context, r identity.AccountRegistra
|
||||
}
|
||||
|
||||
func (c *Client) SignInAccount(ctx context.Context, email, password string) (identity.AccountSession, error) {
|
||||
r, err := c.client.SignInAccount(ctx, &pb.SignInAccountRequest{Email: email, Password: password})
|
||||
r, err := c.account.SignInAccount(ctx, &pb.SignInAccountRequest{Email: email, Password: password})
|
||||
if err != nil {
|
||||
return identity.AccountSession{}, accountClientError(err)
|
||||
}
|
||||
@@ -133,7 +133,7 @@ func (c *Client) SignInAccount(ctx context.Context, email, password string) (ide
|
||||
}
|
||||
|
||||
func (c *Client) ResolveAccountSession(ctx context.Context, token string) (identity.Identity, error) {
|
||||
r, err := c.client.ResolveAccountSession(ctx, &pb.ResolveAccountSessionRequest{Token: token})
|
||||
r, err := c.account.ResolveAccountSession(ctx, &pb.ResolveAccountSessionRequest{Token: token})
|
||||
if err != nil {
|
||||
return identity.Identity{}, accountClientError(err)
|
||||
}
|
||||
@@ -141,12 +141,12 @@ func (c *Client) ResolveAccountSession(ctx context.Context, token string) (ident
|
||||
}
|
||||
|
||||
func (c *Client) SignOutAccount(ctx context.Context, token string) error {
|
||||
_, err := c.client.SignOutAccount(ctx, &pb.SignOutAccountRequest{Token: token})
|
||||
_, err := c.account.SignOutAccount(ctx, &pb.SignOutAccountRequest{Token: token})
|
||||
return accountClientError(err)
|
||||
}
|
||||
|
||||
func (c *Client) ChangeAccountPassword(ctx context.Context, current, next string) error {
|
||||
_, err := c.client.ChangeAccountPassword(ctx, &pb.ChangeAccountPasswordRequest{CurrentPassword: current, NewPassword: next})
|
||||
_, err := c.account.ChangeAccountPassword(ctx, &pb.ChangeAccountPasswordRequest{CurrentPassword: current, NewPassword: next})
|
||||
return accountClientError(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestAccountManagementUsesPolicy(t *testing.T) {
|
||||
if tc.extra != "" {
|
||||
policies = append(policies, access.Policy{ID: "custom-members", Level: access.LevelOrg, OrgID: "acme", Text: tc.extra})
|
||||
}
|
||||
srv := &server{deps: Deps{Accounts: accountRegistrationStore{}, Policies: accountPolicyStore{policies: policies}}}
|
||||
srv := &accountServer{server: &server{deps: Deps{Accounts: accountRegistrationStore{}, Policies: accountPolicyStore{policies: policies}}}}
|
||||
_, err := srv.RegisterAccount(ctx, &pb.RegisterAccountRequest{Email: "new@example.com", Role: "viewer"})
|
||||
if got := status.Code(err); got != tc.want {
|
||||
t.Fatalf("code=%s want=%s err=%v", got, tc.want, err)
|
||||
@@ -62,22 +62,22 @@ func TestAccountManagementUsesPolicy(t *testing.T) {
|
||||
|
||||
func TestTaskCredentialsCannotManageAccounts(t *testing.T) {
|
||||
for _, method := range []string{
|
||||
pb.StateStoreService_AccountSetup_FullMethodName,
|
||||
pb.StateStoreService_RegisterAccount_FullMethodName,
|
||||
pb.StateStoreService_SignInAccount_FullMethodName,
|
||||
pb.StateStoreService_ResolveAccountSession_FullMethodName,
|
||||
pb.StateStoreService_SignOutAccount_FullMethodName,
|
||||
pb.StateStoreService_ChangeAccountPassword_FullMethodName,
|
||||
pb.StateStoreService_GetAuthenticationSettings_FullMethodName,
|
||||
pb.StateStoreService_SaveAuthenticationSettings_FullMethodName,
|
||||
pb.StateStoreService_BeginPasskey_FullMethodName,
|
||||
pb.StateStoreService_FinishPasskey_FullMethodName,
|
||||
pb.StateStoreService_ListPasskeys_FullMethodName,
|
||||
pb.StateStoreService_DeletePasskey_FullMethodName,
|
||||
pb.StateStoreService_OpenAccountSession_FullMethodName,
|
||||
pb.StateStoreService_RequireFreshAccountSession_FullMethodName,
|
||||
pb.StateStoreService_CreateAccountRecovery_FullMethodName,
|
||||
pb.StateStoreService_RecoverAccount_FullMethodName,
|
||||
pb.AccountService_AccountSetup_FullMethodName,
|
||||
pb.AccountService_RegisterAccount_FullMethodName,
|
||||
pb.AccountService_SignInAccount_FullMethodName,
|
||||
pb.AccountService_ResolveAccountSession_FullMethodName,
|
||||
pb.AccountService_SignOutAccount_FullMethodName,
|
||||
pb.AccountService_ChangeAccountPassword_FullMethodName,
|
||||
pb.AccountService_GetAuthenticationSettings_FullMethodName,
|
||||
pb.AccountService_SaveAuthenticationSettings_FullMethodName,
|
||||
pb.AccountService_BeginPasskey_FullMethodName,
|
||||
pb.AccountService_FinishPasskey_FullMethodName,
|
||||
pb.AccountService_ListPasskeys_FullMethodName,
|
||||
pb.AccountService_DeletePasskey_FullMethodName,
|
||||
pb.AccountService_OpenAccountSession_FullMethodName,
|
||||
pb.AccountService_RequireFreshAccountSession_FullMethodName,
|
||||
pb.AccountService_CreateAccountRecovery_FullMethodName,
|
||||
pb.AccountService_RecoverAccount_FullMethodName,
|
||||
} {
|
||||
t.Run(method, func(t *testing.T) {
|
||||
if authorizesTaskScopedCall(method, nil, 7) {
|
||||
|
||||
@@ -81,7 +81,7 @@ func alertDeliveryValue(d *pb.AlertDelivery) alert.Delivery {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *server) RaiseAlert(ctx context.Context, r *pb.RaiseAlertRequest) (*pb.RaiseAlertResponse, error) {
|
||||
func (s *alertServer) RaiseAlert(ctx context.Context, r *pb.RaiseAlertRequest) (*pb.RaiseAlertResponse, error) {
|
||||
if s.deps.Alerts == nil {
|
||||
return nil, errAlertsUnavailable
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func (s *server) RaiseAlert(ctx context.Context, r *pb.RaiseAlertRequest) (*pb.R
|
||||
return &pb.RaiseAlertResponse{Alert: alertProto(stored)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ResolveAlert(ctx context.Context, r *pb.ResolveAlertRequest) (*pb.ResolveAlertResponse, error) {
|
||||
func (s *alertServer) ResolveAlert(ctx context.Context, r *pb.ResolveAlertRequest) (*pb.ResolveAlertResponse, error) {
|
||||
if s.deps.Alerts == nil {
|
||||
return nil, errAlertsUnavailable
|
||||
}
|
||||
@@ -115,7 +115,7 @@ func (s *server) ResolveAlert(ctx context.Context, r *pb.ResolveAlertRequest) (*
|
||||
return &pb.ResolveAlertResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) DismissAlert(ctx context.Context, r *pb.DismissAlertRequest) (*pb.DismissAlertResponse, error) {
|
||||
func (s *alertServer) DismissAlert(ctx context.Context, r *pb.DismissAlertRequest) (*pb.DismissAlertResponse, error) {
|
||||
if s.deps.Alerts == nil {
|
||||
return nil, errAlertsUnavailable
|
||||
}
|
||||
@@ -129,7 +129,7 @@ func (s *server) DismissAlert(ctx context.Context, r *pb.DismissAlertRequest) (*
|
||||
return &pb.DismissAlertResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListAlerts(ctx context.Context, r *pb.ListAlertsRequest) (*pb.ListAlertsResponse, error) {
|
||||
func (s *alertServer) ListAlerts(ctx context.Context, r *pb.ListAlertsRequest) (*pb.ListAlertsResponse, error) {
|
||||
if s.deps.Alerts == nil {
|
||||
return nil, errAlertsUnavailable
|
||||
}
|
||||
@@ -157,7 +157,7 @@ func requireUnscoped(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *server) ClaimAlertDeliveries(ctx context.Context, r *pb.ClaimAlertDeliveriesRequest) (*pb.ClaimAlertDeliveriesResponse, error) {
|
||||
func (s *alertServer) ClaimAlertDeliveries(ctx context.Context, r *pb.ClaimAlertDeliveriesRequest) (*pb.ClaimAlertDeliveriesResponse, error) {
|
||||
if s.deps.Alerts == nil {
|
||||
return nil, errAlertsUnavailable
|
||||
}
|
||||
@@ -173,7 +173,7 @@ func (s *server) ClaimAlertDeliveries(ctx context.Context, r *pb.ClaimAlertDeliv
|
||||
})}, nil
|
||||
}
|
||||
|
||||
func (s *server) RecordAlertAttempt(ctx context.Context, r *pb.RecordAlertAttemptRequest) (*pb.RecordAlertAttemptResponse, error) {
|
||||
func (s *alertServer) RecordAlertAttempt(ctx context.Context, r *pb.RecordAlertAttemptRequest) (*pb.RecordAlertAttemptResponse, error) {
|
||||
if s.deps.Alerts == nil {
|
||||
return nil, errAlertsUnavailable
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
var _ alert.Store = (*Client)(nil)
|
||||
|
||||
func (c *Client) RaiseAlert(ctx context.Context, in alert.Input) (alert.Alert, error) {
|
||||
r, err := c.client.RaiseAlert(ctx, &pb.RaiseAlertRequest{
|
||||
r, err := c.alert.RaiseAlert(ctx, &pb.RaiseAlertRequest{
|
||||
OrgId: string(in.Org), Kind: in.Kind, Subject: in.Subject, Severity: string(in.Severity),
|
||||
Title: in.Title, Body: in.Body, Link: in.Link, Condition: in.Condition,
|
||||
})
|
||||
@@ -23,12 +23,12 @@ func (c *Client) RaiseAlert(ctx context.Context, in alert.Input) (alert.Alert, e
|
||||
}
|
||||
|
||||
func (c *Client) ResolveAlert(ctx context.Context, key alert.Key, _ string) error {
|
||||
_, err := c.client.ResolveAlert(ctx, &pb.ResolveAlertRequest{OrgId: string(key.Org), Kind: key.Kind, Subject: key.Subject})
|
||||
_, err := c.alert.ResolveAlert(ctx, &pb.ResolveAlertRequest{OrgId: string(key.Org), Kind: key.Kind, Subject: key.Subject})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) DismissAlert(ctx context.Context, orgID org.OrgID, id int64, _ string) error {
|
||||
_, err := c.client.DismissAlert(ctx, &pb.DismissAlertRequest{OrgId: string(orgID), Id: id})
|
||||
_, err := c.alert.DismissAlert(ctx, &pb.DismissAlertRequest{OrgId: string(orgID), Id: id})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func (c *Client) ListAlerts(ctx context.Context, orgID org.OrgID, filter alert.F
|
||||
for i, st := range filter.States {
|
||||
states[i] = string(st)
|
||||
}
|
||||
r, err := c.client.ListAlerts(ctx, &pb.ListAlertsRequest{OrgId: string(orgID), States: states, Limit: int32(filter.Limit)})
|
||||
r, err := c.alert.ListAlerts(ctx, &pb.ListAlertsRequest{OrgId: string(orgID), States: states, Limit: int32(filter.Limit)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func (c *Client) ListAlerts(ctx context.Context, orgID org.OrgID, filter alert.F
|
||||
}
|
||||
|
||||
func (c *Client) ClaimAlertDeliveries(ctx context.Context, limit int) ([]alert.Due, error) {
|
||||
r, err := c.client.ClaimAlertDeliveries(ctx, &pb.ClaimAlertDeliveriesRequest{Limit: int32(limit)})
|
||||
r, err := c.alert.ClaimAlertDeliveries(ctx, &pb.ClaimAlertDeliveriesRequest{Limit: int32(limit)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func (c *Client) ClaimAlertDeliveries(ctx context.Context, limit int) ([]alert.D
|
||||
}
|
||||
|
||||
func (c *Client) RecordAlertAttempt(ctx context.Context, o alert.Outcome) error {
|
||||
_, err := c.client.RecordAlertAttempt(ctx, &pb.RecordAlertAttemptRequest{
|
||||
_, err := c.alert.RecordAlertAttempt(ctx, &pb.RecordAlertAttemptRequest{
|
||||
DeliveryId: o.DeliveryID, Skipped: o.Skipped, StatusCode: int64(o.StatusCode), Error: o.Error,
|
||||
})
|
||||
return unmapError(err)
|
||||
|
||||
@@ -144,7 +144,7 @@ func TestAlerts(t *testing.T) {
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
s := &server{deps: Deps{Alerts: &fakeAlerts{alerts: map[alert.Key]*alert.Alert{}}}}
|
||||
s := &alertServer{server: &server{deps: Deps{Alerts: &fakeAlerts{alerts: map[alert.Key]*alert.Alert{}}}}}
|
||||
for i, step := range tc.steps {
|
||||
ctx := context.Background()
|
||||
if step.as != "" {
|
||||
@@ -162,7 +162,7 @@ func TestAlerts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func runAlertStep(ctx context.Context, s *server, step alertStep) ([]string, error) {
|
||||
func runAlertStep(ctx context.Context, s *alertServer, step alertStep) ([]string, error) {
|
||||
switch step.op {
|
||||
case "raise", "event":
|
||||
_, err := s.RaiseAlert(ctx, &pb.RaiseAlertRequest{
|
||||
|
||||
@@ -18,7 +18,7 @@ func authenticationValue(v *pb.AuthenticationSettings) identity.AuthenticationSe
|
||||
return identity.AuthenticationSettings{PublicURL: v.GetPublicUrl(), OIDCIssuer: v.GetOidcIssuer(), OIDCAudience: v.GetOidcAudience(), OIDCClientID: v.GetOidcClientId()}
|
||||
}
|
||||
|
||||
func (s *server) GetAuthenticationSettings(ctx context.Context, _ *pb.GetAuthenticationSettingsRequest) (*pb.GetAuthenticationSettingsResponse, error) {
|
||||
func (s *accountServer) GetAuthenticationSettings(ctx context.Context, _ *pb.GetAuthenticationSettingsRequest) (*pb.GetAuthenticationSettingsResponse, error) {
|
||||
store, ok := s.deps.Accounts.(identity.AuthenticationSettingsStore)
|
||||
if !ok {
|
||||
return nil, status.Error(codes.Unavailable, "authentication settings unavailable")
|
||||
@@ -30,7 +30,7 @@ func (s *server) GetAuthenticationSettings(ctx context.Context, _ *pb.GetAuthent
|
||||
return &pb.GetAuthenticationSettingsResponse{Settings: authenticationProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) SaveAuthenticationSettings(ctx context.Context, r *pb.SaveAuthenticationSettingsRequest) (*pb.SaveAuthenticationSettingsResponse, error) {
|
||||
func (s *accountServer) SaveAuthenticationSettings(ctx context.Context, r *pb.SaveAuthenticationSettingsRequest) (*pb.SaveAuthenticationSettingsResponse, error) {
|
||||
store, ok := s.deps.Accounts.(identity.AuthenticationSettingsStore)
|
||||
if !ok {
|
||||
return nil, status.Error(codes.Unavailable, "authentication settings unavailable")
|
||||
@@ -39,7 +39,7 @@ func (s *server) SaveAuthenticationSettings(ctx context.Context, r *pb.SaveAuthe
|
||||
}
|
||||
|
||||
func (c *Client) AuthenticationSettings(ctx context.Context) (identity.AuthenticationSettings, error) {
|
||||
r, err := c.client.GetAuthenticationSettings(ctx, &pb.GetAuthenticationSettingsRequest{})
|
||||
r, err := c.account.GetAuthenticationSettings(ctx, &pb.GetAuthenticationSettingsRequest{})
|
||||
if err != nil {
|
||||
return identity.AuthenticationSettings{}, accountClientError(err)
|
||||
}
|
||||
@@ -47,7 +47,7 @@ func (c *Client) AuthenticationSettings(ctx context.Context) (identity.Authentic
|
||||
}
|
||||
|
||||
func (c *Client) SaveAuthenticationSettings(ctx context.Context, v identity.AuthenticationSettings) error {
|
||||
_, err := c.client.SaveAuthenticationSettings(ctx, &pb.SaveAuthenticationSettingsRequest{Settings: authenticationProto(v)})
|
||||
_, err := c.account.SaveAuthenticationSettings(ctx, &pb.SaveAuthenticationSettingsRequest{Settings: authenticationProto(v)})
|
||||
return accountClientError(err)
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func (s *server) passkeyStore() (identity.Passkeys, error) {
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func (s *server) BeginPasskey(ctx context.Context, r *pb.BeginPasskeyRequest) (*pb.BeginPasskeyResponse, error) {
|
||||
func (s *accountServer) BeginPasskey(ctx context.Context, r *pb.BeginPasskeyRequest) (*pb.BeginPasskeyResponse, error) {
|
||||
store, err := s.passkeyStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -71,7 +71,7 @@ func (s *server) BeginPasskey(ctx context.Context, r *pb.BeginPasskeyRequest) (*
|
||||
return &pb.BeginPasskeyResponse{Token: value.Token, Options: value.Options}, nil
|
||||
}
|
||||
|
||||
func (s *server) FinishPasskey(ctx context.Context, r *pb.FinishPasskeyRequest) (*pb.FinishPasskeyResponse, error) {
|
||||
func (s *accountServer) FinishPasskey(ctx context.Context, r *pb.FinishPasskeyRequest) (*pb.FinishPasskeyResponse, error) {
|
||||
store, err := s.passkeyStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -83,7 +83,7 @@ func (s *server) FinishPasskey(ctx context.Context, r *pb.FinishPasskeyRequest)
|
||||
return &pb.FinishPasskeyResponse{Identity: identityProto(value.Identity), Token: value.Token, ExpiresAt: timestamp(value.Expires)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListPasskeys(ctx context.Context, _ *pb.ListPasskeysRequest) (*pb.ListPasskeysResponse, error) {
|
||||
func (s *accountServer) ListPasskeys(ctx context.Context, _ *pb.ListPasskeysRequest) (*pb.ListPasskeysResponse, error) {
|
||||
store, err := s.passkeyStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -99,7 +99,7 @@ func (s *server) ListPasskeys(ctx context.Context, _ *pb.ListPasskeysRequest) (*
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (s *server) DeletePasskey(ctx context.Context, r *pb.DeletePasskeyRequest) (*pb.DeletePasskeyResponse, error) {
|
||||
func (s *accountServer) DeletePasskey(ctx context.Context, r *pb.DeletePasskeyRequest) (*pb.DeletePasskeyResponse, error) {
|
||||
store, err := s.passkeyStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -108,7 +108,7 @@ func (s *server) DeletePasskey(ctx context.Context, r *pb.DeletePasskeyRequest)
|
||||
}
|
||||
|
||||
func (c *Client) BeginPasskey(ctx context.Context, registration bool) (identity.PasskeyCeremony, error) {
|
||||
r, err := c.client.BeginPasskey(ctx, &pb.BeginPasskeyRequest{Registration: registration})
|
||||
r, err := c.account.BeginPasskey(ctx, &pb.BeginPasskeyRequest{Registration: registration})
|
||||
if err != nil {
|
||||
return identity.PasskeyCeremony{}, accountClientError(err)
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func (c *Client) BeginPasskey(ctx context.Context, registration bool) (identity.
|
||||
}
|
||||
|
||||
func (c *Client) FinishPasskey(ctx context.Context, token string, credential []byte, registration bool, name string) (identity.AccountSession, error) {
|
||||
r, err := c.client.FinishPasskey(ctx, &pb.FinishPasskeyRequest{Token: token, Credential: credential, Registration: registration, Name: name})
|
||||
r, err := c.account.FinishPasskey(ctx, &pb.FinishPasskeyRequest{Token: token, Credential: credential, Registration: registration, Name: name})
|
||||
if err != nil {
|
||||
return identity.AccountSession{}, accountClientError(err)
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func (c *Client) FinishPasskey(ctx context.Context, token string, credential []b
|
||||
}
|
||||
|
||||
func (c *Client) ListPasskeys(ctx context.Context) ([]identity.Passkey, error) {
|
||||
r, err := c.client.ListPasskeys(ctx, &pb.ListPasskeysRequest{})
|
||||
r, err := c.account.ListPasskeys(ctx, &pb.ListPasskeysRequest{})
|
||||
if err != nil {
|
||||
return nil, accountClientError(err)
|
||||
}
|
||||
@@ -136,6 +136,6 @@ func (c *Client) ListPasskeys(ctx context.Context) ([]identity.Passkey, error) {
|
||||
}
|
||||
|
||||
func (c *Client) DeletePasskey(ctx context.Context, id string) error {
|
||||
_, err := c.client.DeletePasskey(ctx, &pb.DeletePasskeyRequest{Id: id})
|
||||
_, err := c.account.DeletePasskey(ctx, &pb.DeletePasskeyRequest{Id: id})
|
||||
return accountClientError(err)
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func TestCallerAttribution(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
callers := rpcidentity.Callers{Principals: principalsByID{"alice": "acme"}}
|
||||
update := &grpc.UnaryServerInfo{FullMethod: pb.StateStoreService_Update_FullMethodName}
|
||||
update := &grpc.UnaryServerInfo{FullMethod: pb.TaskService_Update_FullMethodName}
|
||||
// A plaintext peer reached a loopback listener; a TLS peer without a
|
||||
// verified chain presented no client certificate.
|
||||
plaintext := &peer.Peer{}
|
||||
|
||||
@@ -26,19 +26,62 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/logging"
|
||||
)
|
||||
|
||||
// Client is the single remote adapter wrapping one StateStoreServiceClient,
|
||||
// Client is the single remote adapter over the State Store services,
|
||||
// asserted against whichever narrow Go interfaces its caller needs -- exactly
|
||||
// as gatewayrpc.Client asserts both messaging.ChatContract and
|
||||
// messaging.SessionStore.
|
||||
type Client struct {
|
||||
client pb.StateStoreServiceClient
|
||||
controlPlane controlpb.ControlPlaneServiceClient
|
||||
packages pb.PackageServiceClient
|
||||
taskGrant pb.TaskGrantServiceClient
|
||||
harnessSecret pb.HarnessSecretServiceClient
|
||||
account pb.AccountServiceClient
|
||||
identity pb.IdentityServiceClient
|
||||
task pb.TaskServiceClient
|
||||
execution pb.ExecutionServiceClient
|
||||
review pb.ReviewServiceClient
|
||||
taskEvent pb.TaskEventServiceClient
|
||||
stats pb.StatsServiceClient
|
||||
taskLog pb.TaskLogServiceClient
|
||||
status pb.StatusServiceClient
|
||||
capture pb.CaptureServiceClient
|
||||
mapping pb.MappingServiceClient
|
||||
eventType pb.EventTypeServiceClient
|
||||
binding pb.BindingServiceClient
|
||||
dispatch pb.DispatchServiceClient
|
||||
source pb.SourceServiceClient
|
||||
access pb.AccessServiceClient
|
||||
org pb.OrgServiceClient
|
||||
alert pb.AlertServiceClient
|
||||
controlPlane controlpb.ControlPlaneServiceClient
|
||||
}
|
||||
|
||||
// NewClient wraps conn's generated client. Close is a no-op: the store
|
||||
// NewClient wraps conn's generated clients. Close is a no-op: the store
|
||||
// service owns its own DB lifecycle.
|
||||
func NewClient(conn grpc.ClientConnInterface) *Client {
|
||||
return &Client{client: pb.NewStateStoreServiceClient(conn), controlPlane: controlpb.NewControlPlaneServiceClient(conn)}
|
||||
return &Client{
|
||||
packages: pb.NewPackageServiceClient(conn),
|
||||
taskGrant: pb.NewTaskGrantServiceClient(conn),
|
||||
harnessSecret: pb.NewHarnessSecretServiceClient(conn),
|
||||
account: pb.NewAccountServiceClient(conn),
|
||||
identity: pb.NewIdentityServiceClient(conn),
|
||||
task: pb.NewTaskServiceClient(conn),
|
||||
execution: pb.NewExecutionServiceClient(conn),
|
||||
review: pb.NewReviewServiceClient(conn),
|
||||
taskEvent: pb.NewTaskEventServiceClient(conn),
|
||||
stats: pb.NewStatsServiceClient(conn),
|
||||
taskLog: pb.NewTaskLogServiceClient(conn),
|
||||
status: pb.NewStatusServiceClient(conn),
|
||||
capture: pb.NewCaptureServiceClient(conn),
|
||||
mapping: pb.NewMappingServiceClient(conn),
|
||||
eventType: pb.NewEventTypeServiceClient(conn),
|
||||
binding: pb.NewBindingServiceClient(conn),
|
||||
dispatch: pb.NewDispatchServiceClient(conn),
|
||||
source: pb.NewSourceServiceClient(conn),
|
||||
access: pb.NewAccessServiceClient(conn),
|
||||
org: pb.NewOrgServiceClient(conn),
|
||||
alert: pb.NewAlertServiceClient(conn),
|
||||
controlPlane: controlpb.NewControlPlaneServiceClient(conn),
|
||||
}
|
||||
}
|
||||
|
||||
// ControlPlane returns the generic control-plane RPC client on the same authenticated connection.
|
||||
@@ -75,7 +118,7 @@ var (
|
||||
// Lifecycle
|
||||
|
||||
func (c *Client) EnqueueIssue(ctx context.Context, owner, repo string, number int, title, body, labels, identity string) (bool, error) {
|
||||
r, err := c.client.EnqueueIssue(ctx, &pb.EnqueueIssueRequest{Owner: owner, Repo: repo, Number: int64(number), Title: title, Body: body, Labels: labels, Identity: identity})
|
||||
r, err := c.task.EnqueueIssue(ctx, &pb.EnqueueIssueRequest{Owner: owner, Repo: repo, Number: int64(number), Title: title, Body: body, Labels: labels, Identity: identity})
|
||||
if err != nil {
|
||||
return false, unmapError(err)
|
||||
}
|
||||
@@ -83,7 +126,7 @@ func (c *Client) EnqueueIssue(ctx context.Context, owner, repo string, number in
|
||||
}
|
||||
|
||||
func (c *Client) ActiveTasksByOrigin(ctx context.Context, origin string) ([]*task.Task, error) {
|
||||
r, err := c.client.ActiveTasksByOrigin(ctx, &pb.ActiveTasksByOriginRequest{Origin: origin})
|
||||
r, err := c.task.ActiveTasksByOrigin(ctx, &pb.ActiveTasksByOriginRequest{Origin: origin})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -91,7 +134,7 @@ func (c *Client) ActiveTasksByOrigin(ctx context.Context, origin string) ([]*tas
|
||||
}
|
||||
|
||||
func (c *Client) UnpostedOutcomes(ctx context.Context) ([]*task.Task, error) {
|
||||
r, err := c.client.UnpostedOutcomes(ctx, &pb.UnpostedOutcomesRequest{})
|
||||
r, err := c.task.UnpostedOutcomes(ctx, &pb.UnpostedOutcomesRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -99,7 +142,7 @@ func (c *Client) UnpostedOutcomes(ctx context.Context) ([]*task.Task, error) {
|
||||
}
|
||||
|
||||
func (c *Client) MarkOutcomePosted(ctx context.Context, taskID int64, status string) error {
|
||||
_, err := c.client.MarkOutcomePosted(ctx, &pb.MarkOutcomePostedRequest{TaskId: taskID, Status: status})
|
||||
_, err := c.task.MarkOutcomePosted(ctx, &pb.MarkOutcomePostedRequest{TaskId: taskID, Status: status})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
@@ -108,7 +151,7 @@ func (c *Client) EnqueueChatTask(ctx context.Context, owner, repo, title, body,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r, err := c.client.EnqueueChatTask(ctx, &pb.EnqueueChatTaskRequest{Owner: owner, Repo: repo, Title: title, Body: body, Workflow: wf, Identity: identity, InputsJson: encoded, Origin: origin, DraftYaml: draft})
|
||||
r, err := c.task.EnqueueChatTask(ctx, &pb.EnqueueChatTaskRequest{Owner: owner, Repo: repo, Title: title, Body: body, Workflow: wf, Identity: identity, InputsJson: encoded, Origin: origin, DraftYaml: draft})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -116,7 +159,7 @@ func (c *Client) EnqueueChatTask(ctx context.Context, owner, repo, title, body,
|
||||
}
|
||||
|
||||
func (c *Client) ClaimNext(ctx context.Context) (*task.Task, error) {
|
||||
r, err := c.client.ClaimNext(ctx, &pb.ClaimNextRequest{})
|
||||
r, err := c.task.ClaimNext(ctx, &pb.ClaimNextRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -127,7 +170,7 @@ func (c *Client) ClaimNext(ctx context.Context) (*task.Task, error) {
|
||||
}
|
||||
|
||||
func (c *Client) ClaimByIssue(ctx context.Context, owner, repo string, number int) (*task.Task, error) {
|
||||
r, err := c.client.ClaimByIssue(ctx, &pb.ClaimByIssueRequest{Owner: owner, Repo: repo, Number: int64(number)})
|
||||
r, err := c.task.ClaimByIssue(ctx, &pb.ClaimByIssueRequest{Owner: owner, Repo: repo, Number: int64(number)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -138,13 +181,13 @@ func (c *Client) ClaimByIssue(ctx context.Context, owner, repo string, number in
|
||||
}
|
||||
|
||||
func (c *Client) Transition(ctx context.Context, taskID int64, from, to, detail string) error {
|
||||
_, err := c.client.Transition(ctx, &pb.TransitionRequest{TaskId: taskID, From: from, To: to, Detail: detail})
|
||||
_, err := c.task.Transition(ctx, &pb.TransitionRequest{TaskId: taskID, From: from, To: to, Detail: detail})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// TaskModels returns what the task's org resolves models against.
|
||||
func (c *Client) TaskModels(ctx context.Context, taskID int64) (config.OrgModels, error) {
|
||||
r, err := c.client.TaskModels(ctx, &pb.TaskModelsRequest{TaskId: taskID})
|
||||
r, err := c.task.TaskModels(ctx, &pb.TaskModelsRequest{TaskId: taskID})
|
||||
if err != nil {
|
||||
return config.OrgModels{}, unmapError(err)
|
||||
}
|
||||
@@ -158,7 +201,7 @@ func (c *Client) TaskModels(ctx context.Context, taskID int64) (config.OrgModels
|
||||
// TaskInstructions returns the instance and organisation instructions for the
|
||||
// task's org.
|
||||
func (c *Client) TaskInstructions(ctx context.Context, taskID int64) (instance, organisation string, err error) {
|
||||
r, err := c.client.TaskInstructions(ctx, &pb.TaskInstructionsRequest{TaskId: taskID})
|
||||
r, err := c.task.TaskInstructions(ctx, &pb.TaskInstructionsRequest{TaskId: taskID})
|
||||
if err != nil {
|
||||
return "", "", unmapError(err)
|
||||
}
|
||||
@@ -168,7 +211,7 @@ func (c *Client) TaskInstructions(ctx context.Context, taskID int64) (instance,
|
||||
// CallerModels returns the calling principal's org and the aliases it may
|
||||
// use.
|
||||
func (c *Client) CallerModels(ctx context.Context) (string, map[string]string, error) {
|
||||
r, err := c.client.CallerModels(ctx, &pb.CallerModelsRequest{})
|
||||
r, err := c.org.CallerModels(ctx, &pb.CallerModelsRequest{})
|
||||
if err != nil {
|
||||
return "", nil, unmapError(err)
|
||||
}
|
||||
@@ -177,14 +220,14 @@ func (c *Client) CallerModels(ctx context.Context) (string, map[string]string, e
|
||||
|
||||
// RecordUsage appends one model call's usage record.
|
||||
func (c *Client) RecordUsage(ctx context.Context, r usage.Record) error {
|
||||
_, err := c.client.RecordUsage(ctx, &pb.RecordUsageRequest{Record: usageProto(r)})
|
||||
_, err := c.execution.RecordUsage(ctx, &pb.RecordUsageRequest{Record: usageProto(r)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// StartStep and FinishStep record step executions and return the persisted
|
||||
// event.
|
||||
func (c *Client) StartStep(ctx context.Context, s task.StepStart) (int64, events.Event, error) {
|
||||
r, err := c.client.StartStep(ctx, &pb.StartStepRequest{
|
||||
r, err := c.execution.StartStep(ctx, &pb.StartStepRequest{
|
||||
ExecutionId: s.ExecutionID, Attempt: int64(s.Attempt),
|
||||
ParentId: s.ParentID, Kind: s.Kind, Name: s.Name,
|
||||
CalledExecutionId: s.CalledExecutionID,
|
||||
@@ -205,7 +248,7 @@ func (c *Client) StartStep(ctx context.Context, s task.StepStart) (int64, events
|
||||
// and returns the callees it cancelled; the caller cancels the runs'
|
||||
// in-memory contexts afterwards.
|
||||
func (c *Client) CancelExecution(ctx context.Context, taskID int64, reason, to string) ([]int64, error) {
|
||||
r, err := c.client.CancelExecution(ctx, &pb.CancelExecutionRequest{TaskId: taskID, Reason: reason, To: to})
|
||||
r, err := c.execution.CancelExecution(ctx, &pb.CancelExecutionRequest{TaskId: taskID, Reason: reason, To: to})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -213,7 +256,7 @@ func (c *Client) CancelExecution(ctx context.Context, taskID int64, reason, to s
|
||||
}
|
||||
|
||||
func (c *Client) FinishStep(ctx context.Context, s task.StepFinish) (events.Event, error) {
|
||||
r, err := c.client.FinishStep(ctx, &pb.FinishStepRequest{
|
||||
r, err := c.execution.FinishStep(ctx, &pb.FinishStepRequest{
|
||||
ExecutionId: s.ExecutionID, StepId: s.StepID,
|
||||
From: string(s.From), To: string(s.To), Detail: s.Detail, TokensUsed: s.TokensUsed, Results: s.Results,
|
||||
})
|
||||
@@ -228,7 +271,7 @@ func (c *Client) FinishStep(ctx context.Context, s task.StepFinish) (events.Even
|
||||
}
|
||||
|
||||
func (c *Client) ListSteps(ctx context.Context, executionID int64, attempt int) ([]task.StepExecution, error) {
|
||||
r, err := c.client.ListSteps(ctx, &pb.ListStepsRequest{ExecutionId: executionID, Attempt: int64(attempt)})
|
||||
r, err := c.execution.ListSteps(ctx, &pb.ListStepsRequest{ExecutionId: executionID, Attempt: int64(attempt)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -240,22 +283,22 @@ func (c *Client) ListSteps(ctx context.Context, executionID int64, attempt int)
|
||||
}
|
||||
|
||||
func (c *Client) Update(ctx context.Context, t *task.Task) error {
|
||||
_, err := c.client.Update(ctx, &pb.UpdateRequest{Task: taskProto(t)})
|
||||
_, err := c.task.Update(ctx, &pb.UpdateRequest{Task: taskProto(t)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) Requeue(ctx context.Context, taskID int64, fromStatus, wf string) error {
|
||||
_, err := c.client.Requeue(ctx, &pb.RequeueRequest{TaskId: taskID, FromStatus: fromStatus, Workflow: wf})
|
||||
_, err := c.task.Requeue(ctx, &pb.RequeueRequest{TaskId: taskID, FromStatus: fromStatus, Workflow: wf})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) ParkTask(ctx context.Context, taskID int64, from, detail, class, blocker string) error {
|
||||
_, err := c.client.ParkTask(ctx, &pb.ParkTaskRequest{TaskId: taskID, From: from, Detail: detail, Class: class, Blocker: blocker})
|
||||
_, err := c.task.ParkTask(ctx, &pb.ParkTaskRequest{TaskId: taskID, From: from, Detail: detail, Class: class, Blocker: blocker})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) RecoverStale(ctx context.Context) (int64, error) {
|
||||
r, err := c.client.RecoverStale(ctx, &pb.RecoverStaleRequest{})
|
||||
r, err := c.task.RecoverStale(ctx, &pb.RecoverStaleRequest{})
|
||||
if err != nil {
|
||||
return 0, unmapError(err)
|
||||
}
|
||||
@@ -265,7 +308,7 @@ func (c *Client) RecoverStale(ctx context.Context) (int64, error) {
|
||||
// Archive / Retry
|
||||
|
||||
func (c *Client) ArchiveTask(ctx context.Context, taskID int64, fromStatus string, audit events.Event) (int64, error) {
|
||||
r, err := c.client.ArchiveTask(ctx, &pb.ArchiveTaskRequest{TaskId: taskID, FromStatus: fromStatus, Audit: eventProto(audit)})
|
||||
r, err := c.task.ArchiveTask(ctx, &pb.ArchiveTaskRequest{TaskId: taskID, FromStatus: fromStatus, Audit: eventProto(audit)})
|
||||
if err != nil {
|
||||
return 0, unmapError(err)
|
||||
}
|
||||
@@ -273,7 +316,7 @@ func (c *Client) ArchiveTask(ctx context.Context, taskID int64, fromStatus strin
|
||||
}
|
||||
|
||||
func (c *Client) RetryTask(ctx context.Context, taskID int64, fromStatus, wf, retryMode string, resume task.Resume, currentDefinition bool) error {
|
||||
_, err := c.client.RetryTask(ctx, &pb.RetryTaskRequest{
|
||||
_, err := c.task.RetryTask(ctx, &pb.RetryTaskRequest{
|
||||
TaskId: taskID, FromStatus: fromStatus, Workflow: wf, RetryMode: retryMode,
|
||||
ResumeFrom: resume.From, ResumeAfter: resume.After, CurrentDefinition: currentDefinition,
|
||||
})
|
||||
@@ -281,31 +324,31 @@ func (c *Client) RetryTask(ctx context.Context, taskID int64, fromStatus, wf, re
|
||||
}
|
||||
|
||||
func (c *Client) RespondReviewGate(ctx context.Context, taskID int64, fromStatus, gate string, rereview bool, maxRounds int) error {
|
||||
_, err := c.client.RespondReviewGate(ctx, &pb.RespondReviewGateRequest{
|
||||
_, err := c.review.RespondReviewGate(ctx, &pb.RespondReviewGateRequest{
|
||||
TaskId: taskID, FromStatus: fromStatus, Gate: gate, Rereview: rereview, Cap: int64(maxRounds),
|
||||
})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) BeginRemediation(ctx context.Context, taskID int64, payload string) error {
|
||||
_, err := c.client.BeginRemediation(ctx, &pb.BeginRemediationRequest{TaskId: taskID, Payload: payload})
|
||||
_, err := c.review.BeginRemediation(ctx, &pb.BeginRemediationRequest{TaskId: taskID, Payload: payload})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) UpdateReviewPayload(ctx context.Context, taskID int64, payload string) error {
|
||||
_, err := c.client.UpdateReviewPayload(ctx, &pb.UpdateReviewPayloadRequest{TaskId: taskID, Payload: payload})
|
||||
_, err := c.review.UpdateReviewPayload(ctx, &pb.UpdateReviewPayloadRequest{TaskId: taskID, Payload: payload})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) SetReviewCursors(ctx context.Context, taskID, reviewCursor, commentCursor int64) error {
|
||||
_, err := c.client.SetReviewCursors(ctx, &pb.SetReviewCursorsRequest{TaskId: taskID, ReviewCursor: reviewCursor, CommentCursor: commentCursor})
|
||||
_, err := c.review.SetReviewCursors(ctx, &pb.SetReviewCursorsRequest{TaskId: taskID, ReviewCursor: reviewCursor, CommentCursor: commentCursor})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// Queries
|
||||
|
||||
func (c *Client) TaskByIssue(ctx context.Context, owner, repo string, number int) (*task.Task, error) {
|
||||
r, err := c.client.TaskByIssue(ctx, &pb.TaskByIssueRequest{Owner: owner, Repo: repo, Number: int64(number)})
|
||||
r, err := c.task.TaskByIssue(ctx, &pb.TaskByIssueRequest{Owner: owner, Repo: repo, Number: int64(number)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -316,7 +359,7 @@ func (c *Client) TaskByIssue(ctx context.Context, owner, repo string, number int
|
||||
}
|
||||
|
||||
func (c *Client) OpenTaskByPR(ctx context.Context, owner, repo string, number int) (*task.Task, error) {
|
||||
r, err := c.client.OpenTaskByPR(ctx, &pb.OpenTaskByPRRequest{Owner: owner, Repo: repo, Number: int64(number)})
|
||||
r, err := c.task.OpenTaskByPR(ctx, &pb.OpenTaskByPRRequest{Owner: owner, Repo: repo, Number: int64(number)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -327,7 +370,7 @@ func (c *Client) OpenTaskByPR(ctx context.Context, owner, repo string, number in
|
||||
}
|
||||
|
||||
func (c *Client) TaskByID(ctx context.Context, taskID int64) (*task.Task, error) {
|
||||
r, err := c.client.TaskByID(ctx, &pb.TaskByIDRequest{TaskId: taskID})
|
||||
r, err := c.task.TaskByID(ctx, &pb.TaskByIDRequest{TaskId: taskID})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -338,7 +381,7 @@ func (c *Client) TaskByID(ctx context.Context, taskID int64) (*task.Task, error)
|
||||
}
|
||||
|
||||
func (c *Client) OpenPRs(ctx context.Context) ([]task.Task, error) {
|
||||
r, err := c.client.OpenPRs(ctx, &pb.OpenPRsRequest{})
|
||||
r, err := c.task.OpenPRs(ctx, &pb.OpenPRsRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -346,7 +389,7 @@ func (c *Client) OpenPRs(ctx context.Context) ([]task.Task, error) {
|
||||
}
|
||||
|
||||
func (c *Client) ClearTerminalTasks(ctx context.Context) (int64, error) {
|
||||
r, err := c.client.ClearTerminalTasks(ctx, &pb.ClearTerminalTasksRequest{})
|
||||
r, err := c.task.ClearTerminalTasks(ctx, &pb.ClearTerminalTasksRequest{})
|
||||
if err != nil {
|
||||
return 0, unmapError(err)
|
||||
}
|
||||
@@ -360,7 +403,7 @@ func (c *Client) Tasks(ctx context.Context, limit int) ([]task.Task, error) {
|
||||
|
||||
// TasksPage returns one page of tasks, most recently updated first.
|
||||
func (c *Client) TasksPage(ctx context.Context, page storecontract.TaskPage) ([]task.Task, error) {
|
||||
r, err := c.client.Tasks(ctx, &pb.TasksRequest{
|
||||
r, err := c.task.Tasks(ctx, &pb.TasksRequest{
|
||||
Limit: int64(page.Limit), Statuses: page.Statuses, Workflow: page.Workflow,
|
||||
AfterUpdatedAt: timestamp(page.After.UpdatedAt), AfterId: page.After.ID,
|
||||
})
|
||||
@@ -371,7 +414,7 @@ func (c *Client) TasksPage(ctx context.Context, page storecontract.TaskPage) ([]
|
||||
}
|
||||
|
||||
func (c *Client) StatusCounts(ctx context.Context) (map[string]int, error) {
|
||||
r, err := c.client.StatusCounts(ctx, &pb.StatusCountsRequest{})
|
||||
r, err := c.stats.StatusCounts(ctx, &pb.StatusCountsRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -385,7 +428,7 @@ func (c *Client) StatusCounts(ctx context.Context) (map[string]int, error) {
|
||||
// Events
|
||||
|
||||
func (c *Client) InsertEvent(ctx context.Context, e events.Event) (int64, error) {
|
||||
r, err := c.client.InsertEvent(ctx, &pb.InsertEventRequest{Event: eventProto(e)})
|
||||
r, err := c.taskEvent.InsertEvent(ctx, &pb.InsertEventRequest{Event: eventProto(e)})
|
||||
if err != nil {
|
||||
return 0, unmapError(err)
|
||||
}
|
||||
@@ -393,7 +436,7 @@ func (c *Client) InsertEvent(ctx context.Context, e events.Event) (int64, error)
|
||||
}
|
||||
|
||||
func (c *Client) EventsSince(ctx context.Context, cursor string, limit int) ([]events.Event, error) {
|
||||
r, err := c.client.EventsSince(ctx, &pb.EventsSinceRequest{SinceId: cursor, Limit: int64(limit)})
|
||||
r, err := c.taskEvent.EventsSince(ctx, &pb.EventsSinceRequest{SinceId: cursor, Limit: int64(limit)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -401,7 +444,7 @@ func (c *Client) EventsSince(ctx context.Context, cursor string, limit int) ([]e
|
||||
}
|
||||
|
||||
func (c *Client) TaskEvents(ctx context.Context, taskID int64) ([]events.Event, error) {
|
||||
r, err := c.client.TaskEvents(ctx, &pb.TaskEventsRequest{TaskId: taskID})
|
||||
r, err := c.taskEvent.TaskEvents(ctx, &pb.TaskEventsRequest{TaskId: taskID})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -409,7 +452,7 @@ func (c *Client) TaskEvents(ctx context.Context, taskID int64) ([]events.Event,
|
||||
}
|
||||
|
||||
func (c *Client) WorkflowStats(ctx context.Context) ([]storecontract.WorkflowStat, error) {
|
||||
r, err := c.client.WorkflowStats(ctx, &pb.WorkflowStatsRequest{})
|
||||
r, err := c.stats.WorkflowStats(ctx, &pb.WorkflowStatsRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -417,7 +460,7 @@ func (c *Client) WorkflowStats(ctx context.Context) ([]storecontract.WorkflowSta
|
||||
}
|
||||
|
||||
func (c *Client) StageStats(ctx context.Context) ([]storecontract.StageStat, error) {
|
||||
r, err := c.client.StageStats(ctx, &pb.StageStatsRequest{})
|
||||
r, err := c.stats.StageStats(ctx, &pb.StageStatsRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -425,7 +468,7 @@ func (c *Client) StageStats(ctx context.Context) ([]storecontract.StageStat, err
|
||||
}
|
||||
|
||||
func (c *Client) TokensByDay(ctx context.Context, days int) ([]storecontract.DayTokens, error) {
|
||||
r, err := c.client.TokensByDay(ctx, &pb.TokensByDayRequest{Days: int64(days)})
|
||||
r, err := c.stats.TokensByDay(ctx, &pb.TokensByDayRequest{Days: int64(days)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -435,7 +478,7 @@ func (c *Client) TokensByDay(ctx context.Context, days int) ([]storecontract.Day
|
||||
// Capture
|
||||
|
||||
func (c *Client) InsertCapture(ctx context.Context, ce storecontract.CapturedEvent, retention time.Duration, maxEvents int) (string, error) {
|
||||
r, err := c.client.InsertCapture(ctx, &pb.InsertCaptureRequest{Capture: capturedEventProto(ce), RetentionSeconds: int64(retention.Seconds()), MaxEvents: int64(maxEvents)})
|
||||
r, err := c.capture.InsertCapture(ctx, &pb.InsertCaptureRequest{Capture: capturedEventProto(ce), RetentionSeconds: int64(retention.Seconds()), MaxEvents: int64(maxEvents)})
|
||||
if err != nil {
|
||||
return "", unmapError(err)
|
||||
}
|
||||
@@ -446,7 +489,7 @@ func (c *Client) InsertCapture(ctx context.Context, ce storecontract.CapturedEve
|
||||
// server admits it on the administrative token only; a task-scoped grant
|
||||
// cannot reach it (see TaskGrants).
|
||||
func (c *Client) PutConfigSnapshot(ctx context.Context, snapshot storecontract.ConfigSnapshot) error {
|
||||
_, err := c.client.PutConfigSnapshot(ctx, &pb.PutConfigSnapshotRequest{Snapshot: configSnapshotProto(snapshot)})
|
||||
_, err := c.status.PutConfigSnapshot(ctx, &pb.PutConfigSnapshotRequest{Snapshot: configSnapshotProto(snapshot)})
|
||||
if err != nil {
|
||||
return unmapError(err)
|
||||
}
|
||||
@@ -456,7 +499,7 @@ func (c *Client) PutConfigSnapshot(ctx context.Context, snapshot storecontract.C
|
||||
// ConfigSnapshot reads the published projection. found is false, with a nil
|
||||
// error, before a daemon has published one.
|
||||
func (c *Client) ConfigSnapshot(ctx context.Context) (storecontract.ConfigSnapshot, bool, error) {
|
||||
reply, err := c.client.GetConfigSnapshot(ctx, &pb.GetConfigSnapshotRequest{})
|
||||
reply, err := c.status.GetConfigSnapshot(ctx, &pb.GetConfigSnapshotRequest{})
|
||||
if err != nil {
|
||||
return storecontract.ConfigSnapshot{}, false, unmapError(err)
|
||||
}
|
||||
@@ -470,7 +513,7 @@ func (c *Client) ConfigSnapshot(ctx context.Context) (storecontract.ConfigSnapsh
|
||||
// Administrative, like the config snapshot pair: the server admits it on the
|
||||
// administrative token only, so a task-scoped grant cannot reach it.
|
||||
func (c *Client) PutChannelStatus(ctx context.Context, channels []storecontract.ChannelStatus) error {
|
||||
_, err := c.client.PutChannelStatus(ctx, &pb.PutChannelStatusRequest{Channels: channelStatusesProto(channels)})
|
||||
_, err := c.status.PutChannelStatus(ctx, &pb.PutChannelStatusRequest{Channels: channelStatusesProto(channels)})
|
||||
if err != nil {
|
||||
return unmapError(err)
|
||||
}
|
||||
@@ -479,7 +522,7 @@ func (c *Client) PutChannelStatus(ctx context.Context, channels []storecontract.
|
||||
|
||||
// ChannelStatus reads every reported channel.
|
||||
func (c *Client) ChannelStatus(ctx context.Context) ([]storecontract.ChannelStatus, error) {
|
||||
reply, err := c.client.ListChannelStatus(ctx, &pb.ListChannelStatusRequest{})
|
||||
reply, err := c.status.ListChannelStatus(ctx, &pb.ListChannelStatusRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -490,7 +533,7 @@ func (c *Client) ChannelStatus(ctx context.Context) ([]storecontract.ChannelStat
|
||||
// Administrative, like the config snapshot pair: a task-scoped grant cannot
|
||||
// reach it.
|
||||
func (c *Client) PutApplyStatus(ctx context.Context, status storecontract.ApplyStatus) error {
|
||||
_, err := c.client.PutApplyStatus(ctx, &pb.PutApplyStatusRequest{Status: applyStatusProto(status)})
|
||||
_, err := c.status.PutApplyStatus(ctx, &pb.PutApplyStatusRequest{Status: applyStatusProto(status)})
|
||||
if err != nil {
|
||||
return unmapError(err)
|
||||
}
|
||||
@@ -500,7 +543,7 @@ func (c *Client) PutApplyStatus(ctx context.Context, status storecontract.ApplyS
|
||||
// ListApplyStatus reads every process's report. An empty slice means nothing
|
||||
// has reported yet, which is not an error.
|
||||
func (c *Client) ListApplyStatus(ctx context.Context) ([]storecontract.ApplyStatus, error) {
|
||||
reply, err := c.client.ListApplyStatus(ctx, &pb.ListApplyStatusRequest{})
|
||||
reply, err := c.status.ListApplyStatus(ctx, &pb.ListApplyStatusRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -513,7 +556,7 @@ func (c *Client) ListApplyStatus(ctx context.Context) ([]storecontract.ApplyStat
|
||||
|
||||
// PutPresence re-stamps this service instance's record. Administrative.
|
||||
func (c *Client) PutPresence(ctx context.Context, presence storecontract.Presence) error {
|
||||
_, err := c.client.PutPresence(ctx, &pb.PutPresenceRequest{Presence: presenceProto(presence)})
|
||||
_, err := c.status.PutPresence(ctx, &pb.PutPresenceRequest{Presence: presenceProto(presence)})
|
||||
if err != nil {
|
||||
return unmapError(err)
|
||||
}
|
||||
@@ -522,7 +565,7 @@ func (c *Client) PutPresence(ctx context.Context, presence storecontract.Presenc
|
||||
|
||||
// ListPresence reads every service instance's record.
|
||||
func (c *Client) ListPresence(ctx context.Context) ([]storecontract.Presence, error) {
|
||||
reply, err := c.client.ListPresence(ctx, &pb.ListPresenceRequest{})
|
||||
reply, err := c.status.ListPresence(ctx, &pb.ListPresenceRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -535,13 +578,13 @@ func (c *Client) ListPresence(ctx context.Context) ([]storecontract.Presence, er
|
||||
|
||||
// RecordCaptureRefusal counts one event the network rules refused.
|
||||
func (c *Client) RecordCaptureRefusal(ctx context.Context, source, addr string, at time.Time) error {
|
||||
_, err := c.client.RecordCaptureRefusal(ctx, &pb.RecordCaptureRefusalRequest{Source: source, Addr: addr, RefusedAt: timestamp(at)})
|
||||
_, err := c.capture.RecordCaptureRefusal(ctx, &pb.RecordCaptureRefusalRequest{Source: source, Addr: addr, RefusedAt: timestamp(at)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// CaptureRefusals reads each source's refusals since a time.
|
||||
func (c *Client) CaptureRefusals(ctx context.Context, since time.Time) ([]storecontract.CaptureRefusals, error) {
|
||||
reply, err := c.client.ListCaptureRefusals(ctx, &pb.ListCaptureRefusalsRequest{Since: timestamp(since)})
|
||||
reply, err := c.capture.ListCaptureRefusals(ctx, &pb.ListCaptureRefusalsRequest{Since: timestamp(since)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -555,7 +598,7 @@ func (c *Client) CaptureRefusals(ctx context.Context, since time.Time) ([]storec
|
||||
// ListCaptures streams one capture per message; see StreamCaptures in
|
||||
// server.go.
|
||||
func (c *Client) ListCaptures(ctx context.Context, limit int) ([]storecontract.CapturedEvent, error) {
|
||||
stream, err := c.client.StreamCaptures(ctx, &pb.StreamCapturesRequest{Limit: int64(limit)})
|
||||
stream, err := c.capture.StreamCaptures(ctx, &pb.StreamCapturesRequest{Limit: int64(limit)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -575,7 +618,7 @@ func (c *Client) ListCaptures(ctx context.Context, limit int) ([]storecontract.C
|
||||
// Mapping
|
||||
|
||||
func (c *Client) InsertMapping(ctx context.Context, m mapping.Mapping) (string, error) {
|
||||
r, err := c.client.InsertMapping(ctx, &pb.InsertMappingRequest{Mapping: mappingProto(m)})
|
||||
r, err := c.mapping.InsertMapping(ctx, &pb.InsertMappingRequest{Mapping: mappingProto(m)})
|
||||
if err != nil {
|
||||
return "", unmapError(err)
|
||||
}
|
||||
@@ -583,7 +626,7 @@ func (c *Client) InsertMapping(ctx context.Context, m mapping.Mapping) (string,
|
||||
}
|
||||
|
||||
func (c *Client) GetMapping(ctx context.Context, id string) (*mapping.Mapping, error) {
|
||||
r, err := c.client.GetMapping(ctx, &pb.GetMappingRequest{Id: id})
|
||||
r, err := c.mapping.GetMapping(ctx, &pb.GetMappingRequest{Id: id})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -595,7 +638,7 @@ func (c *Client) GetMapping(ctx context.Context, id string) (*mapping.Mapping, e
|
||||
}
|
||||
|
||||
func (c *Client) ListMappings(ctx context.Context) ([]mapping.Mapping, error) {
|
||||
r, err := c.client.ListMappings(ctx, &pb.ListMappingsRequest{})
|
||||
r, err := c.mapping.ListMappings(ctx, &pb.ListMappingsRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -603,24 +646,24 @@ func (c *Client) ListMappings(ctx context.Context) ([]mapping.Mapping, error) {
|
||||
}
|
||||
|
||||
func (c *Client) UpdateMapping(ctx context.Context, m mapping.Mapping) error {
|
||||
_, err := c.client.UpdateMapping(ctx, &pb.UpdateMappingRequest{Mapping: mappingProto(m)})
|
||||
_, err := c.mapping.UpdateMapping(ctx, &pb.UpdateMappingRequest{Mapping: mappingProto(m)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) DeleteMapping(ctx context.Context, id string) error {
|
||||
_, err := c.client.DeleteMapping(ctx, &pb.DeleteMappingRequest{Id: id})
|
||||
_, err := c.mapping.DeleteMapping(ctx, &pb.DeleteMappingRequest{Id: id})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) RecordMappingMatch(ctx context.Context, mappingID, captureID string) error {
|
||||
_, err := c.client.RecordMappingMatch(ctx, &pb.RecordMappingMatchRequest{MappingId: mappingID, CaptureId: captureID})
|
||||
_, err := c.mapping.RecordMappingMatch(ctx, &pb.RecordMappingMatchRequest{MappingId: mappingID, CaptureId: captureID})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// Binding
|
||||
|
||||
func (c *Client) InsertBinding(ctx context.Context, b binding.Binding) (string, error) {
|
||||
r, err := c.client.InsertBinding(ctx, &pb.InsertBindingRequest{Binding: bindingProto(b)})
|
||||
r, err := c.binding.InsertBinding(ctx, &pb.InsertBindingRequest{Binding: bindingProto(b)})
|
||||
if err != nil {
|
||||
return "", unmapError(err)
|
||||
}
|
||||
@@ -628,7 +671,7 @@ func (c *Client) InsertBinding(ctx context.Context, b binding.Binding) (string,
|
||||
}
|
||||
|
||||
func (c *Client) GetBinding(ctx context.Context, id string) (*binding.Binding, error) {
|
||||
r, err := c.client.GetBinding(ctx, &pb.GetBindingRequest{Id: id})
|
||||
r, err := c.binding.GetBinding(ctx, &pb.GetBindingRequest{Id: id})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -640,7 +683,7 @@ func (c *Client) GetBinding(ctx context.Context, id string) (*binding.Binding, e
|
||||
}
|
||||
|
||||
func (c *Client) ListBindings(ctx context.Context) ([]binding.Binding, error) {
|
||||
r, err := c.client.ListBindings(ctx, &pb.ListBindingsRequest{})
|
||||
r, err := c.binding.ListBindings(ctx, &pb.ListBindingsRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -648,7 +691,7 @@ func (c *Client) ListBindings(ctx context.Context) ([]binding.Binding, error) {
|
||||
}
|
||||
|
||||
func (c *Client) ListDispatches(ctx context.Context, filter storecontract.DispatchFilter) ([]storecontract.Dispatch, error) {
|
||||
r, err := c.client.ListDispatches(ctx, &pb.ListDispatchesRequest{
|
||||
r, err := c.dispatch.ListDispatches(ctx, &pb.ListDispatchesRequest{
|
||||
BindingId: filter.BindingID, CaptureId: filter.CaptureID, TaskId: filter.TaskID, Limit: int32(filter.Limit), // the store clamps it
|
||||
})
|
||||
if err != nil {
|
||||
@@ -663,39 +706,39 @@ func (c *Client) ListDispatches(ctx context.Context, filter storecontract.Dispat
|
||||
}
|
||||
|
||||
func (c *Client) UpdateBinding(ctx context.Context, b binding.Binding) error {
|
||||
_, err := c.client.UpdateBinding(ctx, &pb.UpdateBindingRequest{Binding: bindingProto(b)})
|
||||
_, err := c.binding.UpdateBinding(ctx, &pb.UpdateBindingRequest{Binding: bindingProto(b)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) DeleteBinding(ctx context.Context, id string) error {
|
||||
_, err := c.client.DeleteBinding(ctx, &pb.DeleteBindingRequest{Id: id})
|
||||
_, err := c.binding.DeleteBinding(ctx, &pb.DeleteBindingRequest{Id: id})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) PauseBinding(ctx context.Context, id string) error {
|
||||
_, err := c.client.PauseBinding(ctx, &pb.PauseBindingRequest{Id: id})
|
||||
_, err := c.binding.PauseBinding(ctx, &pb.PauseBindingRequest{Id: id})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) ResumeBinding(ctx context.Context, id string) error {
|
||||
_, err := c.client.ResumeBinding(ctx, &pb.ResumeBindingRequest{Id: id})
|
||||
_, err := c.binding.ResumeBinding(ctx, &pb.ResumeBindingRequest{Id: id})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) ApproveBinding(ctx context.Context, id string) error {
|
||||
_, err := c.client.ApproveBinding(ctx, &pb.ApproveBindingRequest{Id: id})
|
||||
_, err := c.binding.ApproveBinding(ctx, &pb.ApproveBindingRequest{Id: id})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// Source
|
||||
|
||||
func (c *Client) InsertSource(ctx context.Context, s source.Source) error {
|
||||
_, err := c.client.InsertSource(ctx, &pb.InsertSourceRequest{Source: sourceProto(s)})
|
||||
_, err := c.source.InsertSource(ctx, &pb.InsertSourceRequest{Source: sourceProto(s)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) GetSource(ctx context.Context, path string) (*source.Source, error) {
|
||||
r, err := c.client.GetSource(ctx, &pb.GetSourceRequest{Path: path})
|
||||
r, err := c.source.GetSource(ctx, &pb.GetSourceRequest{Path: path})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -707,7 +750,7 @@ func (c *Client) GetSource(ctx context.Context, path string) (*source.Source, er
|
||||
}
|
||||
|
||||
func (c *Client) ListSources(ctx context.Context) ([]source.Source, error) {
|
||||
r, err := c.client.ListSources(ctx, &pb.ListSourcesRequest{})
|
||||
r, err := c.source.ListSources(ctx, &pb.ListSourcesRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -715,34 +758,34 @@ func (c *Client) ListSources(ctx context.Context) ([]source.Source, error) {
|
||||
}
|
||||
|
||||
func (c *Client) SetSourceSigning(ctx context.Context, path string, from, to source.Signing) error {
|
||||
_, err := c.client.SetSourceSigning(ctx, &pb.SetSourceSigningRequest{Path: path, From: string(from), To: string(to)})
|
||||
_, err := c.source.SetSourceSigning(ctx, &pb.SetSourceSigningRequest{Path: path, From: string(from), To: string(to)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) SetSourceName(ctx context.Context, path, name string) error {
|
||||
_, err := c.client.SetSourceName(ctx, &pb.SetSourceNameRequest{Path: path, Name: name})
|
||||
_, err := c.source.SetSourceName(ctx, &pb.SetSourceNameRequest{Path: path, Name: name})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) SetSourceDeliveryHeader(ctx context.Context, path, header string) error {
|
||||
_, err := c.client.SetSourceDeliveryHeader(ctx, &pb.SetSourceDeliveryHeaderRequest{Path: path, Header: header})
|
||||
_, err := c.source.SetSourceDeliveryHeader(ctx, &pb.SetSourceDeliveryHeaderRequest{Path: path, Header: header})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) DeleteSource(ctx context.Context, path string) error {
|
||||
_, err := c.client.DeleteSource(ctx, &pb.DeleteSourceRequest{Path: path})
|
||||
_, err := c.source.DeleteSource(ctx, &pb.DeleteSourceRequest{Path: path})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) SetSourceSecret(ctx context.Context, path, secret string) error {
|
||||
_, err := c.client.SetSourceSecret(ctx, &pb.SetSourceSecretRequest{Path: path, Secret: secret})
|
||||
_, err := c.source.SetSourceSecret(ctx, &pb.SetSourceSecretRequest{Path: path, Secret: secret})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// Dispatch
|
||||
|
||||
func (c *Client) ArmedBindingsForSource(ctx context.Context, source string) ([]binding.Binding, error) {
|
||||
r, err := c.client.ArmedBindingsForSource(ctx, &pb.ArmedBindingsForSourceRequest{Source: source})
|
||||
r, err := c.binding.ArmedBindingsForSource(ctx, &pb.ArmedBindingsForSourceRequest{Source: source})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -750,25 +793,25 @@ func (c *Client) ArmedBindingsForSource(ctx context.Context, source string) ([]b
|
||||
}
|
||||
|
||||
func (c *Client) RecordDispatch(ctx context.Context, bindingID string, bindingVersion int64, captureID string, taskID int64, reason string) error {
|
||||
_, err := c.client.RecordDispatch(ctx, &pb.RecordDispatchRequest{BindingId: bindingID, BindingVersion: bindingVersion, CaptureId: captureID, TaskId: taskID, Reason: reason})
|
||||
_, err := c.dispatch.RecordDispatch(ctx, &pb.RecordDispatchRequest{BindingId: bindingID, BindingVersion: bindingVersion, CaptureId: captureID, TaskId: taskID, Reason: reason})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// Playbook dispatch
|
||||
|
||||
func (c *Client) RecordPlaybookDispatch(ctx context.Context, playbookID, playbookVersion, eventID, actionID string) error {
|
||||
_, err := c.client.RecordPlaybookDispatch(ctx, &pb.RecordPlaybookDispatchRequest{PlaybookId: playbookID, PlaybookVersion: playbookVersion, EventId: eventID, ActionId: actionID})
|
||||
_, err := c.dispatch.RecordPlaybookDispatch(ctx, &pb.RecordPlaybookDispatchRequest{PlaybookId: playbookID, PlaybookVersion: playbookVersion, EventId: eventID, ActionId: actionID})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) DeletePlaybookDispatches(ctx context.Context, playbookID string) error {
|
||||
_, err := c.client.DeletePlaybookDispatches(ctx, &pb.DeletePlaybookDispatchesRequest{PlaybookId: playbookID})
|
||||
_, err := c.dispatch.DeletePlaybookDispatches(ctx, &pb.DeletePlaybookDispatchesRequest{PlaybookId: playbookID})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// ListUndispatchedCaptures streams for the same reason as ListCaptures.
|
||||
func (c *Client) ListUndispatchedCaptures(ctx context.Context, bindings []string, limit int) ([]storecontract.CapturedEvent, error) {
|
||||
stream, err := c.client.StreamUndispatchedCaptures(ctx, &pb.StreamUndispatchedCapturesRequest{Bindings: bindings, Limit: int64(limit)})
|
||||
stream, err := c.capture.StreamUndispatchedCaptures(ctx, &pb.StreamUndispatchedCapturesRequest{Bindings: bindings, Limit: int64(limit)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -792,7 +835,7 @@ func (c *Client) EnqueueBindingTask(ctx context.Context, owner, repo, title, bod
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r, err := c.client.EnqueueBindingTask(ctx, &pb.EnqueueBindingTaskRequest{Owner: owner, Repo: repo, Title: title, Body: body, Workflow: wf, Identity: identity, BindingId: bindingID, BindingVersion: int64(bindingVersion), InputsJson: encoded, CaptureId: captureID})
|
||||
r, err := c.dispatch.EnqueueBindingTask(ctx, &pb.EnqueueBindingTaskRequest{Owner: owner, Repo: repo, Title: title, Body: body, Workflow: wf, Identity: identity, BindingId: bindingID, BindingVersion: int64(bindingVersion), InputsJson: encoded, CaptureId: captureID})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -809,7 +852,7 @@ func (c *Client) StartCall(ctx context.Context, callerTaskID int64, callKey, wf
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r, err := c.client.EnqueueCallTask(ctx, &pb.EnqueueCallTaskRequest{CallerTaskId: callerTaskID, CallKey: callKey, Workflow: wf, InputsJson: encoded})
|
||||
r, err := c.task.EnqueueCallTask(ctx, &pb.EnqueueCallTaskRequest{CallerTaskId: callerTaskID, CallKey: callKey, Workflow: wf, InputsJson: encoded})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -817,7 +860,7 @@ func (c *Client) StartCall(ctx context.Context, callerTaskID int64, callKey, wf
|
||||
}
|
||||
|
||||
func (c *Client) CallStatus(ctx context.Context, callerTaskID, callTaskID int64) (string, string, map[string]any, error) {
|
||||
r, err := c.client.WorkflowCallStatus(ctx, &pb.WorkflowCallStatusRequest{CallerTaskId: callerTaskID, CallTaskId: callTaskID})
|
||||
r, err := c.task.WorkflowCallStatus(ctx, &pb.WorkflowCallStatusRequest{CallerTaskId: callerTaskID, CallTaskId: callTaskID})
|
||||
if err != nil {
|
||||
return "", "", nil, unmapError(err)
|
||||
}
|
||||
@@ -831,7 +874,7 @@ func (c *Client) CallStatus(ctx context.Context, callerTaskID, callTaskID int64)
|
||||
// all comes back as an unavailable error, not as an empty page, so a caller
|
||||
// can tell the two apart.
|
||||
func (c *Client) TaskLog(ctx context.Context, taskID int64, attempt int, q logging.Query) (logging.TaskLogPage, error) {
|
||||
r, err := c.client.ReadTaskLog(ctx, taskLogRequestProto(taskID, attempt, q))
|
||||
r, err := c.taskLog.ReadTaskLog(ctx, taskLogRequestProto(taskID, attempt, q))
|
||||
if err != nil {
|
||||
return logging.TaskLogPage{}, unmapError(err)
|
||||
}
|
||||
@@ -863,7 +906,7 @@ func (c *Client) TaskLog(ctx context.Context, taskID int64, attempt int, q loggi
|
||||
// TaskLogContent streams one attempt's log verbatim into w, for a download.
|
||||
// found is false, with a nil error, when the attempt has no log file.
|
||||
func (c *Client) TaskLogContent(ctx context.Context, taskID int64, attempt int, w io.Writer) (bool, error) {
|
||||
stream, err := c.client.StreamTaskLogContent(ctx, &pb.StreamTaskLogContentRequest{TaskId: taskID, Attempt: int64(attempt)})
|
||||
stream, err := c.taskLog.StreamTaskLogContent(ctx, &pb.StreamTaskLogContentRequest{TaskId: taskID, Attempt: int64(attempt)})
|
||||
if err != nil {
|
||||
return false, unmapError(err)
|
||||
}
|
||||
@@ -889,7 +932,7 @@ func (c *Client) TaskLogContent(ctx context.Context, taskID int64, attempt int,
|
||||
// GetHarnessSecret returns the stored OAuth token set for an org/service
|
||||
// credential binding, or storecontract.ErrHarnessSecretNotFound.
|
||||
func (c *Client) GetHarnessSecret(ctx context.Context, org, service string) (harnesssecret.Secret, error) {
|
||||
r, err := c.client.GetHarnessSecret(ctx, &pb.GetHarnessSecretRequest{Service: service, RunCredential: harnesssecret.RunCredential(ctx)})
|
||||
r, err := c.harnessSecret.GetHarnessSecret(ctx, &pb.GetHarnessSecretRequest{Service: service, RunCredential: harnesssecret.RunCredential(ctx)})
|
||||
if err != nil {
|
||||
return harnesssecret.Secret{}, unmapError(err)
|
||||
}
|
||||
@@ -905,6 +948,6 @@ func (c *Client) GetHarnessSecret(ctx context.Context, org, service string) (har
|
||||
// set, called by the setup terminal's first capture and by the egress
|
||||
// proxy's every refresh.
|
||||
func (c *Client) PutHarnessSecret(ctx context.Context, s harnesssecret.Secret) error {
|
||||
_, err := c.client.PutHarnessSecret(ctx, &pb.PutHarnessSecretRequest{Secret: harnessSecretProto(s), RunCredential: harnesssecret.RunCredential(ctx)})
|
||||
_, err := c.harnessSecret.PutHarnessSecret(ctx, &pb.PutHarnessSecretRequest{Secret: harnessSecretProto(s), RunCredential: harnesssecret.RunCredential(ctx)})
|
||||
return unmapError(err)
|
||||
}
|
||||
@@ -70,7 +70,7 @@ func (s *server) eventTypes() (storecontract.EventTypeStore, error) {
|
||||
return s.deps.EventTypes, nil
|
||||
}
|
||||
|
||||
func (s *server) InsertEventType(ctx context.Context, r *pb.InsertEventTypeRequest) (*pb.InsertEventTypeResponse, error) {
|
||||
func (s *eventTypeServer) InsertEventType(ctx context.Context, r *pb.InsertEventTypeRequest) (*pb.InsertEventTypeResponse, error) {
|
||||
et, err := s.eventTypes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -82,7 +82,7 @@ func (s *server) InsertEventType(ctx context.Context, r *pb.InsertEventTypeReque
|
||||
return &pb.InsertEventTypeResponse{Id: id}, nil
|
||||
}
|
||||
|
||||
func (s *server) UpdateEventType(ctx context.Context, r *pb.UpdateEventTypeRequest) (*pb.UpdateEventTypeResponse, error) {
|
||||
func (s *eventTypeServer) UpdateEventType(ctx context.Context, r *pb.UpdateEventTypeRequest) (*pb.UpdateEventTypeResponse, error) {
|
||||
et, err := s.eventTypes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -93,7 +93,7 @@ func (s *server) UpdateEventType(ctx context.Context, r *pb.UpdateEventTypeReque
|
||||
return &pb.UpdateEventTypeResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) DeleteEventType(ctx context.Context, r *pb.DeleteEventTypeRequest) (*pb.DeleteEventTypeResponse, error) {
|
||||
func (s *eventTypeServer) DeleteEventType(ctx context.Context, r *pb.DeleteEventTypeRequest) (*pb.DeleteEventTypeResponse, error) {
|
||||
et, err := s.eventTypes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -104,7 +104,7 @@ func (s *server) DeleteEventType(ctx context.Context, r *pb.DeleteEventTypeReque
|
||||
return &pb.DeleteEventTypeResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListEventTypes(ctx context.Context, _ *pb.ListEventTypesRequest) (*pb.ListEventTypesResponse, error) {
|
||||
func (s *eventTypeServer) ListEventTypes(ctx context.Context, _ *pb.ListEventTypesRequest) (*pb.ListEventTypesResponse, error) {
|
||||
et, err := s.eventTypes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -119,7 +119,7 @@ func (s *server) ListEventTypes(ctx context.Context, _ *pb.ListEventTypesRequest
|
||||
// Client
|
||||
|
||||
func (c *Client) InsertEventType(ctx context.Context, t eventtype.EventType) (string, error) {
|
||||
r, err := c.client.InsertEventType(ctx, &pb.InsertEventTypeRequest{EventType: eventTypeProto(t)})
|
||||
r, err := c.eventType.InsertEventType(ctx, &pb.InsertEventTypeRequest{EventType: eventTypeProto(t)})
|
||||
if err != nil {
|
||||
return "", unmapError(err)
|
||||
}
|
||||
@@ -127,17 +127,17 @@ func (c *Client) InsertEventType(ctx context.Context, t eventtype.EventType) (st
|
||||
}
|
||||
|
||||
func (c *Client) UpdateEventType(ctx context.Context, t eventtype.EventType) error {
|
||||
_, err := c.client.UpdateEventType(ctx, &pb.UpdateEventTypeRequest{EventType: eventTypeProto(t)})
|
||||
_, err := c.eventType.UpdateEventType(ctx, &pb.UpdateEventTypeRequest{EventType: eventTypeProto(t)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) DeleteEventType(ctx context.Context, id string) error {
|
||||
_, err := c.client.DeleteEventType(ctx, &pb.DeleteEventTypeRequest{Id: id})
|
||||
_, err := c.eventType.DeleteEventType(ctx, &pb.DeleteEventTypeRequest{Id: id})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) ListEventTypes(ctx context.Context) ([]eventtype.EventType, error) {
|
||||
r, err := c.client.ListEventTypes(ctx, &pb.ListEventTypesRequest{})
|
||||
r, err := c.eventType.ListEventTypes(ctx, &pb.ListEventTypesRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ func TestHarnessSecretsUseCallerOrg(t *testing.T) {
|
||||
for _, caller := range []org.OrgID{"acme", org.DefaultOrgID, ""} {
|
||||
t.Run(string(caller), func(t *testing.T) {
|
||||
capture := &harnessCapture{}
|
||||
s := &server{deps: Deps{HarnessSecrets: capture}}
|
||||
s := &harnessSecretServer{server: &server{deps: Deps{HarnessSecrets: capture}}}
|
||||
ctx := org.WithOrg(context.Background(), caller)
|
||||
// A stale or malicious client still sending field 1 cannot choose the org.
|
||||
wire := protowire.AppendString(protowire.AppendTag(nil, 1, protowire.BytesType), "victim")
|
||||
@@ -94,7 +94,7 @@ func TestHarnessSecretsUseTaskGrant(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
capture := &harnessCapture{}
|
||||
s := &server{deps: Deps{Grants: grants, Tasks: harnessTasks{err: tt.taskErr}, HarnessSecrets: capture}}
|
||||
s := &harnessSecretServer{server: &server{deps: Deps{Grants: grants, Tasks: harnessTasks{err: tt.taskErr}, HarnessSecrets: capture}}}
|
||||
ctx := org.WithScope(t.Context(), tt.scope)
|
||||
for _, write := range []bool{false, true} {
|
||||
capture.got = harnesssecret.Secret{}
|
||||
@@ -119,8 +119,8 @@ func TestHarnessSecretsUseTaskGrant(t *testing.T) {
|
||||
}
|
||||
|
||||
type harnessRPC struct {
|
||||
pb.StateStoreServiceClient
|
||||
server *server
|
||||
pb.HarnessSecretServiceClient
|
||||
server *harnessSecretServer
|
||||
}
|
||||
|
||||
func (h harnessRPC) GetHarnessSecret(ctx context.Context, r *pb.GetHarnessSecretRequest, _ ...grpc.CallOption) (*pb.GetHarnessSecretResponse, error) {
|
||||
@@ -138,7 +138,7 @@ func TestHarnessSecretClientGrant(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
capture := &harnessCapture{}
|
||||
c := &Client{client: harnessRPC{server: &server{deps: Deps{Grants: grants, Tasks: harnessTasks{}, HarnessSecrets: capture}}}}
|
||||
c := &Client{harnessSecret: harnessRPC{server: &harnessSecretServer{server: &server{deps: Deps{Grants: grants, Tasks: harnessTasks{}, HarnessSecrets: capture}}}}}
|
||||
ctx := harnesssecret.WithRunCredential(t.Context(), token)
|
||||
for _, tt := range []struct {
|
||||
name, org string
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/domain/org"
|
||||
)
|
||||
|
||||
func (s *server) ListIdentities(ctx context.Context, _ *pb.ListIdentitiesRequest) (*pb.ListIdentitiesResponse, error) {
|
||||
func (s *identityServer) ListIdentities(ctx context.Context, _ *pb.ListIdentitiesRequest) (*pb.ListIdentitiesResponse, error) {
|
||||
if s.deps.Identities == nil {
|
||||
return nil, status.Error(codes.Unavailable, "identity store unavailable")
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func (s *server) ListIdentities(ctx context.Context, _ *pb.ListIdentitiesRequest
|
||||
return &pb.ListIdentitiesResponse{Identities: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetIdentity(ctx context.Context, request *pb.GetIdentityRequest) (*pb.GetIdentityResponse, error) {
|
||||
func (s *identityServer) GetIdentity(ctx context.Context, request *pb.GetIdentityRequest) (*pb.GetIdentityResponse, error) {
|
||||
value, err := s.deps.Identities.Get(ctx, identity.IdentityID(request.Id))
|
||||
if errors.Is(err, identity.ErrNotFound) {
|
||||
value, err = s.deps.Identities.ResolveLegacyName(ctx, request.Id)
|
||||
@@ -39,7 +39,7 @@ func (s *server) GetIdentity(ctx context.Context, request *pb.GetIdentityRequest
|
||||
return &pb.GetIdentityResponse{Identity: identityProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) CreateIdentity(ctx context.Context, request *pb.CreateIdentityRequest) (*pb.CreateIdentityResponse, error) {
|
||||
func (s *identityServer) CreateIdentity(ctx context.Context, request *pb.CreateIdentityRequest) (*pb.CreateIdentityResponse, error) {
|
||||
value, err := identity.New(identity.IdentityID(request.Id), identity.Kind(request.Kind), request.DisplayName)
|
||||
if err == nil {
|
||||
value, err = s.deps.Identities.Create(ctx, value, identityAudit(request.Audit))
|
||||
@@ -50,27 +50,27 @@ func (s *server) CreateIdentity(ctx context.Context, request *pb.CreateIdentityR
|
||||
return &pb.CreateIdentityResponse{Identity: identityProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) RenameIdentity(ctx context.Context, request *pb.RenameIdentityRequest) (*pb.RenameIdentityResponse, error) {
|
||||
func (s *identityServer) RenameIdentity(ctx context.Context, request *pb.RenameIdentityRequest) (*pb.RenameIdentityResponse, error) {
|
||||
value, err := s.applyIdentityCommand(ctx, request.Id, request.ExpectedVersion, request.Audit, identity.Command{Type: identity.CommandRename, DisplayName: request.DisplayName})
|
||||
return &pb.RenameIdentityResponse{Identity: identityProto(value)}, err
|
||||
}
|
||||
|
||||
func (s *server) SuspendIdentity(ctx context.Context, request *pb.SuspendIdentityRequest) (*pb.SuspendIdentityResponse, error) {
|
||||
func (s *identityServer) SuspendIdentity(ctx context.Context, request *pb.SuspendIdentityRequest) (*pb.SuspendIdentityResponse, error) {
|
||||
value, err := s.applyIdentityCommand(ctx, request.Id, request.ExpectedVersion, request.Audit, identity.Command{Type: identity.CommandSuspend})
|
||||
return &pb.SuspendIdentityResponse{Identity: identityProto(value)}, err
|
||||
}
|
||||
|
||||
func (s *server) ReactivateIdentity(ctx context.Context, request *pb.ReactivateIdentityRequest) (*pb.ReactivateIdentityResponse, error) {
|
||||
func (s *identityServer) ReactivateIdentity(ctx context.Context, request *pb.ReactivateIdentityRequest) (*pb.ReactivateIdentityResponse, error) {
|
||||
value, err := s.applyIdentityCommand(ctx, request.Id, request.ExpectedVersion, request.Audit, identity.Command{Type: identity.CommandReactivate})
|
||||
return &pb.ReactivateIdentityResponse{Identity: identityProto(value)}, err
|
||||
}
|
||||
|
||||
func (s *server) RetireIdentity(ctx context.Context, request *pb.RetireIdentityRequest) (*pb.RetireIdentityResponse, error) {
|
||||
func (s *identityServer) RetireIdentity(ctx context.Context, request *pb.RetireIdentityRequest) (*pb.RetireIdentityResponse, error) {
|
||||
value, err := s.applyIdentityCommand(ctx, request.Id, request.ExpectedVersion, request.Audit, identity.Command{Type: identity.CommandRetire})
|
||||
return &pb.RetireIdentityResponse{Identity: identityProto(value)}, err
|
||||
}
|
||||
|
||||
func (s *server) ResolveIdentitySubject(ctx context.Context, request *pb.ResolveIdentitySubjectRequest) (*pb.ResolveIdentitySubjectResponse, error) {
|
||||
func (s *identityServer) ResolveIdentitySubject(ctx context.Context, request *pb.ResolveIdentitySubjectRequest) (*pb.ResolveIdentitySubjectResponse, error) {
|
||||
if s.deps.SubjectBindings == nil {
|
||||
return nil, status.Error(codes.Unavailable, "identity subject bindings unavailable")
|
||||
}
|
||||
@@ -81,7 +81,7 @@ func (s *server) ResolveIdentitySubject(ctx context.Context, request *pb.Resolve
|
||||
return &pb.ResolveIdentitySubjectResponse{Identity: identityProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ClaimIdentitySubject(ctx context.Context, request *pb.ClaimIdentitySubjectRequest) (*pb.ClaimIdentitySubjectResponse, error) {
|
||||
func (s *identityServer) ClaimIdentitySubject(ctx context.Context, request *pb.ClaimIdentitySubjectRequest) (*pb.ClaimIdentitySubjectResponse, error) {
|
||||
if s.deps.SubjectBindings == nil {
|
||||
return nil, status.Error(codes.Unavailable, "identity subject bindings unavailable")
|
||||
}
|
||||
@@ -94,7 +94,7 @@ func (s *server) ClaimIdentitySubject(ctx context.Context, request *pb.ClaimIden
|
||||
return &pb.ClaimIdentitySubjectResponse{Identity: identityProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) BindIdentitySubject(ctx context.Context, request *pb.BindIdentitySubjectRequest) (*pb.BindIdentitySubjectResponse, error) {
|
||||
func (s *identityServer) BindIdentitySubject(ctx context.Context, request *pb.BindIdentitySubjectRequest) (*pb.BindIdentitySubjectResponse, error) {
|
||||
if s.deps.SubjectBindings == nil {
|
||||
return nil, status.Error(codes.Unavailable, "identity subject bindings unavailable")
|
||||
}
|
||||
@@ -110,7 +110,7 @@ func (s *server) BindIdentitySubject(ctx context.Context, request *pb.BindIdenti
|
||||
}
|
||||
|
||||
func (c *Client) ResolveSubject(ctx context.Context, subject identity.Subject) (identity.Identity, error) {
|
||||
response, err := c.client.ResolveIdentitySubject(ctx, &pb.ResolveIdentitySubjectRequest{Issuer: subject.Issuer, Subject: subject.Subject})
|
||||
response, err := c.identity.ResolveIdentitySubject(ctx, &pb.ResolveIdentitySubjectRequest{Issuer: subject.Issuer, Subject: subject.Subject})
|
||||
if err != nil {
|
||||
return identity.Identity{}, identityClientError(err)
|
||||
}
|
||||
@@ -118,7 +118,7 @@ func (c *Client) ResolveSubject(ctx context.Context, subject identity.Subject) (
|
||||
}
|
||||
|
||||
func (c *Client) ClaimSubject(ctx context.Context, placeholder, subject identity.Subject) (identity.Identity, error) {
|
||||
response, err := c.client.ClaimIdentitySubject(ctx, &pb.ClaimIdentitySubjectRequest{Issuer: subject.Issuer, Placeholder: placeholder.Subject, Subject: subject.Subject})
|
||||
response, err := c.identity.ClaimIdentitySubject(ctx, &pb.ClaimIdentitySubjectRequest{Issuer: subject.Issuer, Placeholder: placeholder.Subject, Subject: subject.Subject})
|
||||
if err != nil {
|
||||
return identity.Identity{}, identityClientError(err)
|
||||
}
|
||||
@@ -126,7 +126,7 @@ func (c *Client) ClaimSubject(ctx context.Context, placeholder, subject identity
|
||||
}
|
||||
|
||||
func (c *Client) BindSubject(ctx context.Context, id identity.IdentityID, subject identity.Subject, audit identity.Audit) error {
|
||||
_, err := c.client.BindIdentitySubject(ctx, &pb.BindIdentitySubjectRequest{Id: string(id), Issuer: subject.Issuer, Subject: subject.Subject, Audit: auditProto(audit)})
|
||||
_, err := c.identity.BindIdentitySubject(ctx, &pb.BindIdentitySubjectRequest{Id: string(id), Issuer: subject.Issuer, Subject: subject.Subject, Audit: auditProto(audit)})
|
||||
return identityClientError(err)
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ func (s *server) applyIdentityCommand(ctx context.Context, id string, version in
|
||||
}
|
||||
|
||||
func (c *Client) List(ctx context.Context) ([]identity.Identity, error) {
|
||||
response, err := c.client.ListIdentities(ctx, &pb.ListIdentitiesRequest{})
|
||||
response, err := c.identity.ListIdentities(ctx, &pb.ListIdentitiesRequest{})
|
||||
if err != nil {
|
||||
return nil, identityClientError(err)
|
||||
}
|
||||
@@ -152,7 +152,7 @@ func (c *Client) List(ctx context.Context) ([]identity.Identity, error) {
|
||||
}
|
||||
|
||||
func (c *Client) Get(ctx context.Context, id identity.IdentityID) (identity.Identity, error) {
|
||||
response, err := c.client.GetIdentity(ctx, &pb.GetIdentityRequest{Id: string(id)})
|
||||
response, err := c.identity.GetIdentity(ctx, &pb.GetIdentityRequest{Id: string(id)})
|
||||
if err != nil {
|
||||
return identity.Identity{}, identityClientError(err)
|
||||
}
|
||||
@@ -164,7 +164,7 @@ func (c *Client) ResolveLegacyName(ctx context.Context, name string) (identity.I
|
||||
}
|
||||
|
||||
func (c *Client) Create(ctx context.Context, value identity.Identity, audit identity.Audit) (identity.Identity, error) {
|
||||
response, err := c.client.CreateIdentity(ctx, &pb.CreateIdentityRequest{Id: string(value.ID), Kind: string(value.Kind), DisplayName: value.DisplayName, Audit: auditProto(audit)})
|
||||
response, err := c.identity.CreateIdentity(ctx, &pb.CreateIdentityRequest{Id: string(value.ID), Kind: string(value.Kind), DisplayName: value.DisplayName, Audit: auditProto(audit)})
|
||||
if err != nil {
|
||||
return identity.Identity{}, identityClientError(err)
|
||||
}
|
||||
@@ -176,25 +176,25 @@ func (c *Client) Apply(ctx context.Context, id identity.IdentityID, version int6
|
||||
var err error
|
||||
switch command.Type {
|
||||
case identity.CommandRename:
|
||||
response, callErr := c.client.RenameIdentity(ctx, &pb.RenameIdentityRequest{Id: string(id), ExpectedVersion: version, DisplayName: command.DisplayName, Audit: auditProto(audit)})
|
||||
response, callErr := c.identity.RenameIdentity(ctx, &pb.RenameIdentityRequest{Id: string(id), ExpectedVersion: version, DisplayName: command.DisplayName, Audit: auditProto(audit)})
|
||||
err = callErr
|
||||
if response != nil {
|
||||
value = response.Identity
|
||||
}
|
||||
case identity.CommandSuspend:
|
||||
response, callErr := c.client.SuspendIdentity(ctx, &pb.SuspendIdentityRequest{Id: string(id), ExpectedVersion: version, Audit: auditProto(audit)})
|
||||
response, callErr := c.identity.SuspendIdentity(ctx, &pb.SuspendIdentityRequest{Id: string(id), ExpectedVersion: version, Audit: auditProto(audit)})
|
||||
err = callErr
|
||||
if response != nil {
|
||||
value = response.Identity
|
||||
}
|
||||
case identity.CommandReactivate:
|
||||
response, callErr := c.client.ReactivateIdentity(ctx, &pb.ReactivateIdentityRequest{Id: string(id), ExpectedVersion: version, Audit: auditProto(audit)})
|
||||
response, callErr := c.identity.ReactivateIdentity(ctx, &pb.ReactivateIdentityRequest{Id: string(id), ExpectedVersion: version, Audit: auditProto(audit)})
|
||||
err = callErr
|
||||
if response != nil {
|
||||
value = response.Identity
|
||||
}
|
||||
case identity.CommandRetire:
|
||||
response, callErr := c.client.RetireIdentity(ctx, &pb.RetireIdentityRequest{Id: string(id), ExpectedVersion: version, Audit: auditProto(audit)})
|
||||
response, callErr := c.identity.RetireIdentity(ctx, &pb.RetireIdentityRequest{Id: string(id), ExpectedVersion: version, Audit: auditProto(audit)})
|
||||
err = callErr
|
||||
if response != nil {
|
||||
value = response.Identity
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestIdentityStartIsAudited(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
tasks := &auditTasks{failInsert: tt.failInsert}
|
||||
grants := &TaskGrants{Store: credentials{}}
|
||||
s := &server{deps: Deps{Tasks: tasks, Grants: grants, RootIdentity: "root", Identities: executionIdentityRepo{}}}
|
||||
s := &taskGrantServer{server: &server{deps: Deps{Tasks: tasks, Grants: grants, RootIdentity: "root", Identities: executionIdentityRepo{}}}}
|
||||
ctx := access.WithActor(context.Background(), "archied")
|
||||
_, err := s.RegisterTaskGrant(ctx, &pb.RegisterTaskGrantRequest{TaskId: 7, Token: token, LifetimeSeconds: 60})
|
||||
live, _ := grants.taskFor(ctx, token)
|
||||
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/logging"
|
||||
)
|
||||
|
||||
func (s *server) RecentLogs(_ context.Context, r *pb.RecentLogsRequest) (*pb.RecentLogsResponse, error) {
|
||||
func (s *statusServer) RecentLogs(_ context.Context, r *pb.RecentLogsRequest) (*pb.RecentLogsResponse, error) {
|
||||
snapshot, err := logrpc.Encode(s.deps.LogFeed.Read(logrpc.Query(r.Query)))
|
||||
return &pb.RecentLogsResponse{Snapshot: snapshot}, err
|
||||
}
|
||||
|
||||
func (c *Client) RecentLogs(ctx context.Context, q logging.Query) (logging.Result, error) {
|
||||
response, err := c.client.RecentLogs(ctx, &pb.RecentLogsRequest{Query: logrpc.Request(q)})
|
||||
response, err := c.status.RecentLogs(ctx, &pb.RecentLogsRequest{Query: logrpc.Request(q)})
|
||||
return logrpc.Decode(response.GetSnapshot(), err)
|
||||
}
|
||||
@@ -63,7 +63,7 @@ func memberProto(m org.Member) *pb.Member {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *server) ListOrgs(ctx context.Context, _ *pb.ListOrgsRequest) (*pb.ListOrgsResponse, error) {
|
||||
func (s *orgServer) ListOrgs(ctx context.Context, _ *pb.ListOrgsRequest) (*pb.ListOrgsResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -109,7 +109,7 @@ func orgFor(ctx context.Context, requested string) org.OrgID {
|
||||
return caller
|
||||
}
|
||||
|
||||
func (s *server) GetOrg(ctx context.Context, r *pb.GetOrgRequest) (*pb.GetOrgResponse, error) {
|
||||
func (s *orgServer) GetOrg(ctx context.Context, r *pb.GetOrgRequest) (*pb.GetOrgResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -120,7 +120,7 @@ func (s *server) GetOrg(ctx context.Context, r *pb.GetOrgRequest) (*pb.GetOrgRes
|
||||
return &pb.GetOrgResponse{Org: orgProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) CreateOrg(ctx context.Context, r *pb.CreateOrgRequest) (*pb.CreateOrgResponse, error) {
|
||||
func (s *orgServer) CreateOrg(ctx context.Context, r *pb.CreateOrgRequest) (*pb.CreateOrgResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -140,7 +140,7 @@ func (s *server) CreateOrg(ctx context.Context, r *pb.CreateOrgRequest) (*pb.Cre
|
||||
return &pb.CreateOrgResponse{Org: orgProto(value)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListWorkspaces(ctx context.Context, r *pb.ListWorkspacesRequest) (*pb.ListWorkspacesResponse, error) {
|
||||
func (s *orgServer) ListWorkspaces(ctx context.Context, r *pb.ListWorkspacesRequest) (*pb.ListWorkspacesResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -155,7 +155,7 @@ func (s *server) ListWorkspaces(ctx context.Context, r *pb.ListWorkspacesRequest
|
||||
return &pb.ListWorkspacesResponse{Workspaces: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) CreateWorkspace(ctx context.Context, r *pb.CreateWorkspaceRequest) (*pb.CreateWorkspaceResponse, error) {
|
||||
func (s *orgServer) CreateWorkspace(ctx context.Context, r *pb.CreateWorkspaceRequest) (*pb.CreateWorkspaceResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -167,7 +167,7 @@ func (s *server) CreateWorkspace(ctx context.Context, r *pb.CreateWorkspaceReque
|
||||
return &pb.CreateWorkspaceResponse{Workspace: workspaceProto(created)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListMembers(ctx context.Context, r *pb.ListMembersRequest) (*pb.ListMembersResponse, error) {
|
||||
func (s *orgServer) ListMembers(ctx context.Context, r *pb.ListMembersRequest) (*pb.ListMembersResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -182,7 +182,7 @@ func (s *server) ListMembers(ctx context.Context, r *pb.ListMembersRequest) (*pb
|
||||
return &pb.ListMembersResponse{Members: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) SetMembership(ctx context.Context, r *pb.SetMembershipRequest) (*pb.SetMembershipResponse, error) {
|
||||
func (s *orgServer) SetMembership(ctx context.Context, r *pb.SetMembershipRequest) (*pb.SetMembershipResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -198,7 +198,7 @@ func (s *server) SetMembership(ctx context.Context, r *pb.SetMembershipRequest)
|
||||
return &pb.SetMembershipResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) RemoveMembership(ctx context.Context, r *pb.RemoveMembershipRequest) (*pb.RemoveMembershipResponse, error) {
|
||||
func (s *orgServer) RemoveMembership(ctx context.Context, r *pb.RemoveMembershipRequest) (*pb.RemoveMembershipResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -213,7 +213,7 @@ func (s *server) RemoveMembership(ctx context.Context, r *pb.RemoveMembershipReq
|
||||
return &pb.RemoveMembershipResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) AssignAgent(ctx context.Context, r *pb.AssignAgentRequest) (*pb.AssignAgentResponse, error) {
|
||||
func (s *orgServer) AssignAgent(ctx context.Context, r *pb.AssignAgentRequest) (*pb.AssignAgentResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
@@ -227,7 +227,7 @@ func (s *server) AssignAgent(ctx context.Context, r *pb.AssignAgentRequest) (*pb
|
||||
return &pb.AssignAgentResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListOrgAgents(ctx context.Context, r *pb.ListOrgAgentsRequest) (*pb.ListOrgAgentsResponse, error) {
|
||||
func (s *orgServer) ListOrgAgents(ctx context.Context, r *pb.ListOrgAgentsRequest) (*pb.ListOrgAgentsResponse, error) {
|
||||
if s.deps.Orgs == nil {
|
||||
return nil, errOrgsUnavailable
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
var _ org.API = (*Client)(nil)
|
||||
|
||||
func (c *Client) CreateOrg(ctx context.Context, value org.Org, owner identity.IdentityID) (org.Org, error) {
|
||||
r, err := c.client.CreateOrg(ctx, &pb.CreateOrgRequest{Id: string(value.ID), Name: value.Name, OwnerIdentityId: string(owner)})
|
||||
r, err := c.org.CreateOrg(ctx, &pb.CreateOrgRequest{Id: string(value.ID), Name: value.Name, OwnerIdentityId: string(owner)})
|
||||
if err != nil {
|
||||
return org.Org{}, unmapError(err)
|
||||
}
|
||||
@@ -20,7 +20,7 @@ func (c *Client) CreateOrg(ctx context.Context, value org.Org, owner identity.Id
|
||||
}
|
||||
|
||||
func (c *Client) GetOrg(ctx context.Context, id org.OrgID) (org.Org, error) {
|
||||
r, err := c.client.GetOrg(ctx, &pb.GetOrgRequest{OrgId: string(id)})
|
||||
r, err := c.org.GetOrg(ctx, &pb.GetOrgRequest{OrgId: string(id)})
|
||||
if err != nil {
|
||||
return org.Org{}, unmapError(err)
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func (c *Client) GetOrg(ctx context.Context, id org.OrgID) (org.Org, error) {
|
||||
}
|
||||
|
||||
func (c *Client) ListOrgs(ctx context.Context) ([]org.Org, error) {
|
||||
r, err := c.client.ListOrgs(ctx, &pb.ListOrgsRequest{})
|
||||
r, err := c.org.ListOrgs(ctx, &pb.ListOrgsRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -36,7 +36,7 @@ func (c *Client) ListOrgs(ctx context.Context) ([]org.Org, error) {
|
||||
}
|
||||
|
||||
func (c *Client) CreateWorkspace(ctx context.Context, value org.Workspace) (org.Workspace, error) {
|
||||
r, err := c.client.CreateWorkspace(ctx, &pb.CreateWorkspaceRequest{
|
||||
r, err := c.org.CreateWorkspace(ctx, &pb.CreateWorkspaceRequest{
|
||||
OrgId: string(value.OrgID), Id: string(value.ID), Name: value.Name, Environment: value.Environment,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -46,7 +46,7 @@ func (c *Client) CreateWorkspace(ctx context.Context, value org.Workspace) (org.
|
||||
}
|
||||
|
||||
func (c *Client) ListWorkspaces(ctx context.Context, id org.OrgID) ([]org.Workspace, error) {
|
||||
r, err := c.client.ListWorkspaces(ctx, &pb.ListWorkspacesRequest{OrgId: string(id)})
|
||||
r, err := c.org.ListWorkspaces(ctx, &pb.ListWorkspacesRequest{OrgId: string(id)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func (c *Client) ListWorkspaces(ctx context.Context, id org.OrgID) ([]org.Worksp
|
||||
}
|
||||
|
||||
func (c *Client) EnsureMembership(ctx context.Context, value org.Membership) error {
|
||||
_, err := c.client.SetMembership(ctx, &pb.SetMembershipRequest{
|
||||
_, err := c.org.SetMembership(ctx, &pb.SetMembershipRequest{
|
||||
OrgId: string(value.OrgID), IdentityId: string(value.IdentityID),
|
||||
WorkspaceId: string(value.WorkspaceID), Role: string(value.Role),
|
||||
})
|
||||
@@ -62,7 +62,7 @@ func (c *Client) EnsureMembership(ctx context.Context, value org.Membership) err
|
||||
}
|
||||
|
||||
func (c *Client) ListMembers(ctx context.Context, id org.OrgID) ([]org.Member, error) {
|
||||
r, err := c.client.ListMembers(ctx, &pb.ListMembersRequest{OrgId: string(id)})
|
||||
r, err := c.org.ListMembers(ctx, &pb.ListMembersRequest{OrgId: string(id)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -75,19 +75,19 @@ func (c *Client) ListMembers(ctx context.Context, id org.OrgID) ([]org.Member, e
|
||||
}
|
||||
|
||||
func (c *Client) RemoveMembership(ctx context.Context, value org.Membership) error {
|
||||
_, err := c.client.RemoveMembership(ctx, &pb.RemoveMembershipRequest{
|
||||
_, err := c.org.RemoveMembership(ctx, &pb.RemoveMembershipRequest{
|
||||
OrgId: string(value.OrgID), IdentityId: string(value.IdentityID), WorkspaceId: string(value.WorkspaceID),
|
||||
})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) AssignAgent(ctx context.Context, value org.AgentAssignment) error {
|
||||
_, err := c.client.AssignAgent(ctx, &pb.AssignAgentRequest{OrgId: string(value.OrgID), IdentityId: string(value.IdentityID)})
|
||||
_, err := c.org.AssignAgent(ctx, &pb.AssignAgentRequest{OrgId: string(value.OrgID), IdentityId: string(value.IdentityID)})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) ListOrgAgents(ctx context.Context, id org.OrgID) ([]org.AgentAssignment, error) {
|
||||
r, err := c.client.ListOrgAgents(ctx, &pb.ListOrgAgentsRequest{OrgId: string(id)})
|
||||
r, err := c.org.ListOrgAgents(ctx, &pb.ListOrgAgentsRequest{OrgId: string(id)})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ func (*fakeOrgs) OrgForIdentity(context.Context, identity.IdentityID) (org.OrgID
|
||||
// move a call into another org.
|
||||
func TestOrgRPCsActInTheCallersOrg(t *testing.T) {
|
||||
repo := &fakeOrgs{}
|
||||
s := &server{deps: Deps{Orgs: repo, Log: slog.New(slog.DiscardHandler)}}
|
||||
s := &orgServer{server: &server{deps: Deps{Orgs: repo, Log: slog.New(slog.DiscardHandler)}}}
|
||||
ctx := org.WithScope(org.WithOrg(context.Background(), "acme"), "acme")
|
||||
|
||||
got, err := s.GetOrg(ctx, &pb.GetOrgRequest{OrgId: "other"})
|
||||
@@ -123,7 +123,7 @@ func TestOrgRPCsActInTheCallersOrg(t *testing.T) {
|
||||
// TestSetMembershipRefusesUnknownRole pins that the store's role validation
|
||||
// reaches the wire as InvalidArgument and names the role.
|
||||
func TestSetMembershipRefusesUnknownRole(t *testing.T) {
|
||||
s := &server{deps: Deps{Orgs: &fakeOrgs{}, Log: slog.New(slog.DiscardHandler)}}
|
||||
s := &orgServer{server: &server{deps: Deps{Orgs: &fakeOrgs{}, Log: slog.New(slog.DiscardHandler)}}}
|
||||
_, err := s.SetMembership(org.WithOrg(context.Background(), "acme"), &pb.SetMembershipRequest{IdentityId: "sam", Role: "superuser"})
|
||||
if status.Code(err) != codes.InvalidArgument || !strings.Contains(status.Convert(err).Message(), "superuser") {
|
||||
t.Fatalf("err = %v, want InvalidArgument naming the role", err)
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/domain/storepkg"
|
||||
)
|
||||
|
||||
func (s *server) InstallPackage(ctx context.Context, request *pb.InstallPackageRequest) (*pb.InstallPackageResponse, error) {
|
||||
func (s *packageServer) InstallPackage(ctx context.Context, request *pb.InstallPackageRequest) (*pb.InstallPackageResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -23,7 +23,7 @@ func (s *server) InstallPackage(ctx context.Context, request *pb.InstallPackageR
|
||||
return &pb.InstallPackageResponse{Package: packageProto(p, true)}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetInstalledPackage(ctx context.Context, request *pb.GetInstalledPackageRequest) (*pb.GetInstalledPackageResponse, error) {
|
||||
func (s *packageServer) GetInstalledPackage(ctx context.Context, request *pb.GetInstalledPackageRequest) (*pb.GetInstalledPackageResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func (s *server) GetInstalledPackage(ctx context.Context, request *pb.GetInstall
|
||||
return &pb.GetInstalledPackageResponse{Package: packageProto(p, true)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListInstalledPackages(ctx context.Context, request *pb.ListInstalledPackagesRequest) (*pb.ListInstalledPackagesResponse, error) {
|
||||
func (s *packageServer) ListInstalledPackages(ctx context.Context, request *pb.ListInstalledPackagesRequest) (*pb.ListInstalledPackagesResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -49,7 +49,7 @@ func (s *server) ListInstalledPackages(ctx context.Context, request *pb.ListInst
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (s *server) AcceptPackageAuthority(ctx context.Context, request *pb.AcceptPackageAuthorityRequest) (*pb.AcceptPackageAuthorityResponse, error) {
|
||||
func (s *packageServer) AcceptPackageAuthority(ctx context.Context, request *pb.AcceptPackageAuthorityRequest) (*pb.AcceptPackageAuthorityResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -60,7 +60,7 @@ func (s *server) AcceptPackageAuthority(ctx context.Context, request *pb.AcceptP
|
||||
return &pb.AcceptPackageAuthorityResponse{Package: packageProto(p, true)}, nil
|
||||
}
|
||||
|
||||
func (s *server) RemoveInstalledPackage(ctx context.Context, request *pb.RemoveInstalledPackageRequest) (*pb.RemoveInstalledPackageResponse, error) {
|
||||
func (s *packageServer) RemoveInstalledPackage(ctx context.Context, request *pb.RemoveInstalledPackageRequest) (*pb.RemoveInstalledPackageResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func (s *server) RemoveInstalledPackage(ctx context.Context, request *pb.RemoveI
|
||||
}
|
||||
|
||||
func (c *Client) InstallPackage(ctx context.Context, name, reference, digest string) (storepkg.Installed, error) {
|
||||
response, err := c.client.InstallPackage(ctx, &pb.InstallPackageRequest{Name: name, Reference: reference, Digest: digest})
|
||||
response, err := c.packages.InstallPackage(ctx, &pb.InstallPackageRequest{Name: name, Reference: reference, Digest: digest})
|
||||
if err != nil {
|
||||
return storepkg.Installed{}, unmapError(err)
|
||||
}
|
||||
@@ -79,7 +79,7 @@ func (c *Client) InstallPackage(ctx context.Context, name, reference, digest str
|
||||
}
|
||||
|
||||
func (c *Client) GetInstalled(ctx context.Context, name string) (storepkg.Installed, error) {
|
||||
response, err := c.client.GetInstalledPackage(ctx, &pb.GetInstalledPackageRequest{Name: name})
|
||||
response, err := c.packages.GetInstalledPackage(ctx, &pb.GetInstalledPackageRequest{Name: name})
|
||||
if err != nil {
|
||||
return storepkg.Installed{}, unmapError(err)
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func (c *Client) GetInstalled(ctx context.Context, name string) (storepkg.Instal
|
||||
}
|
||||
|
||||
func (c *Client) ListInstalled(ctx context.Context) ([]storepkg.Installed, error) {
|
||||
response, err := c.client.ListInstalledPackages(ctx, &pb.ListInstalledPackagesRequest{})
|
||||
response, err := c.packages.ListInstalledPackages(ctx, &pb.ListInstalledPackagesRequest{})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -103,12 +103,12 @@ func (c *Client) ListInstalled(ctx context.Context) ([]storepkg.Installed, error
|
||||
}
|
||||
|
||||
func (c *Client) RemoveInstalled(ctx context.Context, name string) error {
|
||||
_, err := c.client.RemoveInstalledPackage(ctx, &pb.RemoveInstalledPackageRequest{Name: name})
|
||||
_, err := c.packages.RemoveInstalledPackage(ctx, &pb.RemoveInstalledPackageRequest{Name: name})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
func (c *Client) AcceptPackageAuthority(ctx context.Context, name string, accepted storepkg.Authority) (storepkg.Installed, error) {
|
||||
response, err := c.client.AcceptPackageAuthority(ctx, &pb.AcceptPackageAuthorityRequest{
|
||||
response, err := c.packages.AcceptPackageAuthority(ctx, &pb.AcceptPackageAuthorityRequest{
|
||||
Name: name, Accepted: authorityProto(accepted),
|
||||
})
|
||||
if err != nil {
|
||||
@@ -201,7 +201,7 @@ func authorityPtr(value *pb.PackageAuthority) *storepkg.Authority {
|
||||
return &authority
|
||||
}
|
||||
|
||||
func (s *server) ListCatalogue(ctx context.Context, _ *pb.ListCatalogueRequest) (*pb.ListCatalogueResponse, error) {
|
||||
func (s *packageServer) ListCatalogue(ctx context.Context, _ *pb.ListCatalogueRequest) (*pb.ListCatalogueResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -219,7 +219,7 @@ func (s *server) ListCatalogue(ctx context.Context, _ *pb.ListCatalogueRequest)
|
||||
return &pb.ListCatalogueResponse{Packages: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) InstallFromCatalogue(ctx context.Context, request *pb.InstallFromCatalogueRequest) (*pb.InstallFromCatalogueResponse, error) {
|
||||
func (s *packageServer) InstallFromCatalogue(ctx context.Context, request *pb.InstallFromCatalogueRequest) (*pb.InstallFromCatalogueResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -231,7 +231,7 @@ func (s *server) InstallFromCatalogue(ctx context.Context, request *pb.InstallFr
|
||||
}
|
||||
|
||||
func (c *Client) ListCatalogue(ctx context.Context) (storepkg.Catalogue, error) {
|
||||
response, err := c.client.ListCatalogue(ctx, &pb.ListCatalogueRequest{})
|
||||
response, err := c.packages.ListCatalogue(ctx, &pb.ListCatalogueRequest{})
|
||||
if err != nil {
|
||||
return storepkg.Catalogue{}, unmapError(err)
|
||||
}
|
||||
@@ -246,14 +246,14 @@ func (c *Client) ListCatalogue(ctx context.Context) (storepkg.Catalogue, error)
|
||||
}
|
||||
|
||||
func (c *Client) InstallFromCatalogue(ctx context.Context, name string) (storepkg.Installed, error) {
|
||||
response, err := c.client.InstallFromCatalogue(ctx, &pb.InstallFromCatalogueRequest{Name: name})
|
||||
response, err := c.packages.InstallFromCatalogue(ctx, &pb.InstallFromCatalogueRequest{Name: name})
|
||||
if err != nil {
|
||||
return storepkg.Installed{}, unmapError(err)
|
||||
}
|
||||
return packageValue(response.GetPackage())
|
||||
}
|
||||
|
||||
func (s *server) UpdatePackage(ctx context.Context, request *pb.UpdatePackageRequest) (*pb.UpdatePackageResponse, error) {
|
||||
func (s *packageServer) UpdatePackage(ctx context.Context, request *pb.UpdatePackageRequest) (*pb.UpdatePackageResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -264,7 +264,7 @@ func (s *server) UpdatePackage(ctx context.Context, request *pb.UpdatePackageReq
|
||||
return &pb.UpdatePackageResponse{Package: packageProto(p, true)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ApprovePackageUpdate(ctx context.Context, request *pb.ApprovePackageUpdateRequest) (*pb.ApprovePackageUpdateResponse, error) {
|
||||
func (s *packageServer) ApprovePackageUpdate(ctx context.Context, request *pb.ApprovePackageUpdateRequest) (*pb.ApprovePackageUpdateResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -275,7 +275,7 @@ func (s *server) ApprovePackageUpdate(ctx context.Context, request *pb.ApprovePa
|
||||
return &pb.ApprovePackageUpdateResponse{Package: packageProto(p, true)}, nil
|
||||
}
|
||||
|
||||
func (s *server) RollbackPackage(ctx context.Context, request *pb.RollbackPackageRequest) (*pb.RollbackPackageResponse, error) {
|
||||
func (s *packageServer) RollbackPackage(ctx context.Context, request *pb.RollbackPackageRequest) (*pb.RollbackPackageResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -287,7 +287,7 @@ func (s *server) RollbackPackage(ctx context.Context, request *pb.RollbackPackag
|
||||
}
|
||||
|
||||
func (c *Client) UpdatePackage(ctx context.Context, name string) (storepkg.Installed, error) {
|
||||
response, err := c.client.UpdatePackage(ctx, &pb.UpdatePackageRequest{Name: name})
|
||||
response, err := c.packages.UpdatePackage(ctx, &pb.UpdatePackageRequest{Name: name})
|
||||
if err != nil {
|
||||
return storepkg.Installed{}, unmapError(err)
|
||||
}
|
||||
@@ -295,7 +295,7 @@ func (c *Client) UpdatePackage(ctx context.Context, name string) (storepkg.Insta
|
||||
}
|
||||
|
||||
func (c *Client) ApprovePackageUpdate(ctx context.Context, name string) (storepkg.Installed, error) {
|
||||
response, err := c.client.ApprovePackageUpdate(ctx, &pb.ApprovePackageUpdateRequest{Name: name})
|
||||
response, err := c.packages.ApprovePackageUpdate(ctx, &pb.ApprovePackageUpdateRequest{Name: name})
|
||||
if err != nil {
|
||||
return storepkg.Installed{}, unmapError(err)
|
||||
}
|
||||
@@ -303,14 +303,14 @@ func (c *Client) ApprovePackageUpdate(ctx context.Context, name string) (storepk
|
||||
}
|
||||
|
||||
func (c *Client) RollbackPackage(ctx context.Context, name string) (storepkg.Installed, error) {
|
||||
response, err := c.client.RollbackPackage(ctx, &pb.RollbackPackageRequest{Name: name})
|
||||
response, err := c.packages.RollbackPackage(ctx, &pb.RollbackPackageRequest{Name: name})
|
||||
if err != nil {
|
||||
return storepkg.Installed{}, unmapError(err)
|
||||
}
|
||||
return packageValue(response.GetPackage())
|
||||
}
|
||||
|
||||
func (s *server) SetPackageUpdatePolicy(ctx context.Context, request *pb.SetPackageUpdatePolicyRequest) (*pb.SetPackageUpdatePolicyResponse, error) {
|
||||
func (s *packageServer) SetPackageUpdatePolicy(ctx context.Context, request *pb.SetPackageUpdatePolicyRequest) (*pb.SetPackageUpdatePolicyResponse, error) {
|
||||
if s.deps.Packages == nil {
|
||||
return nil, status.Error(codes.Unavailable, "package store unavailable")
|
||||
}
|
||||
@@ -322,7 +322,7 @@ func (s *server) SetPackageUpdatePolicy(ctx context.Context, request *pb.SetPack
|
||||
}
|
||||
|
||||
func (c *Client) SetPackageUpdatePolicy(ctx context.Context, name, policy string) (storepkg.Installed, error) {
|
||||
response, err := c.client.SetPackageUpdatePolicy(ctx, &pb.SetPackageUpdatePolicyRequest{Name: name, Policy: policy})
|
||||
response, err := c.packages.SetPackageUpdatePolicy(ctx, &pb.SetPackageUpdatePolicyRequest{Name: name, Policy: policy})
|
||||
if err != nil {
|
||||
return storepkg.Installed{}, unmapError(err)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func tokenAudit(ctx context.Context, owner identity.IdentityID, id string) ident
|
||||
return identity.Audit{ActorID: owner, Source: access.SourceFromContext(ctx), RequestID: "personal-token:" + id}
|
||||
}
|
||||
|
||||
func (s *server) AddPersonalToken(ctx context.Context, r *pb.AddPersonalTokenRequest) (*pb.AddPersonalTokenResponse, error) {
|
||||
func (s *accountServer) AddPersonalToken(ctx context.Context, r *pb.AddPersonalTokenRequest) (*pb.AddPersonalTokenResponse, error) {
|
||||
owner, err := s.tokenOwner(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -53,7 +53,7 @@ func (s *server) AddPersonalToken(ctx context.Context, r *pb.AddPersonalTokenReq
|
||||
return &pb.AddPersonalTokenResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListPersonalTokens(ctx context.Context, _ *pb.ListPersonalTokensRequest) (*pb.ListPersonalTokensResponse, error) {
|
||||
func (s *accountServer) ListPersonalTokens(ctx context.Context, _ *pb.ListPersonalTokensRequest) (*pb.ListPersonalTokensResponse, error) {
|
||||
owner, err := s.tokenOwner(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -69,7 +69,7 @@ func (s *server) ListPersonalTokens(ctx context.Context, _ *pb.ListPersonalToken
|
||||
return &pb.ListPersonalTokensResponse{Tokens: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) RevokePersonalToken(ctx context.Context, r *pb.RevokePersonalTokenRequest) (*pb.RevokePersonalTokenResponse, error) {
|
||||
func (s *accountServer) RevokePersonalToken(ctx context.Context, r *pb.RevokePersonalTokenRequest) (*pb.RevokePersonalTokenResponse, error) {
|
||||
owner, err := s.tokenOwner(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -85,12 +85,12 @@ func (s *server) RevokePersonalToken(ctx context.Context, r *pb.RevokePersonalTo
|
||||
}
|
||||
|
||||
func (c *Client) AddPersonalToken(ctx context.Context, subject identity.Subject) error {
|
||||
_, err := c.client.AddPersonalToken(ctx, &pb.AddPersonalTokenRequest{Id: subject.Subject})
|
||||
_, err := c.account.AddPersonalToken(ctx, &pb.AddPersonalTokenRequest{Id: subject.Subject})
|
||||
return identityClientError(err)
|
||||
}
|
||||
|
||||
func (c *Client) ListPersonalTokens(ctx context.Context) ([]identity.PersonalToken, error) {
|
||||
r, err := c.client.ListPersonalTokens(ctx, &pb.ListPersonalTokensRequest{})
|
||||
r, err := c.account.ListPersonalTokens(ctx, &pb.ListPersonalTokensRequest{})
|
||||
if err != nil {
|
||||
return nil, identityClientError(err)
|
||||
}
|
||||
@@ -102,6 +102,6 @@ func (c *Client) ListPersonalTokens(ctx context.Context) ([]identity.PersonalTok
|
||||
}
|
||||
|
||||
func (c *Client) RevokePersonalToken(ctx context.Context, id string) error {
|
||||
_, err := c.client.RevokePersonalToken(ctx, &pb.RevokePersonalTokenRequest{Id: id})
|
||||
_, err := c.account.RevokePersonalToken(ctx, &pb.RevokePersonalTokenRequest{Id: id})
|
||||
return identityClientError(err)
|
||||
}
|
||||
@@ -36,7 +36,7 @@ func TestPersonalTokenOwner(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
store := &tokenCalls{}
|
||||
s := &server{deps: Deps{PersonalTokens: store}}
|
||||
s := &accountServer{server: &server{deps: Deps{PersonalTokens: store}}}
|
||||
ctx := context.Background()
|
||||
if tt.principal != nil {
|
||||
ctx = access.WithPrincipal(ctx, *tt.principal)
|
||||
|
||||
@@ -160,12 +160,118 @@ type Deps struct {
|
||||
Log *slog.Logger
|
||||
}
|
||||
|
||||
// server holds what every State Store service shares; each contract has its
|
||||
// own server type embedding it.
|
||||
type server struct {
|
||||
pb.UnimplementedStateStoreServiceServer
|
||||
deps Deps
|
||||
}
|
||||
|
||||
// RegisterServer registers the StateStore gRPC service against registrar,
|
||||
type packageServer struct {
|
||||
pb.UnimplementedPackageServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type taskGrantServer struct {
|
||||
pb.UnimplementedTaskGrantServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type harnessSecretServer struct {
|
||||
pb.UnimplementedHarnessSecretServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type accountServer struct {
|
||||
pb.UnimplementedAccountServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type identityServer struct {
|
||||
pb.UnimplementedIdentityServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type taskServer struct {
|
||||
pb.UnimplementedTaskServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type executionServer struct {
|
||||
pb.UnimplementedExecutionServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type reviewServer struct {
|
||||
pb.UnimplementedReviewServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type taskEventServer struct {
|
||||
pb.UnimplementedTaskEventServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type statsServer struct {
|
||||
pb.UnimplementedStatsServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type taskLogServer struct {
|
||||
pb.UnimplementedTaskLogServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type statusServer struct {
|
||||
pb.UnimplementedStatusServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type captureServer struct {
|
||||
pb.UnimplementedCaptureServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type mappingServer struct {
|
||||
pb.UnimplementedMappingServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type eventTypeServer struct {
|
||||
pb.UnimplementedEventTypeServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type bindingServer struct {
|
||||
pb.UnimplementedBindingServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type dispatchServer struct {
|
||||
pb.UnimplementedDispatchServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type sourceServer struct {
|
||||
pb.UnimplementedSourceServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type accessServer struct {
|
||||
pb.UnimplementedAccessServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type orgServer struct {
|
||||
pb.UnimplementedOrgServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
type alertServer struct {
|
||||
pb.UnimplementedAlertServiceServer
|
||||
*server
|
||||
}
|
||||
|
||||
// RegisterServer registers the State Store gRPC services against registrar,
|
||||
// backed by deps. Optionally wrap registrar's interceptor chain with
|
||||
// TokenInterceptor for the bridge-address (agent-consumed) topology; the caller
|
||||
// decides.
|
||||
@@ -173,7 +279,28 @@ func RegisterServer(registrar grpc.ServiceRegistrar, deps Deps) {
|
||||
if deps.Log == nil {
|
||||
deps.Log = slog.New(slog.DiscardHandler)
|
||||
}
|
||||
pb.RegisterStateStoreServiceServer(registrar, &server{deps: deps})
|
||||
s := &server{deps: deps}
|
||||
pb.RegisterPackageServiceServer(registrar, &packageServer{server: s})
|
||||
pb.RegisterTaskGrantServiceServer(registrar, &taskGrantServer{server: s})
|
||||
pb.RegisterHarnessSecretServiceServer(registrar, &harnessSecretServer{server: s})
|
||||
pb.RegisterAccountServiceServer(registrar, &accountServer{server: s})
|
||||
pb.RegisterIdentityServiceServer(registrar, &identityServer{server: s})
|
||||
pb.RegisterTaskServiceServer(registrar, &taskServer{server: s})
|
||||
pb.RegisterExecutionServiceServer(registrar, &executionServer{server: s})
|
||||
pb.RegisterReviewServiceServer(registrar, &reviewServer{server: s})
|
||||
pb.RegisterTaskEventServiceServer(registrar, &taskEventServer{server: s})
|
||||
pb.RegisterStatsServiceServer(registrar, &statsServer{server: s})
|
||||
pb.RegisterTaskLogServiceServer(registrar, &taskLogServer{server: s})
|
||||
pb.RegisterStatusServiceServer(registrar, &statusServer{server: s})
|
||||
pb.RegisterCaptureServiceServer(registrar, &captureServer{server: s})
|
||||
pb.RegisterMappingServiceServer(registrar, &mappingServer{server: s})
|
||||
pb.RegisterEventTypeServiceServer(registrar, &eventTypeServer{server: s})
|
||||
pb.RegisterBindingServiceServer(registrar, &bindingServer{server: s})
|
||||
pb.RegisterDispatchServiceServer(registrar, &dispatchServer{server: s})
|
||||
pb.RegisterSourceServiceServer(registrar, &sourceServer{server: s})
|
||||
pb.RegisterAccessServiceServer(registrar, &accessServer{server: s})
|
||||
pb.RegisterOrgServiceServer(registrar, &orgServer{server: s})
|
||||
pb.RegisterAlertServiceServer(registrar, &alertServer{server: s})
|
||||
if deps.ControlPlane != nil {
|
||||
controlpb.RegisterControlPlaneServiceServer(registrar, deps.ControlPlane)
|
||||
}
|
||||
@@ -193,7 +320,7 @@ func validationFailure(err error) error {
|
||||
|
||||
// Lifecycle
|
||||
|
||||
func (s *server) EnqueueIssue(ctx context.Context, r *pb.EnqueueIssueRequest) (*pb.EnqueueIssueResponse, error) {
|
||||
func (s *taskServer) EnqueueIssue(ctx context.Context, r *pb.EnqueueIssueRequest) (*pb.EnqueueIssueResponse, error) {
|
||||
inserted, err := s.deps.Tasks.EnqueueIssue(ctx, r.Owner, r.Repo, int(r.Number), r.Title, r.Body, r.Labels, r.Identity)
|
||||
if err != nil {
|
||||
return nil, s.logErr("EnqueueIssue", err)
|
||||
@@ -201,7 +328,7 @@ func (s *server) EnqueueIssue(ctx context.Context, r *pb.EnqueueIssueRequest) (*
|
||||
return &pb.EnqueueIssueResponse{Inserted: inserted}, nil
|
||||
}
|
||||
|
||||
func (s *server) ActiveTasksByOrigin(ctx context.Context, r *pb.ActiveTasksByOriginRequest) (*pb.ActiveTasksByOriginResponse, error) {
|
||||
func (s *taskServer) ActiveTasksByOrigin(ctx context.Context, r *pb.ActiveTasksByOriginRequest) (*pb.ActiveTasksByOriginResponse, error) {
|
||||
tasks, err := s.deps.Tasks.ActiveTasksByOrigin(ctx, r.Origin)
|
||||
if err != nil {
|
||||
return nil, s.logErr("ActiveTasksByOrigin", err)
|
||||
@@ -213,7 +340,7 @@ func (s *server) ActiveTasksByOrigin(ctx context.Context, r *pb.ActiveTasksByOri
|
||||
return &pb.ActiveTasksByOriginResponse{Tasks: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) UnpostedOutcomes(ctx context.Context, _ *pb.UnpostedOutcomesRequest) (*pb.UnpostedOutcomesResponse, error) {
|
||||
func (s *taskServer) UnpostedOutcomes(ctx context.Context, _ *pb.UnpostedOutcomesRequest) (*pb.UnpostedOutcomesResponse, error) {
|
||||
tasks, err := s.deps.Tasks.UnpostedOutcomes(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("UnpostedOutcomes", err)
|
||||
@@ -225,14 +352,14 @@ func (s *server) UnpostedOutcomes(ctx context.Context, _ *pb.UnpostedOutcomesReq
|
||||
return &pb.UnpostedOutcomesResponse{Tasks: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) MarkOutcomePosted(ctx context.Context, r *pb.MarkOutcomePostedRequest) (*pb.MarkOutcomePostedResponse, error) {
|
||||
func (s *taskServer) MarkOutcomePosted(ctx context.Context, r *pb.MarkOutcomePostedRequest) (*pb.MarkOutcomePostedResponse, error) {
|
||||
if err := s.deps.Tasks.MarkOutcomePosted(ctx, r.TaskId, r.Status); err != nil {
|
||||
return nil, s.logErr("MarkOutcomePosted", err)
|
||||
}
|
||||
return &pb.MarkOutcomePostedResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) EnqueueChatTask(ctx context.Context, r *pb.EnqueueChatTaskRequest) (*pb.EnqueueChatTaskResponse, error) {
|
||||
func (s *taskServer) EnqueueChatTask(ctx context.Context, r *pb.EnqueueChatTaskRequest) (*pb.EnqueueChatTaskResponse, error) {
|
||||
inputs, err := task.DecodeInputs(r.InputsJson)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
@@ -244,7 +371,7 @@ func (s *server) EnqueueChatTask(ctx context.Context, r *pb.EnqueueChatTaskReque
|
||||
return &pb.EnqueueChatTaskResponse{Task: taskProto(t)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ClaimNext(ctx context.Context, _ *pb.ClaimNextRequest) (*pb.ClaimNextResponse, error) {
|
||||
func (s *taskServer) ClaimNext(ctx context.Context, _ *pb.ClaimNextRequest) (*pb.ClaimNextResponse, error) {
|
||||
t, err := s.deps.Tasks.ClaimNext(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("ClaimNext", err)
|
||||
@@ -252,7 +379,7 @@ func (s *server) ClaimNext(ctx context.Context, _ *pb.ClaimNextRequest) (*pb.Cla
|
||||
return &pb.ClaimNextResponse{Task: taskProto(t), Found: t != nil}, nil
|
||||
}
|
||||
|
||||
func (s *server) ClaimByIssue(ctx context.Context, r *pb.ClaimByIssueRequest) (*pb.ClaimByIssueResponse, error) {
|
||||
func (s *taskServer) ClaimByIssue(ctx context.Context, r *pb.ClaimByIssueRequest) (*pb.ClaimByIssueResponse, error) {
|
||||
t, err := s.deps.Tasks.ClaimByIssue(ctx, r.Owner, r.Repo, int(r.Number))
|
||||
if err != nil {
|
||||
return nil, s.logErr("ClaimByIssue", err)
|
||||
@@ -260,7 +387,7 @@ func (s *server) ClaimByIssue(ctx context.Context, r *pb.ClaimByIssueRequest) (*
|
||||
return &pb.ClaimByIssueResponse{Task: taskProto(t), Found: t != nil}, nil
|
||||
}
|
||||
|
||||
func (s *server) Transition(ctx context.Context, r *pb.TransitionRequest) (*pb.TransitionResponse, error) {
|
||||
func (s *taskServer) Transition(ctx context.Context, r *pb.TransitionRequest) (*pb.TransitionResponse, error) {
|
||||
if err := s.deps.Tasks.Transition(ctx, r.TaskId, r.From, r.To, r.Detail); err != nil {
|
||||
return nil, s.logErr("Transition", err)
|
||||
}
|
||||
@@ -268,7 +395,7 @@ func (s *server) Transition(ctx context.Context, r *pb.TransitionRequest) (*pb.T
|
||||
}
|
||||
|
||||
// StartStep and FinishStep write a step transition and return its event.
|
||||
func (s *server) StartStep(ctx context.Context, r *pb.StartStepRequest) (*pb.StartStepResponse, error) {
|
||||
func (s *executionServer) StartStep(ctx context.Context, r *pb.StartStepRequest) (*pb.StartStepResponse, error) {
|
||||
if s.deps.Steps == nil {
|
||||
return nil, status.Error(codes.Unavailable, "step recorder unavailable")
|
||||
}
|
||||
@@ -284,7 +411,7 @@ func (s *server) StartStep(ctx context.Context, r *pb.StartStepRequest) (*pb.Sta
|
||||
}
|
||||
|
||||
// RecordUsage appends one model call's usage record.
|
||||
func (s *server) RecordUsage(ctx context.Context, r *pb.RecordUsageRequest) (*pb.RecordUsageResponse, error) {
|
||||
func (s *executionServer) RecordUsage(ctx context.Context, r *pb.RecordUsageRequest) (*pb.RecordUsageResponse, error) {
|
||||
if s.deps.Usage == nil {
|
||||
return nil, status.Error(codes.Unavailable, "usage recorder unavailable")
|
||||
}
|
||||
@@ -302,7 +429,7 @@ func (s *server) RecordUsage(ctx context.Context, r *pb.RecordUsageRequest) (*pb
|
||||
}
|
||||
|
||||
// TaskModels answers what the task's org resolves models against.
|
||||
func (s *server) TaskModels(ctx context.Context, r *pb.TaskModelsRequest) (*pb.TaskModelsResponse, error) {
|
||||
func (s *taskServer) TaskModels(ctx context.Context, r *pb.TaskModelsRequest) (*pb.TaskModelsResponse, error) {
|
||||
if s.deps.OrgModels == nil {
|
||||
return nil, status.Error(codes.Unavailable, "model aliases unavailable")
|
||||
}
|
||||
@@ -327,7 +454,7 @@ func (s *server) TaskModels(ctx context.Context, r *pb.TaskModelsRequest) (*pb.T
|
||||
|
||||
// TaskInstructions answers the instance and organisation instructions for the
|
||||
// task's org.
|
||||
func (s *server) TaskInstructions(ctx context.Context, r *pb.TaskInstructionsRequest) (*pb.TaskInstructionsResponse, error) {
|
||||
func (s *taskServer) TaskInstructions(ctx context.Context, r *pb.TaskInstructionsRequest) (*pb.TaskInstructionsResponse, error) {
|
||||
if s.deps.OrgInstructions == nil {
|
||||
return nil, status.Error(codes.Unavailable, "instructions unavailable")
|
||||
}
|
||||
@@ -346,7 +473,7 @@ func (s *server) TaskInstructions(ctx context.Context, r *pb.TaskInstructionsReq
|
||||
}
|
||||
|
||||
// CallerModels answers the aliases the calling principal's org may use.
|
||||
func (s *server) CallerModels(ctx context.Context, _ *pb.CallerModelsRequest) (*pb.CallerModelsResponse, error) {
|
||||
func (s *orgServer) CallerModels(ctx context.Context, _ *pb.CallerModelsRequest) (*pb.CallerModelsResponse, error) {
|
||||
if s.deps.OrgModels == nil {
|
||||
return nil, status.Error(codes.Unavailable, "model aliases unavailable")
|
||||
}
|
||||
@@ -362,7 +489,7 @@ func (s *server) CallerModels(ctx context.Context, _ *pb.CallerModelsRequest) (*
|
||||
// the store records the cancellation and returns the callees it cancelled
|
||||
// with it; the caller delivers it by cancelling the runs' in-memory contexts
|
||||
// afterwards.
|
||||
func (s *server) CancelExecution(ctx context.Context, r *pb.CancelExecutionRequest) (*pb.CancelExecutionResponse, error) {
|
||||
func (s *executionServer) CancelExecution(ctx context.Context, r *pb.CancelExecutionRequest) (*pb.CancelExecutionResponse, error) {
|
||||
if s.deps.Canceller == nil {
|
||||
return nil, status.Error(codes.Unavailable, "execution canceller unavailable")
|
||||
}
|
||||
@@ -373,7 +500,7 @@ func (s *server) CancelExecution(ctx context.Context, r *pb.CancelExecutionReque
|
||||
return &pb.CancelExecutionResponse{CancelledCalleeIds: ids}, nil
|
||||
}
|
||||
|
||||
func (s *server) FinishStep(ctx context.Context, r *pb.FinishStepRequest) (*pb.FinishStepResponse, error) {
|
||||
func (s *executionServer) FinishStep(ctx context.Context, r *pb.FinishStepRequest) (*pb.FinishStepResponse, error) {
|
||||
if s.deps.Steps == nil {
|
||||
return nil, status.Error(codes.Unavailable, "step recorder unavailable")
|
||||
}
|
||||
@@ -388,7 +515,7 @@ func (s *server) FinishStep(ctx context.Context, r *pb.FinishStepRequest) (*pb.F
|
||||
return &pb.FinishStepResponse{Event: eventProto(event)}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListSteps(ctx context.Context, r *pb.ListStepsRequest) (*pb.ListStepsResponse, error) {
|
||||
func (s *executionServer) ListSteps(ctx context.Context, r *pb.ListStepsRequest) (*pb.ListStepsResponse, error) {
|
||||
if s.deps.StepReader == nil {
|
||||
return nil, status.Error(codes.Unavailable, "step reader unavailable")
|
||||
}
|
||||
@@ -425,7 +552,7 @@ func (s *server) harnessOrg(ctx context.Context, credential string) (string, err
|
||||
return target, nil
|
||||
}
|
||||
|
||||
func (s *server) GetHarnessSecret(ctx context.Context, r *pb.GetHarnessSecretRequest) (*pb.GetHarnessSecretResponse, error) {
|
||||
func (s *harnessSecretServer) GetHarnessSecret(ctx context.Context, r *pb.GetHarnessSecretRequest) (*pb.GetHarnessSecretResponse, error) {
|
||||
if s.deps.HarnessSecrets == nil {
|
||||
return nil, status.Error(codes.Unavailable, "harness secret store unavailable")
|
||||
}
|
||||
@@ -440,7 +567,7 @@ func (s *server) GetHarnessSecret(ctx context.Context, r *pb.GetHarnessSecretReq
|
||||
return &pb.GetHarnessSecretResponse{Secret: harnessSecretProto(secret), Org: orgID}, nil
|
||||
}
|
||||
|
||||
func (s *server) PutHarnessSecret(ctx context.Context, r *pb.PutHarnessSecretRequest) (*pb.PutHarnessSecretResponse, error) {
|
||||
func (s *harnessSecretServer) PutHarnessSecret(ctx context.Context, r *pb.PutHarnessSecretRequest) (*pb.PutHarnessSecretResponse, error) {
|
||||
if s.deps.HarnessSecrets == nil {
|
||||
return nil, status.Error(codes.Unavailable, "harness secret store unavailable")
|
||||
}
|
||||
@@ -456,7 +583,7 @@ func (s *server) PutHarnessSecret(ctx context.Context, r *pb.PutHarnessSecretReq
|
||||
return &pb.PutHarnessSecretResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) Update(ctx context.Context, r *pb.UpdateRequest) (*pb.UpdateResponse, error) {
|
||||
func (s *taskServer) Update(ctx context.Context, r *pb.UpdateRequest) (*pb.UpdateResponse, error) {
|
||||
if r.Task == nil {
|
||||
return nil, status.Error(codes.InvalidArgument, "task is required")
|
||||
}
|
||||
@@ -466,21 +593,21 @@ func (s *server) Update(ctx context.Context, r *pb.UpdateRequest) (*pb.UpdateRes
|
||||
return &pb.UpdateResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) Requeue(ctx context.Context, r *pb.RequeueRequest) (*pb.RequeueResponse, error) {
|
||||
func (s *taskServer) Requeue(ctx context.Context, r *pb.RequeueRequest) (*pb.RequeueResponse, error) {
|
||||
if err := s.deps.Tasks.Requeue(ctx, r.TaskId, r.FromStatus, r.Workflow); err != nil {
|
||||
return nil, s.logErr("Requeue", err)
|
||||
}
|
||||
return &pb.RequeueResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ParkTask(ctx context.Context, r *pb.ParkTaskRequest) (*pb.ParkTaskResponse, error) {
|
||||
func (s *taskServer) ParkTask(ctx context.Context, r *pb.ParkTaskRequest) (*pb.ParkTaskResponse, error) {
|
||||
if err := s.deps.Tasks.ParkTask(ctx, r.TaskId, r.From, r.Detail, r.Class, r.Blocker); err != nil {
|
||||
return nil, s.logErr("ParkTask", err)
|
||||
}
|
||||
return &pb.ParkTaskResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) RecoverStale(ctx context.Context, _ *pb.RecoverStaleRequest) (*pb.RecoverStaleResponse, error) {
|
||||
func (s *taskServer) RecoverStale(ctx context.Context, _ *pb.RecoverStaleRequest) (*pb.RecoverStaleResponse, error) {
|
||||
n, err := s.deps.Tasks.RecoverStale(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("RecoverStale", err)
|
||||
@@ -490,7 +617,7 @@ func (s *server) RecoverStale(ctx context.Context, _ *pb.RecoverStaleRequest) (*
|
||||
|
||||
// Archive / Retry
|
||||
|
||||
func (s *server) ArchiveTask(ctx context.Context, r *pb.ArchiveTaskRequest) (*pb.ArchiveTaskResponse, error) {
|
||||
func (s *taskServer) ArchiveTask(ctx context.Context, r *pb.ArchiveTaskRequest) (*pb.ArchiveTaskResponse, error) {
|
||||
eventID, err := s.deps.Tasks.ArchiveTask(ctx, r.TaskId, r.FromStatus, eventValue(r.Audit))
|
||||
if err != nil {
|
||||
return nil, s.logErr("ArchiveTask", err)
|
||||
@@ -498,35 +625,35 @@ func (s *server) ArchiveTask(ctx context.Context, r *pb.ArchiveTaskRequest) (*pb
|
||||
return &pb.ArchiveTaskResponse{EventId: eventID}, nil
|
||||
}
|
||||
|
||||
func (s *server) RetryTask(ctx context.Context, r *pb.RetryTaskRequest) (*pb.RetryTaskResponse, error) {
|
||||
func (s *taskServer) RetryTask(ctx context.Context, r *pb.RetryTaskRequest) (*pb.RetryTaskResponse, error) {
|
||||
if err := s.deps.Tasks.RetryTask(ctx, r.TaskId, r.FromStatus, r.Workflow, r.RetryMode, task.Resume{From: r.ResumeFrom, After: r.ResumeAfter}, r.CurrentDefinition); err != nil {
|
||||
return nil, s.logErr("RetryTask", err)
|
||||
}
|
||||
return &pb.RetryTaskResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) RespondReviewGate(ctx context.Context, r *pb.RespondReviewGateRequest) (*pb.RespondReviewGateResponse, error) {
|
||||
func (s *reviewServer) RespondReviewGate(ctx context.Context, r *pb.RespondReviewGateRequest) (*pb.RespondReviewGateResponse, error) {
|
||||
if err := s.deps.Tasks.RespondReviewGate(ctx, r.TaskId, r.FromStatus, r.Gate, r.Rereview, int(r.Cap)); err != nil {
|
||||
return nil, s.logErr("RespondReviewGate", err)
|
||||
}
|
||||
return &pb.RespondReviewGateResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) BeginRemediation(ctx context.Context, r *pb.BeginRemediationRequest) (*pb.BeginRemediationResponse, error) {
|
||||
func (s *reviewServer) BeginRemediation(ctx context.Context, r *pb.BeginRemediationRequest) (*pb.BeginRemediationResponse, error) {
|
||||
if err := s.deps.Tasks.BeginRemediation(ctx, r.TaskId, r.Payload); err != nil {
|
||||
return nil, s.logErr("BeginRemediation", err)
|
||||
}
|
||||
return &pb.BeginRemediationResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) UpdateReviewPayload(ctx context.Context, r *pb.UpdateReviewPayloadRequest) (*pb.UpdateReviewPayloadResponse, error) {
|
||||
func (s *reviewServer) UpdateReviewPayload(ctx context.Context, r *pb.UpdateReviewPayloadRequest) (*pb.UpdateReviewPayloadResponse, error) {
|
||||
if err := s.deps.Tasks.UpdateReviewPayload(ctx, r.TaskId, r.Payload); err != nil {
|
||||
return nil, s.logErr("UpdateReviewPayload", err)
|
||||
}
|
||||
return &pb.UpdateReviewPayloadResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) SetReviewCursors(ctx context.Context, r *pb.SetReviewCursorsRequest) (*pb.SetReviewCursorsResponse, error) {
|
||||
func (s *reviewServer) SetReviewCursors(ctx context.Context, r *pb.SetReviewCursorsRequest) (*pb.SetReviewCursorsResponse, error) {
|
||||
if err := s.deps.Tasks.SetReviewCursors(ctx, r.TaskId, r.ReviewCursor, r.CommentCursor); err != nil {
|
||||
return nil, s.logErr("SetReviewCursors", err)
|
||||
}
|
||||
@@ -535,7 +662,7 @@ func (s *server) SetReviewCursors(ctx context.Context, r *pb.SetReviewCursorsReq
|
||||
|
||||
// Queries
|
||||
|
||||
func (s *server) TaskByIssue(ctx context.Context, r *pb.TaskByIssueRequest) (*pb.TaskByIssueResponse, error) {
|
||||
func (s *taskServer) TaskByIssue(ctx context.Context, r *pb.TaskByIssueRequest) (*pb.TaskByIssueResponse, error) {
|
||||
t, err := s.deps.Tasks.TaskByIssue(ctx, r.Owner, r.Repo, int(r.Number))
|
||||
if err != nil {
|
||||
return nil, s.logErr("TaskByIssue", err)
|
||||
@@ -543,7 +670,7 @@ func (s *server) TaskByIssue(ctx context.Context, r *pb.TaskByIssueRequest) (*pb
|
||||
return &pb.TaskByIssueResponse{Task: taskProto(t), Found: t != nil}, nil
|
||||
}
|
||||
|
||||
func (s *server) OpenTaskByPR(ctx context.Context, r *pb.OpenTaskByPRRequest) (*pb.OpenTaskByPRResponse, error) {
|
||||
func (s *taskServer) OpenTaskByPR(ctx context.Context, r *pb.OpenTaskByPRRequest) (*pb.OpenTaskByPRResponse, error) {
|
||||
t, err := s.deps.Tasks.OpenTaskByPR(ctx, r.Owner, r.Repo, int(r.Number))
|
||||
if err != nil {
|
||||
return nil, s.logErr("OpenTaskByPR", err)
|
||||
@@ -551,7 +678,7 @@ func (s *server) OpenTaskByPR(ctx context.Context, r *pb.OpenTaskByPRRequest) (*
|
||||
return &pb.OpenTaskByPRResponse{Task: taskProto(t), Found: t != nil}, nil
|
||||
}
|
||||
|
||||
func (s *server) TaskByID(ctx context.Context, r *pb.TaskByIDRequest) (*pb.TaskByIDResponse, error) {
|
||||
func (s *taskServer) TaskByID(ctx context.Context, r *pb.TaskByIDRequest) (*pb.TaskByIDResponse, error) {
|
||||
t, err := s.deps.Tasks.TaskByID(ctx, r.TaskId)
|
||||
if err != nil {
|
||||
return nil, s.logErr("TaskByID", err)
|
||||
@@ -559,7 +686,7 @@ func (s *server) TaskByID(ctx context.Context, r *pb.TaskByIDRequest) (*pb.TaskB
|
||||
return &pb.TaskByIDResponse{Task: taskProto(t), Found: t != nil}, nil
|
||||
}
|
||||
|
||||
func (s *server) OpenPRs(ctx context.Context, _ *pb.OpenPRsRequest) (*pb.OpenPRsResponse, error) {
|
||||
func (s *taskServer) OpenPRs(ctx context.Context, _ *pb.OpenPRsRequest) (*pb.OpenPRsResponse, error) {
|
||||
tasks, err := s.deps.Tasks.OpenPRs(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("OpenPRs", err)
|
||||
@@ -571,7 +698,7 @@ func (s *server) OpenPRs(ctx context.Context, _ *pb.OpenPRsRequest) (*pb.OpenPRs
|
||||
return &pb.OpenPRsResponse{Tasks: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) ClearTerminalTasks(ctx context.Context, _ *pb.ClearTerminalTasksRequest) (*pb.ClearTerminalTasksResponse, error) {
|
||||
func (s *taskServer) ClearTerminalTasks(ctx context.Context, _ *pb.ClearTerminalTasksRequest) (*pb.ClearTerminalTasksResponse, error) {
|
||||
n, err := s.deps.Tasks.ClearTerminalTasks(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("ClearTerminalTasks", err)
|
||||
@@ -579,7 +706,7 @@ func (s *server) ClearTerminalTasks(ctx context.Context, _ *pb.ClearTerminalTask
|
||||
return &pb.ClearTerminalTasksResponse{Count: n}, nil
|
||||
}
|
||||
|
||||
func (s *server) Tasks(ctx context.Context, r *pb.TasksRequest) (*pb.TasksResponse, error) {
|
||||
func (s *taskServer) Tasks(ctx context.Context, r *pb.TasksRequest) (*pb.TasksResponse, error) {
|
||||
tasks, err := s.deps.Tasks.TasksPage(ctx, storecontract.TaskPage{
|
||||
Statuses: r.Statuses, Workflow: r.Workflow, Limit: int(r.Limit),
|
||||
After: storecontract.TaskCursor{UpdatedAt: timeValue(r.AfterUpdatedAt), ID: r.AfterId},
|
||||
@@ -594,7 +721,7 @@ func (s *server) Tasks(ctx context.Context, r *pb.TasksRequest) (*pb.TasksRespon
|
||||
return &pb.TasksResponse{Tasks: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) StatusCounts(ctx context.Context, _ *pb.StatusCountsRequest) (*pb.StatusCountsResponse, error) {
|
||||
func (s *statsServer) StatusCounts(ctx context.Context, _ *pb.StatusCountsRequest) (*pb.StatusCountsResponse, error) {
|
||||
counts, err := s.deps.Tasks.StatusCounts(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("StatusCounts", err)
|
||||
@@ -608,7 +735,7 @@ func (s *server) StatusCounts(ctx context.Context, _ *pb.StatusCountsRequest) (*
|
||||
|
||||
// Events
|
||||
|
||||
func (s *server) InsertEvent(ctx context.Context, r *pb.InsertEventRequest) (*pb.InsertEventResponse, error) {
|
||||
func (s *taskEventServer) InsertEvent(ctx context.Context, r *pb.InsertEventRequest) (*pb.InsertEventResponse, error) {
|
||||
id, err := s.deps.Tasks.InsertEvent(ctx, eventValue(r.Event))
|
||||
if err != nil {
|
||||
return nil, s.logErr("InsertEvent", err)
|
||||
@@ -616,7 +743,7 @@ func (s *server) InsertEvent(ctx context.Context, r *pb.InsertEventRequest) (*pb
|
||||
return &pb.InsertEventResponse{Id: id}, nil
|
||||
}
|
||||
|
||||
func (s *server) EventsSince(ctx context.Context, r *pb.EventsSinceRequest) (*pb.EventsSinceResponse, error) {
|
||||
func (s *taskEventServer) EventsSince(ctx context.Context, r *pb.EventsSinceRequest) (*pb.EventsSinceResponse, error) {
|
||||
evs, err := s.deps.Tasks.EventsSince(ctx, r.SinceId, int(r.Limit))
|
||||
if err != nil {
|
||||
return nil, s.logErr("EventsSince", err)
|
||||
@@ -624,7 +751,7 @@ func (s *server) EventsSince(ctx context.Context, r *pb.EventsSinceRequest) (*pb
|
||||
return &pb.EventsSinceResponse{Events: mapValues(evs, eventProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) TaskEvents(ctx context.Context, r *pb.TaskEventsRequest) (*pb.TaskEventsResponse, error) {
|
||||
func (s *taskEventServer) TaskEvents(ctx context.Context, r *pb.TaskEventsRequest) (*pb.TaskEventsResponse, error) {
|
||||
evs, err := s.deps.Tasks.TaskEvents(ctx, r.TaskId)
|
||||
if err != nil {
|
||||
return nil, s.logErr("TaskEvents", err)
|
||||
@@ -632,7 +759,7 @@ func (s *server) TaskEvents(ctx context.Context, r *pb.TaskEventsRequest) (*pb.T
|
||||
return &pb.TaskEventsResponse{Events: mapValues(evs, eventProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) WorkflowStats(ctx context.Context, _ *pb.WorkflowStatsRequest) (*pb.WorkflowStatsResponse, error) {
|
||||
func (s *statsServer) WorkflowStats(ctx context.Context, _ *pb.WorkflowStatsRequest) (*pb.WorkflowStatsResponse, error) {
|
||||
stats, err := s.deps.Tasks.WorkflowStats(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("WorkflowStats", err)
|
||||
@@ -640,7 +767,7 @@ func (s *server) WorkflowStats(ctx context.Context, _ *pb.WorkflowStatsRequest)
|
||||
return &pb.WorkflowStatsResponse{Stats: mapValues(stats, workflowStatProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) StageStats(ctx context.Context, _ *pb.StageStatsRequest) (*pb.StageStatsResponse, error) {
|
||||
func (s *statsServer) StageStats(ctx context.Context, _ *pb.StageStatsRequest) (*pb.StageStatsResponse, error) {
|
||||
stats, err := s.deps.Tasks.StageStats(ctx)
|
||||
if err != nil {
|
||||
return nil, s.logErr("StageStats", err)
|
||||
@@ -648,7 +775,7 @@ func (s *server) StageStats(ctx context.Context, _ *pb.StageStatsRequest) (*pb.S
|
||||
return &pb.StageStatsResponse{Stats: mapValues(stats, stageStatProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) TokensByDay(ctx context.Context, r *pb.TokensByDayRequest) (*pb.TokensByDayResponse, error) {
|
||||
func (s *statsServer) TokensByDay(ctx context.Context, r *pb.TokensByDayRequest) (*pb.TokensByDayResponse, error) {
|
||||
tokens, err := s.deps.Tasks.TokensByDay(ctx, int(r.Days))
|
||||
if err != nil {
|
||||
return nil, s.logErr("TokensByDay", err)
|
||||
@@ -672,7 +799,7 @@ func (s *server) applyStatus() (storecontract.ApplyStatusStore, error) {
|
||||
return s.deps.ApplyStatus, nil
|
||||
}
|
||||
|
||||
func (s *server) PutApplyStatus(ctx context.Context, r *pb.PutApplyStatusRequest) (*pb.PutApplyStatusResponse, error) {
|
||||
func (s *statusServer) PutApplyStatus(ctx context.Context, r *pb.PutApplyStatusRequest) (*pb.PutApplyStatusResponse, error) {
|
||||
as, err := s.applyStatus()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -683,7 +810,7 @@ func (s *server) PutApplyStatus(ctx context.Context, r *pb.PutApplyStatusRequest
|
||||
return &pb.PutApplyStatusResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListApplyStatus(ctx context.Context, _ *pb.ListApplyStatusRequest) (*pb.ListApplyStatusResponse, error) {
|
||||
func (s *statusServer) ListApplyStatus(ctx context.Context, _ *pb.ListApplyStatusRequest) (*pb.ListApplyStatusResponse, error) {
|
||||
as, err := s.applyStatus()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -706,7 +833,7 @@ func (s *server) configSnapshots() (storecontract.ConfigSnapshotStore, error) {
|
||||
return s.deps.ConfigSnapshots, nil
|
||||
}
|
||||
|
||||
func (s *server) PutConfigSnapshot(ctx context.Context, r *pb.PutConfigSnapshotRequest) (*pb.PutConfigSnapshotResponse, error) {
|
||||
func (s *statusServer) PutConfigSnapshot(ctx context.Context, r *pb.PutConfigSnapshotRequest) (*pb.PutConfigSnapshotResponse, error) {
|
||||
cs, err := s.configSnapshots()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -717,7 +844,7 @@ func (s *server) PutConfigSnapshot(ctx context.Context, r *pb.PutConfigSnapshotR
|
||||
return &pb.PutConfigSnapshotResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetConfigSnapshot(ctx context.Context, _ *pb.GetConfigSnapshotRequest) (*pb.GetConfigSnapshotResponse, error) {
|
||||
func (s *statusServer) GetConfigSnapshot(ctx context.Context, _ *pb.GetConfigSnapshotRequest) (*pb.GetConfigSnapshotResponse, error) {
|
||||
cs, err := s.configSnapshots()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -739,7 +866,7 @@ func (s *server) presence() (storecontract.PresenceStore, error) {
|
||||
return s.deps.Presence, nil
|
||||
}
|
||||
|
||||
func (s *server) PutPresence(ctx context.Context, r *pb.PutPresenceRequest) (*pb.PutPresenceResponse, error) {
|
||||
func (s *statusServer) PutPresence(ctx context.Context, r *pb.PutPresenceRequest) (*pb.PutPresenceResponse, error) {
|
||||
ps, err := s.presence()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -758,7 +885,7 @@ func (s *server) PutPresence(ctx context.Context, r *pb.PutPresenceRequest) (*pb
|
||||
return &pb.PutPresenceResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListPresence(ctx context.Context, _ *pb.ListPresenceRequest) (*pb.ListPresenceResponse, error) {
|
||||
func (s *statusServer) ListPresence(ctx context.Context, _ *pb.ListPresenceRequest) (*pb.ListPresenceResponse, error) {
|
||||
ps, err := s.presence()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -774,7 +901,7 @@ func (s *server) ListPresence(ctx context.Context, _ *pb.ListPresenceRequest) (*
|
||||
return &pb.ListPresenceResponse{Presences: out}, nil
|
||||
}
|
||||
|
||||
func (s *server) RecordCaptureRefusal(ctx context.Context, r *pb.RecordCaptureRefusalRequest) (*pb.RecordCaptureRefusalResponse, error) {
|
||||
func (s *captureServer) RecordCaptureRefusal(ctx context.Context, r *pb.RecordCaptureRefusalRequest) (*pb.RecordCaptureRefusalResponse, error) {
|
||||
if s.deps.Refusals == nil {
|
||||
return nil, errRefusalsUnavailable
|
||||
}
|
||||
@@ -784,7 +911,7 @@ func (s *server) RecordCaptureRefusal(ctx context.Context, r *pb.RecordCaptureRe
|
||||
return &pb.RecordCaptureRefusalResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListCaptureRefusals(ctx context.Context, r *pb.ListCaptureRefusalsRequest) (*pb.ListCaptureRefusalsResponse, error) {
|
||||
func (s *captureServer) ListCaptureRefusals(ctx context.Context, r *pb.ListCaptureRefusalsRequest) (*pb.ListCaptureRefusalsResponse, error) {
|
||||
if s.deps.Refusals == nil {
|
||||
return nil, errRefusalsUnavailable
|
||||
}
|
||||
@@ -806,7 +933,7 @@ func (s *server) channelStatuses() (storecontract.ChannelStatusStore, error) {
|
||||
return s.deps.ChannelStatus, nil
|
||||
}
|
||||
|
||||
func (s *server) PutChannelStatus(ctx context.Context, r *pb.PutChannelStatusRequest) (*pb.PutChannelStatusResponse, error) {
|
||||
func (s *statusServer) PutChannelStatus(ctx context.Context, r *pb.PutChannelStatusRequest) (*pb.PutChannelStatusResponse, error) {
|
||||
cs, err := s.channelStatuses()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -817,7 +944,7 @@ func (s *server) PutChannelStatus(ctx context.Context, r *pb.PutChannelStatusReq
|
||||
return &pb.PutChannelStatusResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListChannelStatus(ctx context.Context, _ *pb.ListChannelStatusRequest) (*pb.ListChannelStatusResponse, error) {
|
||||
func (s *statusServer) ListChannelStatus(ctx context.Context, _ *pb.ListChannelStatusRequest) (*pb.ListChannelStatusResponse, error) {
|
||||
cs, err := s.channelStatuses()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -829,7 +956,7 @@ func (s *server) ListChannelStatus(ctx context.Context, _ *pb.ListChannelStatusR
|
||||
return &pb.ListChannelStatusResponse{Channels: channelStatusesProto(channels)}, nil
|
||||
}
|
||||
|
||||
func (s *server) InsertCapture(ctx context.Context, r *pb.InsertCaptureRequest) (*pb.InsertCaptureResponse, error) {
|
||||
func (s *captureServer) InsertCapture(ctx context.Context, r *pb.InsertCaptureRequest) (*pb.InsertCaptureResponse, error) {
|
||||
cs, err := s.capture()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -843,7 +970,7 @@ func (s *server) InsertCapture(ctx context.Context, r *pb.InsertCaptureRequest)
|
||||
|
||||
// StreamCaptures streams one capture per message: a batch of large capture
|
||||
// bodies in one unary response can exceed gRPC's 4MiB message cap
|
||||
func (s *server) StreamCaptures(r *pb.StreamCapturesRequest, stream pb.StateStoreService_StreamCapturesServer) error {
|
||||
func (s *captureServer) StreamCaptures(r *pb.StreamCapturesRequest, stream pb.CaptureService_StreamCapturesServer) error {
|
||||
cs, err := s.capture()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -869,7 +996,7 @@ func (s *server) mapping() (storecontract.MappingStore, error) {
|
||||
return s.deps.Mappings, nil
|
||||
}
|
||||
|
||||
func (s *server) InsertMapping(ctx context.Context, r *pb.InsertMappingRequest) (*pb.InsertMappingResponse, error) {
|
||||
func (s *mappingServer) InsertMapping(ctx context.Context, r *pb.InsertMappingRequest) (*pb.InsertMappingResponse, error) {
|
||||
ms, err := s.mapping()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -885,7 +1012,7 @@ func (s *server) InsertMapping(ctx context.Context, r *pb.InsertMappingRequest)
|
||||
return &pb.InsertMappingResponse{Id: id}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetMapping(ctx context.Context, r *pb.GetMappingRequest) (*pb.GetMappingResponse, error) {
|
||||
func (s *mappingServer) GetMapping(ctx context.Context, r *pb.GetMappingRequest) (*pb.GetMappingResponse, error) {
|
||||
ms, err := s.mapping()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -897,7 +1024,7 @@ func (s *server) GetMapping(ctx context.Context, r *pb.GetMappingRequest) (*pb.G
|
||||
return &pb.GetMappingResponse{Mapping: mappingProtoPtr(m), Found: m != nil}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListMappings(ctx context.Context, _ *pb.ListMappingsRequest) (*pb.ListMappingsResponse, error) {
|
||||
func (s *mappingServer) ListMappings(ctx context.Context, _ *pb.ListMappingsRequest) (*pb.ListMappingsResponse, error) {
|
||||
ms, err := s.mapping()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -909,7 +1036,7 @@ func (s *server) ListMappings(ctx context.Context, _ *pb.ListMappingsRequest) (*
|
||||
return &pb.ListMappingsResponse{Mappings: mapValues(mappings, mappingProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) UpdateMapping(ctx context.Context, r *pb.UpdateMappingRequest) (*pb.UpdateMappingResponse, error) {
|
||||
func (s *mappingServer) UpdateMapping(ctx context.Context, r *pb.UpdateMappingRequest) (*pb.UpdateMappingResponse, error) {
|
||||
ms, err := s.mapping()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -924,7 +1051,7 @@ func (s *server) UpdateMapping(ctx context.Context, r *pb.UpdateMappingRequest)
|
||||
return &pb.UpdateMappingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) DeleteMapping(ctx context.Context, r *pb.DeleteMappingRequest) (*pb.DeleteMappingResponse, error) {
|
||||
func (s *mappingServer) DeleteMapping(ctx context.Context, r *pb.DeleteMappingRequest) (*pb.DeleteMappingResponse, error) {
|
||||
ms, err := s.mapping()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -935,7 +1062,7 @@ func (s *server) DeleteMapping(ctx context.Context, r *pb.DeleteMappingRequest)
|
||||
return &pb.DeleteMappingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) RecordMappingMatch(ctx context.Context, r *pb.RecordMappingMatchRequest) (*pb.RecordMappingMatchResponse, error) {
|
||||
func (s *mappingServer) RecordMappingMatch(ctx context.Context, r *pb.RecordMappingMatchRequest) (*pb.RecordMappingMatchResponse, error) {
|
||||
if s.deps.MappingMatches == nil {
|
||||
return nil, status.Error(codes.Unavailable, "mapping match recorder unavailable")
|
||||
}
|
||||
@@ -954,7 +1081,7 @@ func (s *server) binding() (storecontract.BindingStore, error) {
|
||||
return s.deps.Bindings, nil
|
||||
}
|
||||
|
||||
func (s *server) InsertBinding(ctx context.Context, r *pb.InsertBindingRequest) (*pb.InsertBindingResponse, error) {
|
||||
func (s *bindingServer) InsertBinding(ctx context.Context, r *pb.InsertBindingRequest) (*pb.InsertBindingResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -970,7 +1097,7 @@ func (s *server) InsertBinding(ctx context.Context, r *pb.InsertBindingRequest)
|
||||
return &pb.InsertBindingResponse{Id: id}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetBinding(ctx context.Context, r *pb.GetBindingRequest) (*pb.GetBindingResponse, error) {
|
||||
func (s *bindingServer) GetBinding(ctx context.Context, r *pb.GetBindingRequest) (*pb.GetBindingResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -982,7 +1109,7 @@ func (s *server) GetBinding(ctx context.Context, r *pb.GetBindingRequest) (*pb.G
|
||||
return &pb.GetBindingResponse{Binding: bindingProtoPtr(b), Found: b != nil}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListBindings(ctx context.Context, _ *pb.ListBindingsRequest) (*pb.ListBindingsResponse, error) {
|
||||
func (s *bindingServer) ListBindings(ctx context.Context, _ *pb.ListBindingsRequest) (*pb.ListBindingsResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -994,7 +1121,7 @@ func (s *server) ListBindings(ctx context.Context, _ *pb.ListBindingsRequest) (*
|
||||
return &pb.ListBindingsResponse{Bindings: mapValues(bindings, bindingProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) UpdateBinding(ctx context.Context, r *pb.UpdateBindingRequest) (*pb.UpdateBindingResponse, error) {
|
||||
func (s *bindingServer) UpdateBinding(ctx context.Context, r *pb.UpdateBindingRequest) (*pb.UpdateBindingResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1009,7 +1136,7 @@ func (s *server) UpdateBinding(ctx context.Context, r *pb.UpdateBindingRequest)
|
||||
return &pb.UpdateBindingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) DeleteBinding(ctx context.Context, r *pb.DeleteBindingRequest) (*pb.DeleteBindingResponse, error) {
|
||||
func (s *bindingServer) DeleteBinding(ctx context.Context, r *pb.DeleteBindingRequest) (*pb.DeleteBindingResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1020,7 +1147,7 @@ func (s *server) DeleteBinding(ctx context.Context, r *pb.DeleteBindingRequest)
|
||||
return &pb.DeleteBindingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) PauseBinding(ctx context.Context, r *pb.PauseBindingRequest) (*pb.PauseBindingResponse, error) {
|
||||
func (s *bindingServer) PauseBinding(ctx context.Context, r *pb.PauseBindingRequest) (*pb.PauseBindingResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1031,7 +1158,7 @@ func (s *server) PauseBinding(ctx context.Context, r *pb.PauseBindingRequest) (*
|
||||
return &pb.PauseBindingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ResumeBinding(ctx context.Context, r *pb.ResumeBindingRequest) (*pb.ResumeBindingResponse, error) {
|
||||
func (s *bindingServer) ResumeBinding(ctx context.Context, r *pb.ResumeBindingRequest) (*pb.ResumeBindingResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1042,7 +1169,7 @@ func (s *server) ResumeBinding(ctx context.Context, r *pb.ResumeBindingRequest)
|
||||
return &pb.ResumeBindingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ApproveBinding(ctx context.Context, r *pb.ApproveBindingRequest) (*pb.ApproveBindingResponse, error) {
|
||||
func (s *bindingServer) ApproveBinding(ctx context.Context, r *pb.ApproveBindingRequest) (*pb.ApproveBindingResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1062,7 +1189,7 @@ func (s *server) sources() (storecontract.SourceStore, error) {
|
||||
return s.deps.Sources, nil
|
||||
}
|
||||
|
||||
func (s *server) InsertSource(ctx context.Context, r *pb.InsertSourceRequest) (*pb.InsertSourceResponse, error) {
|
||||
func (s *sourceServer) InsertSource(ctx context.Context, r *pb.InsertSourceRequest) (*pb.InsertSourceResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1073,7 +1200,7 @@ func (s *server) InsertSource(ctx context.Context, r *pb.InsertSourceRequest) (*
|
||||
return &pb.InsertSourceResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetSource(ctx context.Context, r *pb.GetSourceRequest) (*pb.GetSourceResponse, error) {
|
||||
func (s *sourceServer) GetSource(ctx context.Context, r *pb.GetSourceRequest) (*pb.GetSourceResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1088,7 +1215,7 @@ func (s *server) GetSource(ctx context.Context, r *pb.GetSourceRequest) (*pb.Get
|
||||
return &pb.GetSourceResponse{Source: sourceProto(*src), Found: true}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListSources(ctx context.Context, _ *pb.ListSourcesRequest) (*pb.ListSourcesResponse, error) {
|
||||
func (s *sourceServer) ListSources(ctx context.Context, _ *pb.ListSourcesRequest) (*pb.ListSourcesResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1100,7 +1227,7 @@ func (s *server) ListSources(ctx context.Context, _ *pb.ListSourcesRequest) (*pb
|
||||
return &pb.ListSourcesResponse{Sources: mapValues(list, sourceProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) SetSourceSigning(ctx context.Context, r *pb.SetSourceSigningRequest) (*pb.SetSourceSigningResponse, error) {
|
||||
func (s *sourceServer) SetSourceSigning(ctx context.Context, r *pb.SetSourceSigningRequest) (*pb.SetSourceSigningResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1111,7 +1238,7 @@ func (s *server) SetSourceSigning(ctx context.Context, r *pb.SetSourceSigningReq
|
||||
return &pb.SetSourceSigningResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) SetSourceSecret(ctx context.Context, r *pb.SetSourceSecretRequest) (*pb.SetSourceSecretResponse, error) {
|
||||
func (s *sourceServer) SetSourceSecret(ctx context.Context, r *pb.SetSourceSecretRequest) (*pb.SetSourceSecretResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1122,7 +1249,7 @@ func (s *server) SetSourceSecret(ctx context.Context, r *pb.SetSourceSecretReque
|
||||
return &pb.SetSourceSecretResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) SetSourceName(ctx context.Context, r *pb.SetSourceNameRequest) (*pb.SetSourceNameResponse, error) {
|
||||
func (s *sourceServer) SetSourceName(ctx context.Context, r *pb.SetSourceNameRequest) (*pb.SetSourceNameResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1133,7 +1260,7 @@ func (s *server) SetSourceName(ctx context.Context, r *pb.SetSourceNameRequest)
|
||||
return &pb.SetSourceNameResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) SetSourceDeliveryHeader(ctx context.Context, r *pb.SetSourceDeliveryHeaderRequest) (*pb.SetSourceDeliveryHeaderResponse, error) {
|
||||
func (s *sourceServer) SetSourceDeliveryHeader(ctx context.Context, r *pb.SetSourceDeliveryHeaderRequest) (*pb.SetSourceDeliveryHeaderResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1144,7 +1271,7 @@ func (s *server) SetSourceDeliveryHeader(ctx context.Context, r *pb.SetSourceDel
|
||||
return &pb.SetSourceDeliveryHeaderResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) DeleteSource(ctx context.Context, r *pb.DeleteSourceRequest) (*pb.DeleteSourceResponse, error) {
|
||||
func (s *sourceServer) DeleteSource(ctx context.Context, r *pb.DeleteSourceRequest) (*pb.DeleteSourceResponse, error) {
|
||||
ss, err := s.sources()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1157,7 +1284,7 @@ func (s *server) DeleteSource(ctx context.Context, r *pb.DeleteSourceRequest) (*
|
||||
|
||||
// Dispatch
|
||||
|
||||
func (s *server) ArmedBindingsForSource(ctx context.Context, r *pb.ArmedBindingsForSourceRequest) (*pb.ArmedBindingsForSourceResponse, error) {
|
||||
func (s *bindingServer) ArmedBindingsForSource(ctx context.Context, r *pb.ArmedBindingsForSourceRequest) (*pb.ArmedBindingsForSourceResponse, error) {
|
||||
if s.deps.BindingDispatcher == nil {
|
||||
return nil, errBindingDispatchUnavailable
|
||||
}
|
||||
@@ -1168,7 +1295,7 @@ func (s *server) ArmedBindingsForSource(ctx context.Context, r *pb.ArmedBindings
|
||||
return &pb.ArmedBindingsForSourceResponse{Bindings: mapValues(bindings, bindingProto)}, nil
|
||||
}
|
||||
|
||||
func (s *server) RecordDispatch(ctx context.Context, r *pb.RecordDispatchRequest) (*pb.RecordDispatchResponse, error) {
|
||||
func (s *dispatchServer) RecordDispatch(ctx context.Context, r *pb.RecordDispatchRequest) (*pb.RecordDispatchResponse, error) {
|
||||
if s.deps.BindingDispatcher == nil {
|
||||
return nil, errBindingDispatchUnavailable
|
||||
}
|
||||
@@ -1178,7 +1305,7 @@ func (s *server) RecordDispatch(ctx context.Context, r *pb.RecordDispatchRequest
|
||||
return &pb.RecordDispatchResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) ListDispatches(ctx context.Context, r *pb.ListDispatchesRequest) (*pb.ListDispatchesResponse, error) {
|
||||
func (s *dispatchServer) ListDispatches(ctx context.Context, r *pb.ListDispatchesRequest) (*pb.ListDispatchesResponse, error) {
|
||||
bs, err := s.binding()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1203,7 +1330,7 @@ func (s *server) ListDispatches(ctx context.Context, r *pb.ListDispatchesRequest
|
||||
|
||||
// Playbook dispatch
|
||||
|
||||
func (s *server) RecordPlaybookDispatch(ctx context.Context, r *pb.RecordPlaybookDispatchRequest) (*pb.RecordPlaybookDispatchResponse, error) {
|
||||
func (s *dispatchServer) RecordPlaybookDispatch(ctx context.Context, r *pb.RecordPlaybookDispatchRequest) (*pb.RecordPlaybookDispatchResponse, error) {
|
||||
if s.deps.PlaybookDispatcher == nil {
|
||||
return nil, errPlaybookDispatcherUnavailable
|
||||
}
|
||||
@@ -1213,7 +1340,7 @@ func (s *server) RecordPlaybookDispatch(ctx context.Context, r *pb.RecordPlayboo
|
||||
return &pb.RecordPlaybookDispatchResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) DeletePlaybookDispatches(ctx context.Context, r *pb.DeletePlaybookDispatchesRequest) (*pb.DeletePlaybookDispatchesResponse, error) {
|
||||
func (s *dispatchServer) DeletePlaybookDispatches(ctx context.Context, r *pb.DeletePlaybookDispatchesRequest) (*pb.DeletePlaybookDispatchesResponse, error) {
|
||||
if s.deps.PlaybookDispatcher == nil {
|
||||
return nil, errPlaybookDispatcherUnavailable
|
||||
}
|
||||
@@ -1224,7 +1351,7 @@ func (s *server) DeletePlaybookDispatches(ctx context.Context, r *pb.DeletePlayb
|
||||
}
|
||||
|
||||
// StreamUndispatchedCaptures streams for the same reason as StreamCaptures.
|
||||
func (s *server) StreamUndispatchedCaptures(r *pb.StreamUndispatchedCapturesRequest, stream pb.StateStoreService_StreamUndispatchedCapturesServer) error {
|
||||
func (s *captureServer) StreamUndispatchedCaptures(r *pb.StreamUndispatchedCapturesRequest, stream pb.CaptureService_StreamUndispatchedCapturesServer) error {
|
||||
if s.deps.BindingDispatcher == nil {
|
||||
return errBindingDispatchUnavailable
|
||||
}
|
||||
@@ -1242,7 +1369,7 @@ func (s *server) StreamUndispatchedCaptures(r *pb.StreamUndispatchedCapturesRequ
|
||||
|
||||
// BindingTaskCreator
|
||||
|
||||
func (s *server) EnqueueBindingTask(ctx context.Context, r *pb.EnqueueBindingTaskRequest) (*pb.EnqueueBindingTaskResponse, error) {
|
||||
func (s *dispatchServer) EnqueueBindingTask(ctx context.Context, r *pb.EnqueueBindingTaskRequest) (*pb.EnqueueBindingTaskResponse, error) {
|
||||
if s.deps.BindingTaskCreator == nil {
|
||||
return nil, errBindingTaskCreatorUnavailable
|
||||
}
|
||||
@@ -1262,7 +1389,7 @@ func (s *server) EnqueueBindingTask(ctx context.Context, r *pb.EnqueueBindingTas
|
||||
// caller; the store's own row checks are what make both calls answer only
|
||||
// for this caller's own callees.
|
||||
|
||||
func (s *server) EnqueueCallTask(ctx context.Context, r *pb.EnqueueCallTaskRequest) (*pb.EnqueueCallTaskResponse, error) {
|
||||
func (s *taskServer) EnqueueCallTask(ctx context.Context, r *pb.EnqueueCallTaskRequest) (*pb.EnqueueCallTaskResponse, error) {
|
||||
if s.deps.WorkflowCalls == nil {
|
||||
return nil, errWorkflowCallerUnavailable
|
||||
}
|
||||
@@ -1285,7 +1412,7 @@ func (s *server) EnqueueCallTask(ctx context.Context, r *pb.EnqueueCallTaskReque
|
||||
return &pb.EnqueueCallTaskResponse{Task: taskProto(t), Accepted: true}, nil
|
||||
}
|
||||
|
||||
func (s *server) WorkflowCallStatus(ctx context.Context, r *pb.WorkflowCallStatusRequest) (*pb.WorkflowCallStatusResponse, error) {
|
||||
func (s *taskServer) WorkflowCallStatus(ctx context.Context, r *pb.WorkflowCallStatusRequest) (*pb.WorkflowCallStatusResponse, error) {
|
||||
if s.deps.WorkflowCalls == nil {
|
||||
return nil, errWorkflowCallerUnavailable
|
||||
}
|
||||
@@ -1305,7 +1432,7 @@ func (s *server) taskLogs() (storecontract.TaskLogStore, error) {
|
||||
return s.deps.TaskLogs, nil
|
||||
}
|
||||
|
||||
func (s *server) ReadTaskLog(ctx context.Context, r *pb.ReadTaskLogRequest) (*pb.ReadTaskLogResponse, error) {
|
||||
func (s *taskLogServer) ReadTaskLog(ctx context.Context, r *pb.ReadTaskLogRequest) (*pb.ReadTaskLogResponse, error) {
|
||||
logs, err := s.taskLogs()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1338,7 +1465,7 @@ func (s *server) ReadTaskLog(ctx context.Context, r *pb.ReadTaskLogRequest) (*pb
|
||||
// StreamTaskLogContent sends one attempt's log verbatim, one chunk per
|
||||
// message, for a download. A single reply reports found=false with no chunks:
|
||||
// the attempt has no log file, which is a normal state rather than a failure.
|
||||
func (s *server) StreamTaskLogContent(r *pb.StreamTaskLogContentRequest, stream pb.StateStoreService_StreamTaskLogContentServer) error {
|
||||
func (s *taskLogServer) StreamTaskLogContent(r *pb.StreamTaskLogContentRequest, stream pb.TaskLogService_StreamTaskLogContentServer) error {
|
||||
logs, err := s.taskLogs()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1370,7 +1497,7 @@ func (s *server) StreamTaskLogContent(r *pb.StreamTaskLogContentRequest, stream
|
||||
// file into this writer: the reader keeps its own chunk size, and the bytes
|
||||
// are never all held at once.
|
||||
type chunkWriter struct {
|
||||
stream pb.StateStoreService_StreamTaskLogContentServer
|
||||
stream pb.TaskLogService_StreamTaskLogContentServer
|
||||
attempt int64
|
||||
pending []byte
|
||||
// sent records whether any chunk reached the client, which is how the
|
||||
|
||||
@@ -33,7 +33,7 @@ func TestServiceLogsRequireService(t *testing.T) {
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
ctx := peer.NewContext(metadata.NewIncomingContext(t.Context(), metadata.Pairs(tokenMetadataKey, tt.token)), tt.peer)
|
||||
_, err := grants.UnaryInterceptor()(ctx, &pb.RecentLogsRequest{}, &grpc.UnaryServerInfo{FullMethod: pb.StateStoreService_RecentLogs_FullMethodName}, func(context.Context, any) (any, error) { return &pb.RecentLogsResponse{}, nil })
|
||||
_, err := grants.UnaryInterceptor()(ctx, &pb.RecentLogsRequest{}, &grpc.UnaryServerInfo{FullMethod: pb.StatusService_RecentLogs_FullMethodName}, func(context.Context, any) (any, error) { return &pb.RecentLogsResponse{}, nil })
|
||||
if status.Code(err) != tt.code {
|
||||
t.Fatalf("code %s want %s", status.Code(err), tt.code)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ func authorizesTaskScopedCall(fullMethod string, req any, taskID int64) bool {
|
||||
// taskScopedTargets maps each RPC a task grant may call to the task ID its
|
||||
// request targets.
|
||||
var taskScopedTargets = map[string]func(any) int64{
|
||||
pb.StateStoreService_PutPresence_FullMethodName: func(req any) int64 {
|
||||
pb.StatusService_PutPresence_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.PutPresenceRequest)
|
||||
if !ok || r.Presence == nil || r.Presence.Service != presence.Agent {
|
||||
return 0
|
||||
@@ -100,56 +100,56 @@ var taskScopedTargets = map[string]func(any) int64{
|
||||
}
|
||||
return id
|
||||
},
|
||||
pb.StateStoreService_Update_FullMethodName: func(req any) int64 {
|
||||
pb.TaskService_Update_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.UpdateRequest)
|
||||
if !ok || r.Task == nil {
|
||||
return 0
|
||||
}
|
||||
return r.Task.Id
|
||||
},
|
||||
pb.StateStoreService_Transition_FullMethodName: func(req any) int64 {
|
||||
pb.TaskService_Transition_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.TransitionRequest)
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
return r.TaskId
|
||||
},
|
||||
pb.StateStoreService_InsertEvent_FullMethodName: func(req any) int64 {
|
||||
pb.TaskEventService_InsertEvent_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.InsertEventRequest)
|
||||
if !ok || r.Event == nil {
|
||||
return 0
|
||||
}
|
||||
return r.Event.TaskId
|
||||
},
|
||||
pb.StateStoreService_StartStep_FullMethodName: func(req any) int64 {
|
||||
pb.ExecutionService_StartStep_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.StartStepRequest)
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
return r.ExecutionId
|
||||
},
|
||||
pb.StateStoreService_RecordUsage_FullMethodName: func(req any) int64 {
|
||||
pb.ExecutionService_RecordUsage_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.RecordUsageRequest)
|
||||
if !ok || r.Record == nil {
|
||||
return 0
|
||||
}
|
||||
return r.Record.TaskId
|
||||
},
|
||||
pb.StateStoreService_FinishStep_FullMethodName: func(req any) int64 {
|
||||
pb.ExecutionService_FinishStep_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.FinishStepRequest)
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
return r.ExecutionId
|
||||
},
|
||||
pb.StateStoreService_EnqueueCallTask_FullMethodName: func(req any) int64 {
|
||||
pb.TaskService_EnqueueCallTask_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.EnqueueCallTaskRequest)
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
return r.CallerTaskId
|
||||
},
|
||||
pb.StateStoreService_WorkflowCallStatus_FullMethodName: func(req any) int64 {
|
||||
pb.TaskService_WorkflowCallStatus_FullMethodName: func(req any) int64 {
|
||||
r, ok := req.(*pb.WorkflowCallStatusRequest)
|
||||
if !ok {
|
||||
return 0
|
||||
@@ -213,7 +213,7 @@ func (g *TaskGrants) StreamInterceptor() grpc.StreamServerInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *server) RegisterTaskGrant(ctx context.Context, r *pb.RegisterTaskGrantRequest) (*pb.RegisterTaskGrantResponse, error) {
|
||||
func (s *taskGrantServer) RegisterTaskGrant(ctx context.Context, r *pb.RegisterTaskGrantRequest) (*pb.RegisterTaskGrantResponse, error) {
|
||||
if s.deps.Grants == nil {
|
||||
return nil, status.Error(codes.Unavailable, "task grants unavailable")
|
||||
}
|
||||
@@ -232,7 +232,7 @@ func (s *server) RegisterTaskGrant(ctx context.Context, r *pb.RegisterTaskGrantR
|
||||
return &pb.RegisterTaskGrantResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *server) RevokeTaskGrant(ctx context.Context, r *pb.RevokeTaskGrantRequest) (*pb.RevokeTaskGrantResponse, error) {
|
||||
func (s *taskGrantServer) RevokeTaskGrant(ctx context.Context, r *pb.RevokeTaskGrantRequest) (*pb.RevokeTaskGrantResponse, error) {
|
||||
if s.deps.Grants == nil {
|
||||
return nil, status.Error(codes.Unavailable, "task grants unavailable")
|
||||
}
|
||||
@@ -245,7 +245,7 @@ func (s *server) RevokeTaskGrant(ctx context.Context, r *pb.RevokeTaskGrantReque
|
||||
// ResolveTaskGrant answers which task a run credential belongs to, for the
|
||||
// services that verify one (archied's worktree push). Task grants cannot call
|
||||
// it: it is not in taskScopedTargets.
|
||||
func (s *server) ResolveTaskGrant(ctx context.Context, r *pb.ResolveTaskGrantRequest) (*pb.ResolveTaskGrantResponse, error) {
|
||||
func (s *taskGrantServer) ResolveTaskGrant(ctx context.Context, r *pb.ResolveTaskGrantRequest) (*pb.ResolveTaskGrantResponse, error) {
|
||||
if s.deps.Grants == nil {
|
||||
return nil, status.Error(codes.Unavailable, "task grants unavailable")
|
||||
}
|
||||
@@ -279,7 +279,7 @@ func (c *Client) RegisterTaskGrant(ctx context.Context, taskID int64, lifetime t
|
||||
return "", err
|
||||
}
|
||||
token := hex.EncodeToString(bytes[:])
|
||||
_, err := c.client.RegisterTaskGrant(ctx, &pb.RegisterTaskGrantRequest{TaskId: taskID, Token: token, LifetimeSeconds: int64(lifetime / time.Second)})
|
||||
_, err := c.taskGrant.RegisterTaskGrant(ctx, &pb.RegisterTaskGrantRequest{TaskId: taskID, Token: token, LifetimeSeconds: int64(lifetime / time.Second)})
|
||||
if err != nil {
|
||||
return "", unmapError(err)
|
||||
}
|
||||
@@ -287,13 +287,13 @@ func (c *Client) RegisterTaskGrant(ctx context.Context, taskID int64, lifetime t
|
||||
}
|
||||
|
||||
func (c *Client) RevokeTaskGrant(ctx context.Context, token string) error {
|
||||
_, err := c.client.RevokeTaskGrant(ctx, &pb.RevokeTaskGrantRequest{Token: token})
|
||||
_, err := c.taskGrant.RevokeTaskGrant(ctx, &pb.RevokeTaskGrantRequest{Token: token})
|
||||
return unmapError(err)
|
||||
}
|
||||
|
||||
// ResolveTaskGrant returns the task a run credential was issued for.
|
||||
func (c *Client) ResolveTaskGrant(ctx context.Context, token string) (int64, error) {
|
||||
r, err := c.client.ResolveTaskGrant(ctx, &pb.ResolveTaskGrantRequest{Token: token})
|
||||
r, err := c.taskGrant.ResolveTaskGrant(ctx, &pb.ResolveTaskGrantRequest{Token: token})
|
||||
if status.Code(err) == codes.NotFound {
|
||||
return 0, storecontract.ErrRunCredentialUnknown
|
||||
}
|
||||
@@ -335,7 +335,7 @@ func (g *GrantIssuer) Issue(task *task.Task, limit time.Duration) (string, func(
|
||||
|
||||
// TaskForCredential returns the task a run credential was issued for.
|
||||
func (c *Client) TaskForCredential(ctx context.Context, token string) (*task.Task, error) {
|
||||
r, err := c.client.ResolveTaskGrant(ctx, &pb.ResolveTaskGrantRequest{Token: token})
|
||||
r, err := c.taskGrant.ResolveTaskGrant(ctx, &pb.ResolveTaskGrantRequest{Token: token})
|
||||
if err != nil {
|
||||
return nil, unmapError(err)
|
||||
}
|
||||
@@ -412,7 +412,7 @@ func (s *server) executionPrincipal(ctx context.Context, t *task.Task) (identity
|
||||
|
||||
// TaskPrincipalForCredential resolves the task and its canonical execution principal.
|
||||
func (c *Client) TaskPrincipalForCredential(ctx context.Context, token string) (*task.Task, identity.IdentityID, error) {
|
||||
r, err := c.client.ResolveTaskGrant(ctx, &pb.ResolveTaskGrantRequest{Token: token})
|
||||
r, err := c.taskGrant.ResolveTaskGrant(ctx, &pb.ResolveTaskGrantRequest{Token: token})
|
||||
if err != nil {
|
||||
return nil, "", unmapError(err)
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func TestTaskCredentialCannotReplaceItsPin(t *testing.T) {
|
||||
WorkflowDefinitionVersion: 4, WorkflowDefinitionDigest: "digest-b", WorkflowDefinitionYaml: "yaml-b",
|
||||
}}
|
||||
var got *pb.Task
|
||||
_, err := intercept(ctx, req, &grpc.UnaryServerInfo{FullMethod: pb.StateStoreService_Update_FullMethodName},
|
||||
_, err := intercept(ctx, req, &grpc.UnaryServerInfo{FullMethod: pb.TaskService_Update_FullMethodName},
|
||||
func(_ context.Context, r any) (any, error) {
|
||||
update, ok := r.(*pb.UpdateRequest)
|
||||
if !ok {
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestRecordUsageAuthority(t *testing.T) {
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
req := &pb.RecordUsageRequest{Record: tt.record}
|
||||
if got := authorizesTaskScopedCall(pb.StateStoreService_RecordUsage_FullMethodName, req, 7); got != tt.allowed {
|
||||
if got := authorizesTaskScopedCall(pb.ExecutionService_RecordUsage_FullMethodName, req, 7); got != tt.allowed {
|
||||
t.Fatalf("authorized = %v, want %v", got, tt.allowed)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -24,7 +24,7 @@ func TestRecordUsageBillsTheCallersOrg(t *testing.T) {
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
capture := &usageCapture{}
|
||||
s := &server{deps: Deps{Usage: capture}}
|
||||
s := &executionServer{server: &server{deps: Deps{Usage: capture}}}
|
||||
ctx := context.Background()
|
||||
if tt.caller != "" {
|
||||
ctx = org.WithOrg(ctx, org.OrgID(tt.caller))
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestWorkerPresenceAuthority(t *testing.T) {
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
req := &pb.PutPresenceRequest{Presence: &pb.Presence{Service: tt.service, InstanceId: tt.instance}}
|
||||
if got := authorizesTaskScopedCall(pb.StateStoreService_PutPresence_FullMethodName, req, 7); got != tt.allowed {
|
||||
if got := authorizesTaskScopedCall(pb.StatusService_PutPresence_FullMethodName, req, 7); got != tt.allowed {
|
||||
t.Fatalf("authorized = %v, want %v", got, tt.allowed)
|
||||
}
|
||||
})
|
||||
|
||||
+10
-5
@@ -6,7 +6,12 @@ lint:
|
||||
- STANDARD
|
||||
breaking:
|
||||
use:
|
||||
- FILE
|
||||
- PACKAGE
|
||||
# StateStoreService split into one service per domain in state.v1; its RPCs
|
||||
# and messages kept their names and numbers. A package-level deletion
|
||||
# cannot be path-ignored.
|
||||
except:
|
||||
- PACKAGE_SERVICE_NO_DELETE
|
||||
# Two intentional wire breaks, both widening an id-shaped field from int64 to
|
||||
# string in place, on the same field numbers and names. The PocketBase
|
||||
# migration moved the event-capture contract's record ids to PocketBase's
|
||||
@@ -36,14 +41,14 @@ breaking:
|
||||
# clients ship from this repository.
|
||||
ignore_only:
|
||||
FIELD_SAME_TYPE:
|
||||
- state/v1/state.proto
|
||||
- state/v1
|
||||
RPC_NO_DELETE:
|
||||
- state/v1/state.proto
|
||||
- state/v1
|
||||
- gateway/v1/chat.proto
|
||||
MESSAGE_NO_DELETE:
|
||||
- state/v1/state.proto
|
||||
- state/v1
|
||||
- gateway/v1/chat.proto
|
||||
FIELD_NO_DELETE:
|
||||
- state/v1/state.proto
|
||||
- state/v1
|
||||
- controlplane/v1/controlplane.proto
|
||||
- gateway/v1/chat.proto
|
||||
@@ -0,0 +1,91 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// 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.
|
||||
service AccessService {
|
||||
// The principal assembly the Authorizer evaluates: an identity, the org
|
||||
// it serves, and its memberships (internal/domain/access).
|
||||
rpc GetPrincipal(GetPrincipalRequest) returns (GetPrincipalResponse);
|
||||
rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse);
|
||||
// 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.
|
||||
rpc GetPoliciesVersion(GetPoliciesVersionRequest) returns (GetPoliciesVersionResponse);
|
||||
rpc PutPolicy(PutPolicyRequest) returns (PutPolicyResponse);
|
||||
rpc DeletePolicy(DeletePolicyRequest) returns (DeletePolicyResponse);
|
||||
rpc EnsureShippedOrgPolicies(EnsureShippedOrgPoliciesRequest) returns (EnsureShippedOrgPoliciesResponse);
|
||||
rpc RecordDenial(RecordDenialRequest) returns (RecordDenialResponse);
|
||||
rpc ListDenials(ListDenialsRequest) returns (ListDenialsResponse);
|
||||
}
|
||||
|
||||
message GetPrincipalRequest { string identity_id = 1; }
|
||||
// PrincipalMembership mirrors org.Membership: an identity's role in an org,
|
||||
// or in one workspace of it.
|
||||
message PrincipalMembership {
|
||||
string org_id = 1;
|
||||
string workspace_id = 2;
|
||||
string role = 3;
|
||||
}
|
||||
// PrincipalWorkspace is one workspace of the principal's org, as policies
|
||||
// read it.
|
||||
message PrincipalWorkspace {
|
||||
string workspace_id = 1;
|
||||
string environment = 2;
|
||||
}
|
||||
message AccessPrincipal {
|
||||
string identity_id = 1;
|
||||
string org_id = 2;
|
||||
repeated PrincipalMembership memberships = 3;
|
||||
// workspaces are the workspaces of org_id.
|
||||
repeated PrincipalWorkspace workspaces = 4;
|
||||
}
|
||||
message GetPrincipalResponse { AccessPrincipal principal = 1; }
|
||||
// AccessPolicy mirrors internal/domain/access.Policy: one Cedar policy
|
||||
// document and the level-scope tuple that places it in the chain.
|
||||
message AccessPolicy {
|
||||
string policy_id = 1;
|
||||
string level = 2;
|
||||
string org_id = 3;
|
||||
string workspace_id = 4;
|
||||
string object_kind = 5;
|
||||
string object_id = 6;
|
||||
string text = 7;
|
||||
}
|
||||
message ListPoliciesRequest {}
|
||||
message ListPoliciesResponse { repeated AccessPolicy policies = 1; }
|
||||
message GetPoliciesVersionRequest {}
|
||||
message GetPoliciesVersionResponse { int64 version = 1; }
|
||||
message PutPolicyRequest { AccessPolicy policy = 1; }
|
||||
message PutPolicyResponse { int64 version = 1; }
|
||||
message DeletePolicyRequest { AccessPolicy policy = 1; }
|
||||
message DeletePolicyResponse {}
|
||||
message EnsureShippedOrgPoliciesRequest { string org_id = 1; }
|
||||
message EnsureShippedOrgPoliciesResponse {}
|
||||
// AccessDenial mirrors internal/domain/access.Denial: one refusal with the
|
||||
// level that decided it and the deciding policies. The store coalesces
|
||||
// identical denials within a minute into one row with a count.
|
||||
message AccessDenial {
|
||||
string org_id = 1;
|
||||
string principal = 2;
|
||||
string action = 3;
|
||||
string resource_kind = 4;
|
||||
string resource_id = 5;
|
||||
string level = 6;
|
||||
repeated string policies = 7;
|
||||
int64 count = 8;
|
||||
google.protobuf.Timestamp at = 9;
|
||||
}
|
||||
message RecordDenialRequest { AccessDenial denial = 1; }
|
||||
message RecordDenialResponse {}
|
||||
message ListDenialsRequest {
|
||||
reserved 1;
|
||||
reserved "org_id";
|
||||
int32 limit = 2;
|
||||
}
|
||||
message ListDenialsResponse { repeated AccessDenial denials = 1; }
|
||||
@@ -0,0 +1,95 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "state/v1/types.proto";
|
||||
|
||||
service AccountService {
|
||||
rpc GetAuthenticationSettings(GetAuthenticationSettingsRequest) returns (GetAuthenticationSettingsResponse);
|
||||
rpc SaveAuthenticationSettings(SaveAuthenticationSettingsRequest) returns (SaveAuthenticationSettingsResponse);
|
||||
rpc BeginPasskey(BeginPasskeyRequest) returns (BeginPasskeyResponse);
|
||||
rpc FinishPasskey(FinishPasskeyRequest) returns (FinishPasskeyResponse);
|
||||
rpc ListPasskeys(ListPasskeysRequest) returns (ListPasskeysResponse);
|
||||
rpc DeletePasskey(DeletePasskeyRequest) returns (DeletePasskeyResponse);
|
||||
rpc OpenAccountSession(OpenAccountSessionRequest) returns (OpenAccountSessionResponse);
|
||||
rpc RequireFreshAccountSession(RequireFreshAccountSessionRequest) returns (RequireFreshAccountSessionResponse);
|
||||
rpc CreateAccountRecovery(CreateAccountRecoveryRequest) returns (CreateAccountRecoveryResponse);
|
||||
rpc RecoverAccount(RecoverAccountRequest) returns (RecoverAccountResponse);
|
||||
rpc AccountSetup(AccountSetupRequest) returns (AccountSetupResponse);
|
||||
rpc RegisterAccount(RegisterAccountRequest) returns (RegisterAccountResponse);
|
||||
rpc SignInAccount(SignInAccountRequest) returns (SignInAccountResponse);
|
||||
rpc ResolveAccountSession(ResolveAccountSessionRequest) returns (ResolveAccountSessionResponse);
|
||||
rpc SignOutAccount(SignOutAccountRequest) returns (SignOutAccountResponse);
|
||||
rpc ChangeAccountPassword(ChangeAccountPasswordRequest) returns (ChangeAccountPasswordResponse);
|
||||
// Personal API tokens act on the caller's own principal: the State Store
|
||||
// refuses a call that carries none.
|
||||
rpc AddPersonalToken(AddPersonalTokenRequest) returns (AddPersonalTokenResponse);
|
||||
rpc ListPersonalTokens(ListPersonalTokensRequest) returns (ListPersonalTokensResponse);
|
||||
rpc RevokePersonalToken(RevokePersonalTokenRequest) returns (RevokePersonalTokenResponse);
|
||||
}
|
||||
|
||||
// PersonalToken identifies a token by the SHA-256 it binds as; the token
|
||||
// itself never reaches the State Store.
|
||||
message PersonalToken {
|
||||
string id = 1;
|
||||
google.protobuf.Timestamp created_at = 2;
|
||||
}
|
||||
message AddPersonalTokenRequest { string id = 1; }
|
||||
message AddPersonalTokenResponse {}
|
||||
message ListPersonalTokensRequest {}
|
||||
message ListPersonalTokensResponse { repeated PersonalToken tokens = 1; }
|
||||
message RevokePersonalTokenRequest { string id = 1; }
|
||||
message RevokePersonalTokenResponse {}
|
||||
message AccountSetupRequest {}
|
||||
message AccountSetupResponse { bool required = 1; }
|
||||
message RegisterAccountRequest {
|
||||
string email = 1;
|
||||
string display_name = 2;
|
||||
string password = 3;
|
||||
string role = 4;
|
||||
bool bootstrap = 5;
|
||||
string organisation_name = 6;
|
||||
string workspace_name = 7;
|
||||
string public_url = 8;
|
||||
}
|
||||
message RegisterAccountResponse { Identity identity = 1; }
|
||||
message SignInAccountRequest { string email = 1; string password = 2; }
|
||||
message SignInAccountResponse {
|
||||
Identity identity = 1;
|
||||
string token = 2;
|
||||
google.protobuf.Timestamp expires_at = 3;
|
||||
}
|
||||
message ResolveAccountSessionRequest { string token = 1; }
|
||||
message ResolveAccountSessionResponse { Identity identity = 1; }
|
||||
message SignOutAccountRequest { string token = 1; }
|
||||
message SignOutAccountResponse {}
|
||||
message ChangeAccountPasswordRequest { string current_password = 1; string new_password = 2; }
|
||||
message ChangeAccountPasswordResponse {}
|
||||
message AuthenticationSettings {
|
||||
string public_url = 1;
|
||||
string oidc_issuer = 2;
|
||||
string oidc_audience = 3;
|
||||
string oidc_client_id = 4;
|
||||
}
|
||||
message GetAuthenticationSettingsRequest {}
|
||||
message GetAuthenticationSettingsResponse { AuthenticationSettings settings = 1; }
|
||||
message SaveAuthenticationSettingsRequest { AuthenticationSettings settings = 1; }
|
||||
message SaveAuthenticationSettingsResponse {}
|
||||
message BeginPasskeyRequest { bool registration = 1; }
|
||||
message BeginPasskeyResponse { string token = 1; bytes options = 2; }
|
||||
message FinishPasskeyRequest { string token = 1; bytes credential = 2; bool registration = 3; string name = 4; }
|
||||
message FinishPasskeyResponse { Identity identity = 1; string token = 2; google.protobuf.Timestamp expires_at = 3; }
|
||||
message Passkey { string id = 1; string name = 2; }
|
||||
message ListPasskeysRequest {}
|
||||
message ListPasskeysResponse { repeated Passkey passkeys = 1; }
|
||||
message DeletePasskeyRequest { string id = 1; }
|
||||
message DeletePasskeyResponse {}
|
||||
message OpenAccountSessionRequest { google.protobuf.Timestamp expires_at = 1; }
|
||||
message OpenAccountSessionResponse { Identity identity = 1; string token = 2; google.protobuf.Timestamp expires_at = 3; }
|
||||
message RequireFreshAccountSessionRequest { string token = 1; }
|
||||
message RequireFreshAccountSessionResponse {}
|
||||
message CreateAccountRecoveryRequest {}
|
||||
message CreateAccountRecoveryResponse { string code = 1; }
|
||||
message RecoverAccountRequest { string email = 1; string code = 2; string password = 3; }
|
||||
message RecoverAccountResponse {}
|
||||
@@ -0,0 +1,103 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// Operator alerts (internal/domain/alert). A caller acting for a principal
|
||||
// reads, dismisses and raises only in that principal's org; a request org is
|
||||
// ignored for it. A service acting for no one names the org itself.
|
||||
// RaiseAlert and ResolveAlert are idempotent, so a periodic check can call
|
||||
// them every tick. ClaimAlertDeliveries and RecordAlertAttempt serve the
|
||||
// outbound webhook and refuse a caller scoped to an org.
|
||||
service AlertService {
|
||||
rpc RaiseAlert(RaiseAlertRequest) returns (RaiseAlertResponse);
|
||||
rpc ResolveAlert(ResolveAlertRequest) returns (ResolveAlertResponse);
|
||||
rpc DismissAlert(DismissAlertRequest) returns (DismissAlertResponse);
|
||||
rpc ListAlerts(ListAlertsRequest) returns (ListAlertsResponse);
|
||||
rpc ClaimAlertDeliveries(ClaimAlertDeliveriesRequest) returns (ClaimAlertDeliveriesResponse);
|
||||
rpc RecordAlertAttempt(RecordAlertAttemptRequest) returns (RecordAlertAttemptResponse);
|
||||
}
|
||||
|
||||
// Alert mirrors internal/domain/alert.Alert. Severity is info, warning or
|
||||
// action; state is open, resolved or dismissed.
|
||||
message Alert {
|
||||
int64 id = 1;
|
||||
string org_id = 2;
|
||||
string kind = 3;
|
||||
string subject = 4;
|
||||
string severity = 5;
|
||||
string title = 6;
|
||||
string body = 7;
|
||||
string link = 8;
|
||||
bool condition = 9;
|
||||
string state = 10;
|
||||
google.protobuf.Timestamp first_raised = 11;
|
||||
google.protobuf.Timestamp last_seen = 12;
|
||||
int64 count = 13;
|
||||
string closed_by = 14;
|
||||
google.protobuf.Timestamp closed_at = 15;
|
||||
repeated AlertDelivery deliveries = 16;
|
||||
}
|
||||
// AlertDelivery is one outbound notice an alert owed. Event is raised or
|
||||
// resolved; state is pending, delivered, failed or skipped.
|
||||
message AlertDelivery {
|
||||
int64 id = 1;
|
||||
string event = 2;
|
||||
string state = 3;
|
||||
google.protobuf.Timestamp created_at = 4;
|
||||
repeated AlertAttempt attempts = 5;
|
||||
}
|
||||
message AlertAttempt {
|
||||
int64 n = 1;
|
||||
google.protobuf.Timestamp at = 2;
|
||||
int64 status_code = 3;
|
||||
string error = 4;
|
||||
}
|
||||
message RaiseAlertRequest {
|
||||
string org_id = 1;
|
||||
string kind = 2;
|
||||
string subject = 3;
|
||||
string severity = 4;
|
||||
string title = 5;
|
||||
string body = 6;
|
||||
string link = 7;
|
||||
// condition is true when the raiser resolves the alert itself once the
|
||||
// condition clears; an event alert stays until dismissed.
|
||||
bool condition = 8;
|
||||
}
|
||||
message RaiseAlertResponse { Alert alert = 1; }
|
||||
message ResolveAlertRequest {
|
||||
string org_id = 1;
|
||||
string kind = 2;
|
||||
string subject = 3;
|
||||
}
|
||||
message ResolveAlertResponse {}
|
||||
message DismissAlertRequest {
|
||||
string org_id = 1;
|
||||
int64 id = 2;
|
||||
}
|
||||
message DismissAlertResponse {}
|
||||
message ListAlertsRequest {
|
||||
string org_id = 1;
|
||||
// states defaults to open.
|
||||
repeated string states = 2;
|
||||
int32 limit = 3;
|
||||
}
|
||||
message ListAlertsResponse { repeated Alert alerts = 1; }
|
||||
message ClaimAlertDeliveriesRequest { int32 limit = 1; }
|
||||
message DueAlertDelivery {
|
||||
AlertDelivery delivery = 1;
|
||||
Alert alert = 2;
|
||||
// attempt is the number of this try, counting from one.
|
||||
int64 attempt = 3;
|
||||
}
|
||||
message ClaimAlertDeliveriesResponse { repeated DueAlertDelivery due = 1; }
|
||||
message RecordAlertAttemptRequest {
|
||||
int64 delivery_id = 1;
|
||||
bool skipped = 2;
|
||||
int64 status_code = 3;
|
||||
// error is empty on success.
|
||||
string error = 4;
|
||||
}
|
||||
message RecordAlertAttemptResponse {}
|
||||
@@ -0,0 +1,69 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service BindingService {
|
||||
rpc InsertBinding(InsertBindingRequest) returns (InsertBindingResponse);
|
||||
rpc GetBinding(GetBindingRequest) returns (GetBindingResponse);
|
||||
rpc ListBindings(ListBindingsRequest) returns (ListBindingsResponse);
|
||||
rpc UpdateBinding(UpdateBindingRequest) returns (UpdateBindingResponse);
|
||||
rpc DeleteBinding(DeleteBindingRequest) returns (DeleteBindingResponse);
|
||||
rpc ApproveBinding(ApproveBindingRequest) returns (ApproveBindingResponse);
|
||||
rpc PauseBinding(PauseBindingRequest) returns (PauseBindingResponse);
|
||||
rpc ResumeBinding(ResumeBindingRequest) returns (ResumeBindingResponse);
|
||||
rpc ArmedBindingsForSource(ArmedBindingsForSourceRequest) returns (ArmedBindingsForSourceResponse);
|
||||
}
|
||||
|
||||
// BindingMatcher mirrors internal/domain/binding.Matcher.
|
||||
message BindingMatcher {
|
||||
string source = 1;
|
||||
}
|
||||
// Binding mirrors internal/domain/binding.Binding.
|
||||
message Binding {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
BindingMatcher matcher = 3;
|
||||
string mapping_id = 4;
|
||||
string workflow = 5;
|
||||
string owner = 6;
|
||||
string repo = 7;
|
||||
int64 version = 8;
|
||||
string status = 9;
|
||||
reserved 10;
|
||||
reserved "secret";
|
||||
google.protobuf.Timestamp created_at = 11;
|
||||
google.protobuf.Timestamp updated_at = 12;
|
||||
string filter = 13;
|
||||
// inputs_json assigns workflow inputs, a JSON object of
|
||||
// {"param": name} or {"value": constant} per input.
|
||||
string inputs_json = 14;
|
||||
// repo_param names the mapped parameter holding "owner/name".
|
||||
string repo_param = 15;
|
||||
// org_id is the org that owns the binding; it is read-only here.
|
||||
string org_id = 16;
|
||||
// workspace_id is its source's workspace; read-only here.
|
||||
string workspace_id = 17;
|
||||
}
|
||||
message InsertBindingRequest { Binding binding = 1; }
|
||||
message InsertBindingResponse { string id = 1; }
|
||||
message GetBindingRequest { string id = 1; }
|
||||
message GetBindingResponse {
|
||||
Binding binding = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message ListBindingsRequest {}
|
||||
message ListBindingsResponse { repeated Binding bindings = 1; }
|
||||
message UpdateBindingRequest { Binding binding = 1; }
|
||||
message UpdateBindingResponse {}
|
||||
message DeleteBindingRequest { string id = 1; }
|
||||
message DeleteBindingResponse {}
|
||||
message ApproveBindingRequest { string id = 1; }
|
||||
message ApproveBindingResponse {}
|
||||
message PauseBindingRequest { string id = 1; }
|
||||
message PauseBindingResponse {}
|
||||
message ResumeBindingRequest { string id = 1; }
|
||||
message ResumeBindingResponse {}
|
||||
message ArmedBindingsForSourceRequest { string source = 1; }
|
||||
message ArmedBindingsForSourceResponse { repeated Binding bindings = 1; }
|
||||
@@ -0,0 +1,72 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service CaptureService {
|
||||
// Capture refusals: events the network rules refused at the receiver,
|
||||
// counted per source. Administrative.
|
||||
rpc RecordCaptureRefusal(RecordCaptureRefusalRequest) returns (RecordCaptureRefusalResponse);
|
||||
rpc ListCaptureRefusals(ListCaptureRefusalsRequest) returns (ListCaptureRefusalsResponse);
|
||||
rpc InsertCapture(InsertCaptureRequest) returns (InsertCaptureResponse);
|
||||
// StreamCaptures returns one capture per message: a batch of large capture
|
||||
// bodies can exceed gRPC's 4MiB unary message cap
|
||||
// (docs/prds/state-store-contract.md).
|
||||
rpc StreamCaptures(StreamCapturesRequest) returns (stream StreamCapturesResponse);
|
||||
rpc StreamUndispatchedCaptures(StreamUndispatchedCapturesRequest) returns (stream StreamUndispatchedCapturesResponse);
|
||||
}
|
||||
|
||||
// CapturedEvent mirrors storecontract.CapturedEvent.
|
||||
message CapturedEvent {
|
||||
string id = 1;
|
||||
google.protobuf.Timestamp received_at = 2;
|
||||
string source = 3;
|
||||
string remote_addr = 4;
|
||||
string content_type = 5;
|
||||
string headers = 6;
|
||||
string body = 7;
|
||||
bool authenticated = 8;
|
||||
// event_type is the ID of the event type the capture was identified as on
|
||||
// arrival; empty is unidentified.
|
||||
string event_type = 9;
|
||||
// unsigned marks an event taken on an approved unsigned source.
|
||||
bool unsigned = 10;
|
||||
// delivery names the sender's delivery; a retry of one delivery shares it.
|
||||
// Intake sets it from the source's delivery header; empty takes the
|
||||
// capture ID.
|
||||
string delivery = 11;
|
||||
}
|
||||
message RecordCaptureRefusalRequest {
|
||||
string source = 1;
|
||||
string addr = 2;
|
||||
google.protobuf.Timestamp refused_at = 3;
|
||||
}
|
||||
message RecordCaptureRefusalResponse {}
|
||||
message ListCaptureRefusalsRequest { google.protobuf.Timestamp since = 1; }
|
||||
message CaptureRefusals {
|
||||
string source = 1;
|
||||
int64 refused = 2;
|
||||
int64 accepted = 3;
|
||||
repeated string addrs = 4;
|
||||
}
|
||||
message ListCaptureRefusalsResponse { repeated CaptureRefusals sources = 1; }
|
||||
message InsertCaptureRequest {
|
||||
CapturedEvent capture = 1;
|
||||
int64 retention_seconds = 2;
|
||||
int64 max_events = 3;
|
||||
}
|
||||
message InsertCaptureResponse { string id = 1; }
|
||||
message StreamCapturesRequest { int64 limit = 1; }
|
||||
// Streamed one capture per message; see StreamCaptures above.
|
||||
message StreamCapturesResponse { CapturedEvent capture = 1; }
|
||||
message StreamUndispatchedCapturesRequest {
|
||||
reserved 1;
|
||||
reserved "sources";
|
||||
// Bindings are the ids of the armed bindings, on enabled workflows, the
|
||||
// captures are listed for.
|
||||
repeated string bindings = 3;
|
||||
int64 limit = 2;
|
||||
}
|
||||
// Streamed one capture per message; see StreamUndispatchedCaptures above.
|
||||
message StreamUndispatchedCapturesResponse { CapturedEvent capture = 1; }
|
||||
@@ -0,0 +1,72 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "state/v1/types.proto";
|
||||
|
||||
service DispatchService {
|
||||
rpc ListDispatches(ListDispatchesRequest) returns (ListDispatchesResponse);
|
||||
rpc RecordDispatch(RecordDispatchRequest) returns (RecordDispatchResponse);
|
||||
// Playbook dispatch ledger (eda-playbook-engine.md gap 2): one durable
|
||||
// at-most-once record per (playbook, version, event, action) for the
|
||||
// side-effecting positions. Administrative, like RecordDispatch: a
|
||||
// task-scoped grant cannot reach either (see TaskGrants).
|
||||
rpc RecordPlaybookDispatch(RecordPlaybookDispatchRequest) returns (RecordPlaybookDispatchResponse);
|
||||
rpc DeletePlaybookDispatches(DeletePlaybookDispatchesRequest) returns (DeletePlaybookDispatchesResponse);
|
||||
// BindingTaskCreator: claims the binding's dispatch of a capture and
|
||||
// enqueues its task in one transaction, so a failure leaves neither and a
|
||||
// replayed delivery is refused with AlreadyExists.
|
||||
rpc EnqueueBindingTask(EnqueueBindingTaskRequest) returns (EnqueueBindingTaskResponse);
|
||||
}
|
||||
|
||||
message RecordDispatchRequest {
|
||||
string binding_id = 1;
|
||||
int64 binding_version = 2;
|
||||
string capture_id = 3;
|
||||
// task_id addresses the tasks table.
|
||||
int64 task_id = 4;
|
||||
// reason is empty for a dispatch and names why an evaluated capture
|
||||
// started no task.
|
||||
string reason = 5;
|
||||
}
|
||||
message RecordDispatchResponse {}
|
||||
// ListDispatchesRequest filters the binding dispatch ledger; empty fields
|
||||
// match any row.
|
||||
message ListDispatchesRequest {
|
||||
string binding_id = 1;
|
||||
string capture_id = 2;
|
||||
int64 task_id = 3;
|
||||
int32 limit = 4;
|
||||
}
|
||||
message Dispatch {
|
||||
string binding_id = 1;
|
||||
int64 binding_version = 2;
|
||||
string capture_id = 3;
|
||||
int64 task_id = 4;
|
||||
string reason = 5;
|
||||
google.protobuf.Timestamp dispatched_at = 6;
|
||||
}
|
||||
message ListDispatchesResponse { repeated Dispatch dispatches = 1; }
|
||||
message RecordPlaybookDispatchRequest {
|
||||
string playbook_id = 1;
|
||||
string playbook_version = 2;
|
||||
string event_id = 3;
|
||||
string action_id = 4;
|
||||
}
|
||||
message RecordPlaybookDispatchResponse {}
|
||||
message DeletePlaybookDispatchesRequest { string playbook_id = 1; }
|
||||
message DeletePlaybookDispatchesResponse {}
|
||||
message EnqueueBindingTaskRequest {
|
||||
string owner = 1;
|
||||
string repo = 2;
|
||||
string title = 3;
|
||||
string body = 4;
|
||||
string workflow = 5;
|
||||
string identity = 6;
|
||||
string binding_id = 7;
|
||||
int64 binding_version = 8;
|
||||
string inputs_json = 9;
|
||||
string capture_id = 10;
|
||||
}
|
||||
message EnqueueBindingTaskResponse { Task task = 1; }
|
||||
@@ -0,0 +1,47 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// Event types. Insert and Update refuse an overlapping or malformed type.
|
||||
service EventTypeService {
|
||||
rpc InsertEventType(InsertEventTypeRequest) returns (InsertEventTypeResponse);
|
||||
rpc UpdateEventType(UpdateEventTypeRequest) returns (UpdateEventTypeResponse);
|
||||
rpc DeleteEventType(DeleteEventTypeRequest) returns (DeleteEventTypeResponse);
|
||||
rpc ListEventTypes(ListEventTypesRequest) returns (ListEventTypesResponse);
|
||||
}
|
||||
|
||||
// EventTypeHeaderCondition mirrors internal/domain/eventtype.HeaderCondition.
|
||||
message EventTypeHeaderCondition {
|
||||
string name = 1;
|
||||
string value = 2;
|
||||
}
|
||||
// EventTypePayloadCondition mirrors internal/domain/eventtype.PayloadCondition.
|
||||
message EventTypePayloadCondition {
|
||||
string path = 1;
|
||||
string op = 2;
|
||||
string value = 3;
|
||||
}
|
||||
// EventType mirrors internal/domain/eventtype.EventType. header_conditions and
|
||||
// payload_conditions are its rule; schema maps each payload path to its type.
|
||||
message EventType {
|
||||
string id = 1;
|
||||
string source = 2;
|
||||
string name = 3;
|
||||
repeated EventTypeHeaderCondition header_conditions = 4;
|
||||
repeated EventTypePayloadCondition payload_conditions = 5;
|
||||
map<string, string> schema = 6;
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
google.protobuf.Timestamp updated_at = 8;
|
||||
// workspace_id is its source's workspace; read-only here.
|
||||
string workspace_id = 9;
|
||||
}
|
||||
message InsertEventTypeRequest { EventType event_type = 1; }
|
||||
message InsertEventTypeResponse { string id = 1; }
|
||||
message UpdateEventTypeRequest { EventType event_type = 1; }
|
||||
message UpdateEventTypeResponse {}
|
||||
message DeleteEventTypeRequest { string id = 1; }
|
||||
message DeleteEventTypeResponse {}
|
||||
message ListEventTypesRequest {}
|
||||
message ListEventTypesResponse { repeated EventType event_types = 1; }
|
||||
@@ -0,0 +1,128 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "state/v1/types.proto";
|
||||
|
||||
service ExecutionService {
|
||||
// Step executions (docs/prds/execution-tree-state-machine.md). The run
|
||||
// credential authorises both on its own execution only.
|
||||
rpc StartStep(StartStepRequest) returns (StartStepResponse);
|
||||
// RecordUsage appends one model call's usage record. A run credential may
|
||||
// record usage only for its own task.
|
||||
rpc RecordUsage(RecordUsageRequest) returns (RecordUsageResponse);
|
||||
rpc FinishStep(FinishStepRequest) returns (FinishStepResponse);
|
||||
// Cancellation. Deliberately administrative (deny-by-default for a
|
||||
// task-scoped grant): a cancel is a dashboard, API and dispatch action
|
||||
// decided by the Authorizer, not a worker call.
|
||||
rpc CancelExecution(CancelExecutionRequest) returns (CancelExecutionResponse);
|
||||
// ListSteps is a dashboard/API/dispatch action (Authorizer: read on the
|
||||
// run), not task-scoped-grant callable like StartStep/FinishStep.
|
||||
rpc ListSteps(ListStepsRequest) returns (ListStepsResponse);
|
||||
}
|
||||
|
||||
message StartStepRequest {
|
||||
// execution_id is the WorkflowExecution (the tasks row) the step belongs
|
||||
// to, and the task ID the run credential is scoped to.
|
||||
int64 execution_id = 1;
|
||||
int64 attempt = 2;
|
||||
// parent_id is 0 when the step is a stage; otherwise it names the enclosing
|
||||
// StepExecution, from which the store derives depth.
|
||||
int64 parent_id = 3;
|
||||
// kind is stage, agent or call.
|
||||
string kind = 4;
|
||||
string name = 5;
|
||||
// called_execution_id names the WorkflowExecution a `call` step started;
|
||||
// the store verifies it is this execution's own callee.
|
||||
int64 called_execution_id = 6;
|
||||
}
|
||||
message StartStepResponse {
|
||||
int64 step_id = 1;
|
||||
// event is the transition's stage_start row, already persisted; the caller
|
||||
// publishes it to its bus after the write commits (the daemon's event sink
|
||||
// skips already-persisted rows by their assigned ID).
|
||||
Event event = 2;
|
||||
}
|
||||
message FinishStepRequest {
|
||||
// execution_id names the run the step belongs to. The grant check verifies
|
||||
// it against the credential, and the store verifies the step really is that
|
||||
// execution's, so a caller cannot move another run's step by naming it.
|
||||
int64 execution_id = 1;
|
||||
int64 step_id = 2;
|
||||
string from = 3;
|
||||
string to = 4;
|
||||
string detail = 5;
|
||||
int64 tokens_used = 6;
|
||||
// results is the run's step results (JSON, by step id) after a stage the
|
||||
// run moves past; empty otherwise. A resumed attempt starts from them.
|
||||
bytes results = 7;
|
||||
}
|
||||
message FinishStepResponse {
|
||||
// event is the transition's stage_finish row, already persisted.
|
||||
Event event = 1;
|
||||
}
|
||||
message CancelExecutionRequest {
|
||||
int64 task_id = 1;
|
||||
// reason records why the run was stopped, in the execution's park reason
|
||||
// when the cancel lands there, and on every step event it writes.
|
||||
string reason = 2;
|
||||
// to is the execution's destination: the transition table routes it, and
|
||||
// the operator actions name parked or closed_wont_do.
|
||||
string to = 3;
|
||||
}
|
||||
message CancelExecutionResponse {
|
||||
reserved 1;
|
||||
reserved "cancelled_step_ids";
|
||||
// cancelled_callee_ids are the executions the caller was waiting on that
|
||||
// were cancelled with it, nested callees included; the caller stops their
|
||||
// runs as well as its own.
|
||||
repeated int64 cancelled_callee_ids = 2;
|
||||
}
|
||||
// StepExecution mirrors internal/domain/workflow/task.StepExecution.
|
||||
message StepExecution {
|
||||
int64 id = 1;
|
||||
int64 execution_id = 2;
|
||||
int64 attempt = 3;
|
||||
// parent_id is 0 for a stage at the tree's root.
|
||||
int64 parent_id = 4;
|
||||
int32 depth = 5;
|
||||
string kind = 6;
|
||||
string name = 7;
|
||||
string status = 8;
|
||||
string detail = 9;
|
||||
int64 tokens_used = 10;
|
||||
google.protobuf.Timestamp started_at = 11;
|
||||
google.protobuf.Timestamp finished_at = 12;
|
||||
// called_execution_id is the callee task a workflow.call step started.
|
||||
int64 called_execution_id = 13;
|
||||
}
|
||||
message ListStepsRequest {
|
||||
int64 execution_id = 1;
|
||||
// attempt selects one attempt's steps; 0 lists every attempt of the
|
||||
// execution, oldest first -- the dashboard's run-detail rail renders every
|
||||
// attempt from a single call rather than one per attempt.
|
||||
int64 attempt = 2;
|
||||
}
|
||||
message ListStepsResponse { repeated StepExecution steps = 1; }
|
||||
// UsageRecord mirrors usage.Record. A task's record belongs to the task's
|
||||
// org; any other belongs to the calling principal's org.
|
||||
message UsageRecord {
|
||||
reserved 1;
|
||||
reserved "org_id";
|
||||
// source is task, chat or curator.
|
||||
string source = 2;
|
||||
int64 task_id = 3;
|
||||
int64 attempt = 4;
|
||||
string workflow = 5;
|
||||
string step = 6;
|
||||
string alias = 7;
|
||||
string provider = 8;
|
||||
string model = 9;
|
||||
int64 input_tokens = 10;
|
||||
int64 output_tokens = 11;
|
||||
int64 cached_tokens = 12;
|
||||
google.protobuf.Timestamp at = 13;
|
||||
}
|
||||
message RecordUsageRequest { UsageRecord record = 1; }
|
||||
message RecordUsageResponse {}
|
||||
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// Harness OAuth secrets (docs/prds/external-agent-harness.md,
|
||||
// Credentials). Administrative: the setup terminal (an `update` action on
|
||||
// the secret, Authorizer-gated) and the egress proxy's token-endpoint
|
||||
// interception (acting as the daemon, not a worker) are the only callers.
|
||||
service HarnessSecretService {
|
||||
rpc GetHarnessSecret(GetHarnessSecretRequest) returns (GetHarnessSecretResponse);
|
||||
rpc PutHarnessSecret(PutHarnessSecretRequest) returns (PutHarnessSecretResponse);
|
||||
}
|
||||
|
||||
// HarnessSecret mirrors internal/domain/harnesssecret.Secret -- one org's
|
||||
// captured OAuth token set for a credential binding's service
|
||||
// (docs/prds/external-agent-harness.md, Credentials).
|
||||
message HarnessSecret {
|
||||
reserved 1;
|
||||
reserved "org";
|
||||
string service = 2;
|
||||
string access_token = 3;
|
||||
string refresh_token = 4;
|
||||
string token_type = 5;
|
||||
google.protobuf.Timestamp expires_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
repeated string scopes = 8;
|
||||
}
|
||||
message GetHarnessSecretRequest {
|
||||
reserved 1;
|
||||
reserved "org";
|
||||
string service = 2;
|
||||
string run_credential = 3;
|
||||
}
|
||||
message GetHarnessSecretResponse {
|
||||
HarnessSecret secret = 1;
|
||||
string org = 2;
|
||||
}
|
||||
message PutHarnessSecretRequest {
|
||||
HarnessSecret secret = 1;
|
||||
string run_credential = 2;
|
||||
}
|
||||
message PutHarnessSecretResponse {}
|
||||
@@ -0,0 +1,70 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "state/v1/types.proto";
|
||||
|
||||
// Task-scoped grants cannot call these administrative RPCs.
|
||||
service IdentityService {
|
||||
rpc ListIdentities(ListIdentitiesRequest) returns (ListIdentitiesResponse);
|
||||
rpc GetIdentity(GetIdentityRequest) returns (GetIdentityResponse);
|
||||
rpc CreateIdentity(CreateIdentityRequest) returns (CreateIdentityResponse);
|
||||
rpc RenameIdentity(RenameIdentityRequest) returns (RenameIdentityResponse);
|
||||
rpc SuspendIdentity(SuspendIdentityRequest) returns (SuspendIdentityResponse);
|
||||
rpc ReactivateIdentity(ReactivateIdentityRequest) returns (ReactivateIdentityResponse);
|
||||
rpc RetireIdentity(RetireIdentityRequest) returns (RetireIdentityResponse);
|
||||
// Subject bindings. A verified provider subject is resolved to the identity it
|
||||
// is bound to; the authenticating process calls these rather than owning the
|
||||
// identity store.
|
||||
rpc ResolveIdentitySubject(ResolveIdentitySubjectRequest) returns (ResolveIdentitySubjectResponse);
|
||||
rpc BindIdentitySubject(BindIdentitySubjectRequest) returns (BindIdentitySubjectResponse);
|
||||
rpc ClaimIdentitySubject(ClaimIdentitySubjectRequest) returns (ClaimIdentitySubjectResponse);
|
||||
}
|
||||
|
||||
message IdentityAudit {
|
||||
string actor_id = 1;
|
||||
string source = 2;
|
||||
string request_id = 3;
|
||||
}
|
||||
message ListIdentitiesRequest {}
|
||||
message ListIdentitiesResponse { repeated Identity identities = 1; }
|
||||
message GetIdentityRequest { string id = 1; }
|
||||
message GetIdentityResponse { Identity identity = 1; }
|
||||
message CreateIdentityRequest {
|
||||
string id = 1;
|
||||
string kind = 2;
|
||||
string display_name = 3;
|
||||
IdentityAudit audit = 4;
|
||||
}
|
||||
message RenameIdentityRequest {
|
||||
string id = 1;
|
||||
int64 expected_version = 2;
|
||||
string display_name = 3;
|
||||
IdentityAudit audit = 4;
|
||||
}
|
||||
message SuspendIdentityRequest { string id = 1; int64 expected_version = 2; IdentityAudit audit = 3; }
|
||||
message ReactivateIdentityRequest { string id = 1; int64 expected_version = 2; IdentityAudit audit = 3; }
|
||||
message RetireIdentityRequest { string id = 1; int64 expected_version = 2; IdentityAudit audit = 3; }
|
||||
message CreateIdentityResponse { Identity identity = 1; }
|
||||
message RenameIdentityResponse { Identity identity = 1; }
|
||||
message SuspendIdentityResponse { Identity identity = 1; }
|
||||
message ReactivateIdentityResponse { Identity identity = 1; }
|
||||
message RetireIdentityResponse { Identity identity = 1; }
|
||||
message ResolveIdentitySubjectRequest {
|
||||
string issuer = 1;
|
||||
string subject = 2;
|
||||
}
|
||||
message ResolveIdentitySubjectResponse { Identity identity = 1; }
|
||||
message BindIdentitySubjectRequest {
|
||||
string id = 1;
|
||||
string issuer = 2;
|
||||
string subject = 3;
|
||||
IdentityAudit audit = 4;
|
||||
}
|
||||
message BindIdentitySubjectResponse { Identity identity = 1; }
|
||||
message ClaimIdentitySubjectRequest {
|
||||
string issuer = 1;
|
||||
string placeholder = 2;
|
||||
string subject = 3;
|
||||
}
|
||||
message ClaimIdentitySubjectResponse { Identity identity = 1; }
|
||||
@@ -0,0 +1,57 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service MappingService {
|
||||
rpc InsertMapping(InsertMappingRequest) returns (InsertMappingResponse);
|
||||
rpc GetMapping(GetMappingRequest) returns (GetMappingResponse);
|
||||
rpc ListMappings(ListMappingsRequest) returns (ListMappingsResponse);
|
||||
rpc UpdateMapping(UpdateMappingRequest) returns (UpdateMappingResponse);
|
||||
rpc DeleteMapping(DeleteMappingRequest) returns (DeleteMappingResponse);
|
||||
// RecordMappingMatch counts one event a mapping resolved; the same
|
||||
// (mapping, capture) twice counts once.
|
||||
rpc RecordMappingMatch(RecordMappingMatchRequest) returns (RecordMappingMatchResponse);
|
||||
}
|
||||
|
||||
// MappingField mirrors internal/domain/mapping.Field.
|
||||
message MappingField {
|
||||
string name = 1;
|
||||
string path = 2;
|
||||
string type = 3;
|
||||
bool required = 4;
|
||||
}
|
||||
// Mapping mirrors internal/domain/mapping.Mapping.
|
||||
message Mapping {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string source_hint = 3;
|
||||
repeated MappingField fields = 4;
|
||||
google.protobuf.Timestamp created_at = 5;
|
||||
google.protobuf.Timestamp updated_at = 6;
|
||||
string event_type_id = 7;
|
||||
// match_count and last_matched_at are read-only: the store counts them.
|
||||
int64 match_count = 8;
|
||||
google.protobuf.Timestamp last_matched_at = 9;
|
||||
// workspace_id is its event type's workspace; read-only here.
|
||||
string workspace_id = 10;
|
||||
}
|
||||
message InsertMappingRequest { Mapping mapping = 1; }
|
||||
message InsertMappingResponse { string id = 1; }
|
||||
message GetMappingRequest { string id = 1; }
|
||||
message GetMappingResponse {
|
||||
Mapping mapping = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message ListMappingsRequest {}
|
||||
message ListMappingsResponse { repeated Mapping mappings = 1; }
|
||||
message UpdateMappingRequest { Mapping mapping = 1; }
|
||||
message UpdateMappingResponse {}
|
||||
message DeleteMappingRequest { string id = 1; }
|
||||
message DeleteMappingResponse {}
|
||||
message RecordMappingMatchRequest {
|
||||
string mapping_id = 1;
|
||||
string capture_id = 2;
|
||||
}
|
||||
message RecordMappingMatchResponse {}
|
||||
@@ -0,0 +1,98 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
service OrgService {
|
||||
// CallerModels answers the model aliases the caller's org may use. The org
|
||||
// is the calling principal's; a call with none is the system org's.
|
||||
rpc CallerModels(CallerModelsRequest) returns (CallerModelsResponse);
|
||||
// Orgs, workspaces, memberships and agent assignments
|
||||
// (docs/prds/orgs-and-access.md). Every request names an org, but the
|
||||
// State Store acts in the org the caller's principal carries: a request
|
||||
// org that is not the caller's is ignored, so the contract cannot reach
|
||||
// another tenant. Instance-admin widening is a later change.
|
||||
rpc ListOrgs(ListOrgsRequest) returns (ListOrgsResponse);
|
||||
rpc GetOrg(GetOrgRequest) returns (GetOrgResponse);
|
||||
rpc CreateOrg(CreateOrgRequest) returns (CreateOrgResponse);
|
||||
rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse);
|
||||
rpc CreateWorkspace(CreateWorkspaceRequest) returns (CreateWorkspaceResponse);
|
||||
rpc ListMembers(ListMembersRequest) returns (ListMembersResponse);
|
||||
rpc SetMembership(SetMembershipRequest) returns (SetMembershipResponse);
|
||||
rpc RemoveMembership(RemoveMembershipRequest) returns (RemoveMembershipResponse);
|
||||
rpc ListOrgAgents(ListOrgAgentsRequest) returns (ListOrgAgentsResponse);
|
||||
rpc AssignAgent(AssignAgentRequest) returns (AssignAgentResponse);
|
||||
}
|
||||
|
||||
// Org mirrors internal/domain/org.Org: one tenant.
|
||||
message Org {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
}
|
||||
// Workspace mirrors internal/domain/org.Workspace: a division of an org.
|
||||
message Workspace {
|
||||
string id = 1;
|
||||
string org_id = 2;
|
||||
string name = 3;
|
||||
string environment = 4;
|
||||
}
|
||||
// Member mirrors internal/domain/org.Member: a membership with the identity
|
||||
// it names, as the dashboard lists it.
|
||||
message Member {
|
||||
string identity_id = 1;
|
||||
string kind = 2;
|
||||
string display_name = 3;
|
||||
string workspace_id = 4;
|
||||
string role = 5;
|
||||
}
|
||||
message ListOrgsRequest {}
|
||||
message ListOrgsResponse { repeated Org orgs = 1; }
|
||||
message GetOrgRequest { string org_id = 1; }
|
||||
message GetOrgResponse { Org org = 1; }
|
||||
// CreateOrgRequest creates an org with its default workspace and its first
|
||||
// owner. Only an instance admin may.
|
||||
message CreateOrgRequest {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string owner_identity_id = 3;
|
||||
}
|
||||
message CreateOrgResponse { Org org = 1; }
|
||||
message ListWorkspacesRequest { string org_id = 1; }
|
||||
message ListWorkspacesResponse { repeated Workspace workspaces = 1; }
|
||||
message CreateWorkspaceRequest {
|
||||
string org_id = 1;
|
||||
string id = 2;
|
||||
string name = 3;
|
||||
string environment = 4;
|
||||
}
|
||||
message CreateWorkspaceResponse { Workspace workspace = 1; }
|
||||
message ListMembersRequest { string org_id = 1; }
|
||||
message ListMembersResponse { repeated Member members = 1; }
|
||||
message SetMembershipRequest {
|
||||
string org_id = 1;
|
||||
string identity_id = 2;
|
||||
string workspace_id = 3;
|
||||
string role = 4;
|
||||
}
|
||||
message SetMembershipResponse {}
|
||||
message RemoveMembershipRequest {
|
||||
string org_id = 1;
|
||||
string identity_id = 2;
|
||||
string workspace_id = 3;
|
||||
}
|
||||
message RemoveMembershipResponse {}
|
||||
message AssignAgentRequest {
|
||||
string org_id = 1;
|
||||
string identity_id = 2;
|
||||
}
|
||||
message AssignAgentResponse {}
|
||||
message CallerModelsRequest {}
|
||||
message CallerModelsResponse {
|
||||
string org_id = 1;
|
||||
map<string, string> aliases = 2;
|
||||
}
|
||||
message ListOrgAgentsRequest { string org_id = 1; }
|
||||
message AgentAssignment {
|
||||
string identity_id = 1;
|
||||
string org_id = 2;
|
||||
}
|
||||
message ListOrgAgentsResponse { repeated AgentAssignment agents = 1; }
|
||||
@@ -0,0 +1,122 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
// Installed Archie packages. Administrative until org-scoped principals land.
|
||||
service PackageService {
|
||||
rpc InstallPackage(InstallPackageRequest) returns (InstallPackageResponse);
|
||||
// ListCatalogue returns the packages the instance's verified catalogue
|
||||
// offers; InstallFromCatalogue installs one by name at the digest it lists.
|
||||
rpc ListCatalogue(ListCatalogueRequest) returns (ListCatalogueResponse);
|
||||
rpc InstallFromCatalogue(InstallFromCatalogueRequest) returns (InstallFromCatalogueResponse);
|
||||
rpc GetInstalledPackage(GetInstalledPackageRequest) returns (GetInstalledPackageResponse);
|
||||
rpc ListInstalledPackages(ListInstalledPackagesRequest) returns (ListInstalledPackagesResponse);
|
||||
// AcceptPackageAuthority records the operator's accepted authority against
|
||||
// the pinned digest (the approve action; install is the create action).
|
||||
// Administrative until org-scoped principals land.
|
||||
rpc AcceptPackageAuthority(AcceptPackageAuthorityRequest) returns (AcceptPackageAuthorityResponse);
|
||||
rpc RemoveInstalledPackage(RemoveInstalledPackageRequest) returns (RemoveInstalledPackageResponse);
|
||||
// UpdatePackage moves a package to the digest the verified catalogue lists:
|
||||
// a non-widening update applies, a widening one waits as pending.
|
||||
// ApprovePackageUpdate applies the pending update and accepts its authority;
|
||||
// RollbackPackage restores the previous digest and its accepted authority.
|
||||
rpc UpdatePackage(UpdatePackageRequest) returns (UpdatePackageResponse);
|
||||
rpc ApprovePackageUpdate(ApprovePackageUpdateRequest) returns (ApprovePackageUpdateResponse);
|
||||
rpc RollbackPackage(RollbackPackageRequest) returns (RollbackPackageResponse);
|
||||
// SetPackageUpdatePolicy sets "manual" or "auto"; the State Store updates
|
||||
// auto packages on a timer.
|
||||
rpc SetPackageUpdatePolicy(SetPackageUpdatePolicyRequest) returns (SetPackageUpdatePolicyResponse);
|
||||
}
|
||||
|
||||
message InstalledPackage {
|
||||
string org_id = 1;
|
||||
string name = 2;
|
||||
string reference = 3;
|
||||
string digest = 4;
|
||||
bytes descriptor_json = 5;
|
||||
bytes layer = 6;
|
||||
string update_policy = 7;
|
||||
// The operator's accepted authority, recorded against the pinned digest.
|
||||
// Absent until the operator accepts (docs/prds/store.md, "Authority").
|
||||
PackageAuthority accepted_authority = 8;
|
||||
// An update waiting for approval of widened authority; the live pin above
|
||||
// is unchanged until then.
|
||||
PackagePin pending = 9;
|
||||
// The pin the last update or rollback replaced, with the authority accepted
|
||||
// against it.
|
||||
PackagePin previous = 10;
|
||||
PackageAuthority previous_accepted_authority = 11;
|
||||
// What the pending update declares.
|
||||
PackageAuthority pending_authority = 12;
|
||||
}
|
||||
message PackagePin {
|
||||
string reference = 1;
|
||||
string digest = 2;
|
||||
}
|
||||
// PackageAuthority mirrors storepkg.Authority: the grants a package needs to
|
||||
// operate. An acceptance record is an upper bound, checked field by field.
|
||||
message PackageAuthority {
|
||||
repeated string credential_services = 1;
|
||||
repeated string egress_hosts = 2;
|
||||
repeated string forge_permissions = 3;
|
||||
repeated string triggers = 4;
|
||||
repeated string tools = 5;
|
||||
repeated string env = 6;
|
||||
}
|
||||
// Package and denial requests act in the org the State Store derives from the
|
||||
// caller's principal, else the default org.
|
||||
message InstallPackageRequest {
|
||||
reserved 1;
|
||||
reserved "org_id";
|
||||
string name = 2;
|
||||
string reference = 3;
|
||||
string digest = 4;
|
||||
}
|
||||
message InstallPackageResponse { InstalledPackage package = 1; }
|
||||
message CatalogueEntry {
|
||||
string name = 1;
|
||||
string surface = 2;
|
||||
string version = 3;
|
||||
string description = 4;
|
||||
string reference = 5;
|
||||
string digest = 6;
|
||||
}
|
||||
message ListCatalogueRequest {}
|
||||
message ListCatalogueResponse { repeated CatalogueEntry packages = 1; }
|
||||
message InstallFromCatalogueRequest { string name = 1; }
|
||||
message InstallFromCatalogueResponse { InstalledPackage package = 1; }
|
||||
message GetInstalledPackageRequest {
|
||||
reserved 1;
|
||||
reserved "org_id";
|
||||
string name = 2;
|
||||
}
|
||||
message GetInstalledPackageResponse { InstalledPackage package = 1; }
|
||||
message ListInstalledPackagesRequest {
|
||||
reserved 1;
|
||||
reserved "org_id";
|
||||
}
|
||||
message ListInstalledPackagesResponse { repeated InstalledPackage packages = 1; }
|
||||
message AcceptPackageAuthorityRequest {
|
||||
reserved 1;
|
||||
reserved "org_id";
|
||||
string name = 2;
|
||||
PackageAuthority accepted = 3;
|
||||
}
|
||||
message AcceptPackageAuthorityResponse { InstalledPackage package = 1; }
|
||||
message RemoveInstalledPackageRequest {
|
||||
reserved 1;
|
||||
reserved "org_id";
|
||||
string name = 2;
|
||||
}
|
||||
message RemoveInstalledPackageResponse {}
|
||||
message UpdatePackageRequest { string name = 1; }
|
||||
message UpdatePackageResponse { InstalledPackage package = 1; }
|
||||
message ApprovePackageUpdateRequest { string name = 1; }
|
||||
message ApprovePackageUpdateResponse { InstalledPackage package = 1; }
|
||||
message RollbackPackageRequest { string name = 1; }
|
||||
message RollbackPackageResponse { InstalledPackage package = 1; }
|
||||
message SetPackageUpdatePolicyRequest {
|
||||
string name = 1;
|
||||
string policy = 2;
|
||||
}
|
||||
message SetPackageUpdatePolicyResponse { InstalledPackage package = 1; }
|
||||
@@ -0,0 +1,50 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
service ReviewService {
|
||||
// RespondReviewGate is the operator's answer to the review gate
|
||||
// (docs/prds/pr-review-operator-response.md, Decision 2): one guarded
|
||||
// requeue that records the answer, increments rereview_rounds for a
|
||||
// re-review, and refuses a re-review past cap with the ErrRereviewCapReached
|
||||
// wire sentinel. Admin-only, like every other operator surface: a
|
||||
// task-scoped grant never reaches it.
|
||||
rpc RespondReviewGate(RespondReviewGateRequest) returns (RespondReviewGateResponse);
|
||||
rpc BeginRemediation(BeginRemediationRequest) returns (BeginRemediationResponse);
|
||||
rpc UpdateReviewPayload(UpdateReviewPayloadRequest) returns (UpdateReviewPayloadResponse);
|
||||
rpc SetReviewCursors(SetReviewCursorsRequest) returns (SetReviewCursorsResponse);
|
||||
}
|
||||
|
||||
message RespondReviewGateRequest {
|
||||
int64 task_id = 1;
|
||||
string from_status = 2;
|
||||
// gate is the whole review_gate document the caller computed: the offer
|
||||
// with the answer filled in. The store persists it unread.
|
||||
string gate = 3;
|
||||
// rereview increments rereview_rounds in the same write; an approve must
|
||||
// pass false and bumps nothing.
|
||||
bool rereview = 4;
|
||||
// cap is the domain's re-review bound (prreview.MaxRereviewRounds). It
|
||||
// crosses so the guard is enforced where the row is locked rather than by
|
||||
// the caller's stale read.
|
||||
int64 cap = 5;
|
||||
}
|
||||
message RespondReviewGateResponse {}
|
||||
message BeginRemediationRequest {
|
||||
int64 task_id = 1;
|
||||
string payload = 2;
|
||||
}
|
||||
message BeginRemediationResponse {}
|
||||
// UpdateReviewPayloadRequest merges payload's comments into the unclaimed
|
||||
// review unit with the same review id, active or pending.
|
||||
message UpdateReviewPayloadRequest {
|
||||
int64 task_id = 1;
|
||||
string payload = 2;
|
||||
}
|
||||
message UpdateReviewPayloadResponse {}
|
||||
message SetReviewCursorsRequest {
|
||||
int64 task_id = 1;
|
||||
int64 review_cursor = 2;
|
||||
int64 comment_cursor = 3;
|
||||
}
|
||||
message SetReviewCursorsResponse {}
|
||||
@@ -0,0 +1,65 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// Sources: the capture endpoint and its signing setting. Secrets travel in
|
||||
// plaintext; the store encrypts at rest.
|
||||
service SourceService {
|
||||
rpc InsertSource(InsertSourceRequest) returns (InsertSourceResponse);
|
||||
rpc GetSource(GetSourceRequest) returns (GetSourceResponse);
|
||||
rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse);
|
||||
rpc SetSourceSigning(SetSourceSigningRequest) returns (SetSourceSigningResponse);
|
||||
rpc SetSourceSecret(SetSourceSecretRequest) returns (SetSourceSecretResponse);
|
||||
rpc SetSourceName(SetSourceNameRequest) returns (SetSourceNameResponse);
|
||||
rpc SetSourceDeliveryHeader(SetSourceDeliveryHeaderRequest) returns (SetSourceDeliveryHeaderResponse);
|
||||
rpc DeleteSource(DeleteSourceRequest) returns (DeleteSourceResponse);
|
||||
}
|
||||
|
||||
// Source mirrors internal/domain/source.Source.
|
||||
message Source {
|
||||
string path = 1;
|
||||
string signing = 2;
|
||||
string secret = 3;
|
||||
google.protobuf.Timestamp created_at = 4;
|
||||
google.protobuf.Timestamp updated_at = 5;
|
||||
string name = 6;
|
||||
string delivery_header = 7;
|
||||
// org_id is the source's owning org, read-only here. workspace_id is the
|
||||
// org's workspace it is created in, the default one when empty.
|
||||
string org_id = 8;
|
||||
string workspace_id = 9;
|
||||
}
|
||||
message SetSourceNameRequest {
|
||||
string path = 1;
|
||||
string name = 2;
|
||||
}
|
||||
message SetSourceNameResponse {}
|
||||
message SetSourceDeliveryHeaderRequest {
|
||||
string path = 1;
|
||||
string header = 2;
|
||||
}
|
||||
message SetSourceDeliveryHeaderResponse {}
|
||||
message DeleteSourceRequest { string path = 1; }
|
||||
message DeleteSourceResponse {}
|
||||
message InsertSourceRequest { Source source = 1; }
|
||||
message InsertSourceResponse {}
|
||||
message GetSourceRequest { string path = 1; }
|
||||
message GetSourceResponse {
|
||||
Source source = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message ListSourcesRequest {}
|
||||
message ListSourcesResponse { repeated Source sources = 1; }
|
||||
message SetSourceSigningRequest {
|
||||
string path = 1;
|
||||
string from = 2;
|
||||
string to = 3;
|
||||
}
|
||||
message SetSourceSigningResponse {}
|
||||
message SetSourceSecretRequest {
|
||||
string path = 1;
|
||||
string secret = 2;
|
||||
}
|
||||
message SetSourceSecretResponse {}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
service StatsService {
|
||||
rpc StatusCounts(StatusCountsRequest) returns (StatusCountsResponse);
|
||||
rpc WorkflowStats(WorkflowStatsRequest) returns (WorkflowStatsResponse);
|
||||
rpc StageStats(StageStatsRequest) returns (StageStatsResponse);
|
||||
rpc TokensByDay(TokensByDayRequest) returns (TokensByDayResponse);
|
||||
}
|
||||
|
||||
// WorkflowStat mirrors storecontract.WorkflowStat.
|
||||
message WorkflowStat {
|
||||
string workflow = 1;
|
||||
int64 runs = 2;
|
||||
int64 merged = 3;
|
||||
int64 pr_open = 4;
|
||||
int64 parked = 5;
|
||||
int64 avg_tokens = 6;
|
||||
double avg_steps = 7;
|
||||
int64 total_tokens = 8;
|
||||
int64 completed = 9;
|
||||
}
|
||||
// StageStat mirrors storecontract.StageStat.
|
||||
message StageStat {
|
||||
string workflow = 1;
|
||||
string stage = 2;
|
||||
int64 runs = 3;
|
||||
int64 avg_ms = 4;
|
||||
int64 errors = 5;
|
||||
}
|
||||
// DayTokens mirrors storecontract.DayTokens.
|
||||
message DayTokens {
|
||||
string day = 1;
|
||||
int64 tokens = 2;
|
||||
}
|
||||
message StatusCountsRequest {}
|
||||
message StatusCountsResponse { map<string, int64> counts = 1; }
|
||||
message WorkflowStatsRequest {}
|
||||
message WorkflowStatsResponse { repeated WorkflowStat stats = 1; }
|
||||
message StageStatsRequest {}
|
||||
message StageStatsResponse { repeated StageStat stats = 1; }
|
||||
message TokensByDayRequest { int64 days = 1; }
|
||||
message TokensByDayResponse { repeated DayTokens tokens = 1; }
|
||||
@@ -0,0 +1,115 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "logging/v1/logging.proto";
|
||||
|
||||
service StatusService {
|
||||
rpc RecentLogs(RecentLogsRequest) returns (RecentLogsResponse);
|
||||
// Configuration snapshot: the running configuration as the dashboard
|
||||
// renders it, published by the owner of configuration for the process that
|
||||
// displays it. PutConfigSnapshot is administrative; GetConfigSnapshot is
|
||||
// the UI's read (docs/architecture/migration-decisions.md, "Dashboard
|
||||
// configuration page").
|
||||
rpc PutConfigSnapshot(PutConfigSnapshotRequest) returns (PutConfigSnapshotResponse);
|
||||
rpc GetConfigSnapshot(GetConfigSnapshotRequest) returns (GetConfigSnapshotResponse);
|
||||
// Channel status is what the process HOSTING the channels observes about them:
|
||||
// one row per channel, written by the Messaging Service and read by the UI
|
||||
// process. Administrative like the config snapshot, and for the same reason --
|
||||
// a task-scoped grant reaches neither, so authorizesTaskScopedCall admits only
|
||||
// the administrative token. It is runtime state rather than a settings
|
||||
// document, which is why it is not a ControlPlaneService resource kind.
|
||||
rpc PutChannelStatus(PutChannelStatusRequest) returns (PutChannelStatusResponse);
|
||||
rpc ListChannelStatus(ListChannelStatusRequest) returns (ListChannelStatusResponse);
|
||||
// Apply status: which version of a control-plane resource each process is
|
||||
// running, and why it could not. Every process that applies a resource
|
||||
// publishes; the UI process reads (docs/prds/control-plane-apply-status.md).
|
||||
// Both are administrative.
|
||||
rpc PutApplyStatus(PutApplyStatusRequest) returns (PutApplyStatusResponse);
|
||||
rpc ListApplyStatus(ListApplyStatusRequest) returns (ListApplyStatusResponse);
|
||||
// Presence: every running service instance re-stamps one record, so a
|
||||
// record past the staleness window means that instance is down.
|
||||
// Administrative.
|
||||
rpc PutPresence(PutPresenceRequest) returns (PutPresenceResponse);
|
||||
rpc ListPresence(ListPresenceRequest) returns (ListPresenceResponse);
|
||||
}
|
||||
|
||||
// ConfigSnapshot carries the dashboard's configuration projection. document
|
||||
// is opaque to the store: its shape belongs to the producer and the page that
|
||||
// reads it, and schema names that shape so a reader can refuse one it does
|
||||
// not understand. It is secret-free at the producer -- the projection carries
|
||||
// an API key's environment variable name and whether it resolved, never a
|
||||
// value.
|
||||
message ConfigSnapshot {
|
||||
string schema = 1;
|
||||
bytes document = 2;
|
||||
google.protobuf.Timestamp published_at = 3;
|
||||
}
|
||||
message PutConfigSnapshotRequest { ConfigSnapshot snapshot = 1; }
|
||||
message PutConfigSnapshotResponse {}
|
||||
message GetConfigSnapshotRequest {}
|
||||
message GetConfigSnapshotResponse {
|
||||
ConfigSnapshot snapshot = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
// ChannelStatus is one channel's runtime state, as the process hosting it
|
||||
// observes it. ReloadSupported is a capability declaration, not a request: the
|
||||
// service reports it, so a reader may offer a reload action -- but asking for one
|
||||
// travels on its own surface, because a transient request and a durable state do
|
||||
// not share a lifetime.
|
||||
message ChannelStatus {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string state = 3;
|
||||
string detail = 4;
|
||||
bool configured = 5;
|
||||
bool reload_supported = 6;
|
||||
google.protobuf.Timestamp observed_at = 7;
|
||||
}
|
||||
message PutChannelStatusRequest { repeated ChannelStatus channels = 1; }
|
||||
message PutChannelStatusResponse {}
|
||||
message ListChannelStatusRequest {}
|
||||
message ListChannelStatusResponse { repeated ChannelStatus channels = 1; }
|
||||
// ApplyStatus is one process's report about one control-plane resource kind.
|
||||
// applied_version is the version that process is running; error is set when it
|
||||
// could not apply what the store returned, and leaves applied_version at the
|
||||
// last version it did apply. reported_at is re-stamped on an interval, so a
|
||||
// record older than the staleness window belongs to a process that has stopped
|
||||
// running (docs/prds/control-plane-apply-status.md).
|
||||
message ApplyStatus {
|
||||
string process = 1;
|
||||
string kind = 2;
|
||||
int64 applied_version = 3;
|
||||
string error = 4;
|
||||
google.protobuf.Timestamp reported_at = 5;
|
||||
}
|
||||
message PutApplyStatusRequest { ApplyStatus status = 1; }
|
||||
message PutApplyStatusResponse {}
|
||||
message ListApplyStatusRequest {}
|
||||
message ListApplyStatusResponse { repeated ApplyStatus statuses = 1; }
|
||||
// Presence is one running service instance. ready and detail summarise its
|
||||
// readiness probes; detail names the degraded ones.
|
||||
message DependencyCheck {
|
||||
string name = 1;
|
||||
string status = 2;
|
||||
bool ready = 3;
|
||||
string detail = 4;
|
||||
}
|
||||
message Presence {
|
||||
string service = 1;
|
||||
string instance_id = 2;
|
||||
string version = 3;
|
||||
string install_type = 4;
|
||||
google.protobuf.Timestamp started_at = 5;
|
||||
google.protobuf.Timestamp reported_at = 6;
|
||||
bool ready = 7;
|
||||
string detail = 8;
|
||||
repeated DependencyCheck checks = 9;
|
||||
}
|
||||
message PutPresenceRequest { Presence presence = 1; }
|
||||
message PutPresenceResponse {}
|
||||
message ListPresenceRequest {}
|
||||
message ListPresenceResponse { repeated Presence presences = 1; }
|
||||
message RecentLogsRequest { logging.v1.LogQuery query = 1; }
|
||||
message RecentLogsResponse { logging.v1.LogSnapshot snapshot = 1; }
|
||||
@@ -0,0 +1,239 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "state/v1/types.proto";
|
||||
|
||||
service TaskService {
|
||||
rpc EnqueueIssue(EnqueueIssueRequest) returns (EnqueueIssueResponse);
|
||||
rpc EnqueueChatTask(EnqueueChatTaskRequest) returns (EnqueueChatTaskResponse);
|
||||
rpc ActiveTasksByOrigin(ActiveTasksByOriginRequest) returns (ActiveTasksByOriginResponse);
|
||||
// UnpostedOutcomes lists finished chat tasks whose outcome has not yet been
|
||||
// posted to their conversation; MarkOutcomePosted records that it was.
|
||||
rpc UnpostedOutcomes(UnpostedOutcomesRequest) returns (UnpostedOutcomesResponse);
|
||||
rpc MarkOutcomePosted(MarkOutcomePostedRequest) returns (MarkOutcomePostedResponse);
|
||||
rpc ClaimNext(ClaimNextRequest) returns (ClaimNextResponse);
|
||||
rpc ClaimByIssue(ClaimByIssueRequest) returns (ClaimByIssueResponse);
|
||||
rpc Transition(TransitionRequest) returns (TransitionResponse);
|
||||
rpc Update(UpdateRequest) returns (UpdateResponse);
|
||||
// TaskModels answers what a task's models resolve against: the aliases its
|
||||
// org may use and the org's own providers. The org is the task's, never
|
||||
// the caller's.
|
||||
rpc TaskModels(TaskModelsRequest) returns (TaskModelsResponse);
|
||||
// TaskInstructions answers the instance and organisation instructions a
|
||||
// task's agent runs follow. Organisation is empty for a system-org task.
|
||||
rpc TaskInstructions(TaskInstructionsRequest) returns (TaskInstructionsResponse);
|
||||
rpc Requeue(RequeueRequest) returns (RequeueResponse);
|
||||
rpc ParkTask(ParkTaskRequest) returns (ParkTaskResponse);
|
||||
rpc RecoverStale(RecoverStaleRequest) returns (RecoverStaleResponse);
|
||||
rpc ArchiveTask(ArchiveTaskRequest) returns (ArchiveTaskResponse);
|
||||
rpc RetryTask(RetryTaskRequest) returns (RetryTaskResponse);
|
||||
rpc TaskByIssue(TaskByIssueRequest) returns (TaskByIssueResponse);
|
||||
rpc OpenTaskByPR(OpenTaskByPRRequest) returns (OpenTaskByPRResponse);
|
||||
rpc TaskByID(TaskByIDRequest) returns (TaskByIDResponse);
|
||||
rpc OpenPRs(OpenPRsRequest) returns (OpenPRsResponse);
|
||||
rpc ClearTerminalTasks(ClearTerminalTasksRequest) returns (ClearTerminalTasksResponse);
|
||||
rpc Tasks(TasksRequest) returns (TasksResponse);
|
||||
// WorkflowCaller: a workflow.call step starts its callee and, with
|
||||
// wait:true, reads it back while waiting. Both are the one sanctioned
|
||||
// widening of a task-scoped grant -- the callee is the caller's child
|
||||
// (docs/prds/workflow-calls.md). CallStatus re-checks the parent-child
|
||||
// relation server-side, so the grant only names the caller.
|
||||
rpc EnqueueCallTask(EnqueueCallTaskRequest) returns (EnqueueCallTaskResponse);
|
||||
rpc WorkflowCallStatus(WorkflowCallStatusRequest) returns (WorkflowCallStatusResponse);
|
||||
}
|
||||
|
||||
message EnqueueIssueRequest {
|
||||
string owner = 1;
|
||||
string repo = 2;
|
||||
int64 number = 3;
|
||||
string title = 4;
|
||||
string body = 5;
|
||||
string labels = 6;
|
||||
string identity = 7;
|
||||
}
|
||||
message EnqueueIssueResponse { bool inserted = 1; }
|
||||
message ActiveTasksByOriginRequest { string origin = 1; }
|
||||
message ActiveTasksByOriginResponse { repeated Task tasks = 1; }
|
||||
message UnpostedOutcomesRequest {}
|
||||
message UnpostedOutcomesResponse { repeated Task tasks = 1; }
|
||||
message MarkOutcomePostedRequest {
|
||||
int64 task_id = 1;
|
||||
// status is the task status whose state was posted.
|
||||
string status = 2;
|
||||
}
|
||||
message MarkOutcomePostedResponse {}
|
||||
message EnqueueChatTaskRequest {
|
||||
string owner = 1;
|
||||
string repo = 2;
|
||||
string title = 3;
|
||||
string body = 4;
|
||||
string workflow = 5;
|
||||
string identity = 6;
|
||||
// inputs_json assigns workflow inputs, a JSON object of the same form
|
||||
// EnqueueBindingTaskRequest carries. A chat task sets them at insert
|
||||
// time: it has no binding provenance to stamp afterwards.
|
||||
string inputs_json = 7;
|
||||
// origin names the conversation that created the task; empty for none.
|
||||
string origin = 8;
|
||||
// draft_yaml, when set, makes the task a test run of that unsaved
|
||||
// definition: it is pinned to it and writes nothing to a forge.
|
||||
string draft_yaml = 9;
|
||||
}
|
||||
message EnqueueChatTaskResponse { Task task = 1; }
|
||||
message ClaimNextRequest {}
|
||||
message ClaimNextResponse {
|
||||
Task task = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message ClaimByIssueRequest {
|
||||
string owner = 1;
|
||||
string repo = 2;
|
||||
int64 number = 3;
|
||||
}
|
||||
message ClaimByIssueResponse {
|
||||
Task task = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message TransitionRequest {
|
||||
int64 task_id = 1;
|
||||
string from = 2;
|
||||
string to = 3;
|
||||
string detail = 4;
|
||||
}
|
||||
message TransitionResponse {}
|
||||
message UpdateRequest { Task task = 1; }
|
||||
message UpdateResponse {}
|
||||
message RequeueRequest {
|
||||
int64 task_id = 1;
|
||||
string from_status = 2;
|
||||
string workflow = 3;
|
||||
}
|
||||
message RequeueResponse {}
|
||||
message ParkTaskRequest {
|
||||
int64 task_id = 1;
|
||||
string from = 2;
|
||||
string detail = 3;
|
||||
string class = 4;
|
||||
string blocker = 5;
|
||||
}
|
||||
message ParkTaskResponse {}
|
||||
message RecoverStaleRequest {}
|
||||
message RecoverStaleResponse { int64 count = 1; }
|
||||
message ArchiveTaskRequest {
|
||||
int64 task_id = 1;
|
||||
string from_status = 2;
|
||||
Event audit = 3;
|
||||
}
|
||||
message ArchiveTaskResponse { int64 event_id = 1; }
|
||||
message RetryTaskRequest {
|
||||
int64 task_id = 1;
|
||||
string from_status = 2;
|
||||
string workflow = 3;
|
||||
// retry_mode is the operator's worktree choice (taskstate.RetryMode) the
|
||||
// requeue persists. Empty reads as refresh_onto_base.
|
||||
string retry_mode = 4;
|
||||
// resume_from is the stage the attempt starts at, and resume_after the
|
||||
// stage before it whose recorded results it starts with (task.Resume).
|
||||
string resume_from = 5;
|
||||
string resume_after = 6;
|
||||
// current_definition clears the pinned definition so the next dispatch
|
||||
// pins the workflow's current stored version.
|
||||
bool current_definition = 7;
|
||||
}
|
||||
message RetryTaskResponse {}
|
||||
message TaskByIssueRequest {
|
||||
string owner = 1;
|
||||
string repo = 2;
|
||||
int64 number = 3;
|
||||
}
|
||||
message TaskByIssueResponse {
|
||||
Task task = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message OpenTaskByPRRequest {
|
||||
string owner = 1;
|
||||
string repo = 2;
|
||||
int64 number = 3;
|
||||
}
|
||||
message OpenTaskByPRResponse {
|
||||
Task task = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message TaskByIDRequest { int64 task_id = 1; }
|
||||
message TaskByIDResponse {
|
||||
Task task = 1;
|
||||
bool found = 2;
|
||||
}
|
||||
message OpenPRsRequest {}
|
||||
message OpenPRsResponse { repeated Task tasks = 1; }
|
||||
message ClearTerminalTasksRequest {}
|
||||
message ClearTerminalTasksResponse { int64 count = 1; }
|
||||
// TasksRequest selects one page of tasks, most recently updated first. Empty
|
||||
// statuses matches every status; after_id 0 starts at the newest task.
|
||||
message TasksRequest {
|
||||
int64 limit = 1;
|
||||
repeated string statuses = 2;
|
||||
google.protobuf.Timestamp after_updated_at = 3;
|
||||
int64 after_id = 4;
|
||||
// workflow, when set, keeps only that workflow's tasks.
|
||||
string workflow = 5;
|
||||
}
|
||||
message TasksResponse { repeated Task tasks = 1; }
|
||||
// workflow.call: the caller's grant names the caller; the store derives the
|
||||
// rest from the caller's row (docs/prds/workflow-calls.md).
|
||||
message EnqueueCallTaskRequest {
|
||||
int64 caller_task_id = 1;
|
||||
string workflow = 2;
|
||||
string inputs_json = 3;
|
||||
// call_key is the call site's durable identity: the call step's declared
|
||||
// path within the run, plus the workflow it starts (so one task running a
|
||||
// second definition at a colliding path does not reuse the first callee's
|
||||
// child). The store stamps it on the child and, when the caller already
|
||||
// started a child under it, returns that child instead of starting a second
|
||||
// one. Required: a retry of one call site carries the same key, so the retry
|
||||
// cannot duplicate the child's work.
|
||||
string call_key = 4;
|
||||
}
|
||||
message EnqueueCallTaskResponse {
|
||||
Task task = 1;
|
||||
bool accepted = 2;
|
||||
}
|
||||
message WorkflowCallStatusRequest {
|
||||
int64 caller_task_id = 1;
|
||||
int64 call_task_id = 2;
|
||||
}
|
||||
message WorkflowCallStatusResponse {
|
||||
// status is the callee's task status and detail its latest transition
|
||||
// detail (empty before the callee first moves). outputs_json is the
|
||||
// callee's written outputs (task.EncodeOutputs), so a wait:true caller can
|
||||
// publish one as its own (docs/prds/workflow-call-outputs.md, "Storage and
|
||||
// wire").
|
||||
string status = 1;
|
||||
string detail = 2;
|
||||
string outputs_json = 3;
|
||||
}
|
||||
message TaskModelsRequest { int64 task_id = 1; }
|
||||
message TaskInstructionsRequest { int64 task_id = 1; }
|
||||
message TaskInstructionsResponse {
|
||||
string instance = 1;
|
||||
string organisation = 2;
|
||||
}
|
||||
message TaskModelsResponse {
|
||||
string org_id = 1;
|
||||
map<string, string> aliases = 2;
|
||||
map<string, ModelProvider> providers = 3;
|
||||
}
|
||||
// ModelProvider is an org's own provider. Its key is the org's credential
|
||||
// binding named after it.
|
||||
message ModelProvider {
|
||||
string class = 1;
|
||||
string base_url = 2;
|
||||
string api_key_env = 3;
|
||||
// The provider's credential reference: where its key lives, never the key
|
||||
// itself. A daemon resolves a model egress credential from it; without it
|
||||
// every provider arrives credential-less and no runtime can be built.
|
||||
string api_key_engine = 4;
|
||||
string api_key_key = 5;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "state/v1/types.proto";
|
||||
|
||||
service TaskEventService {
|
||||
rpc InsertEvent(InsertEventRequest) returns (InsertEventResponse);
|
||||
rpc EventsSince(EventsSinceRequest) returns (EventsSinceResponse);
|
||||
rpc TaskEvents(TaskEventsRequest) returns (TaskEventsResponse);
|
||||
}
|
||||
|
||||
message InsertEventRequest { Event event = 1; }
|
||||
message InsertEventResponse { int64 id = 1; }
|
||||
message EventsSinceRequest {
|
||||
// since_id is the opaque resume cursor returned by the previous page (the SSE
|
||||
// id: field, echoed back as Last-Event-ID). Empty means "from the
|
||||
// beginning". The field keeps its name and number so the wire name stays
|
||||
// put; only its type widened, from the SQLite rowid to the fixed-width
|
||||
// "<at>|<row id>" cursor.
|
||||
string since_id = 1;
|
||||
int64 limit = 2;
|
||||
}
|
||||
message EventsSinceResponse { repeated Event events = 1; }
|
||||
message TaskEventsRequest { int64 task_id = 1; }
|
||||
message TaskEventsResponse { repeated Event events = 1; }
|
||||
@@ -0,0 +1,31 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
// Administrative task credential lifecycle. Worker credentials cannot call these.
|
||||
service TaskGrantService {
|
||||
rpc RegisterTaskGrant(RegisterTaskGrantRequest) returns (RegisterTaskGrantResponse);
|
||||
rpc RevokeTaskGrant(RevokeTaskGrantRequest) returns (RevokeTaskGrantResponse);
|
||||
rpc ResolveTaskGrant(ResolveTaskGrantRequest) returns (ResolveTaskGrantResponse);
|
||||
}
|
||||
|
||||
message RegisterTaskGrantRequest {
|
||||
int64 task_id = 1;
|
||||
string token = 2;
|
||||
int64 lifetime_seconds = 3;
|
||||
}
|
||||
message RegisterTaskGrantResponse {}
|
||||
message RevokeTaskGrantRequest {
|
||||
string token = 1;
|
||||
}
|
||||
message RevokeTaskGrantResponse {}
|
||||
// ResolveTaskGrantRequest names a run credential; the response is the task
|
||||
// it was issued for.
|
||||
message ResolveTaskGrantRequest { string token = 1; }
|
||||
message ResolveTaskGrantResponse {
|
||||
int64 task_id = 1;
|
||||
// Canonical execution identity; empty names the instance root RPC route.
|
||||
string execution_identity = 2;
|
||||
// Canonical principal, including the instance root.
|
||||
string principal_id = 3;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// One task attempt's persisted log. Task log files live in the state
|
||||
// directory this process owns, so the dashboard reads them over this contract
|
||||
// rather than opening them itself
|
||||
// (deployments/README.md).
|
||||
service TaskLogService {
|
||||
rpc ReadTaskLog(ReadTaskLogRequest) returns (ReadTaskLogResponse);
|
||||
// StreamTaskLogContent returns one attempt's log verbatim, one chunk per
|
||||
// message, for a download. A log file is unbounded input (it rotates at
|
||||
// DefaultMaxSizeMB), so a unary response would exceed gRPC's 4MiB message
|
||||
// cap on a real log -- the same reason ListCaptures was superseded by
|
||||
// StreamCaptures.
|
||||
rpc StreamTaskLogContent(StreamTaskLogContentRequest) returns (stream StreamTaskLogContentResponse);
|
||||
}
|
||||
|
||||
// TaskLogEntry mirrors internal/logging.Entry: one decoded log line. fields
|
||||
// carries every remaining key as a JSON object string, the same way Event
|
||||
// carries its data, so structured context survives the hop without this
|
||||
// contract having to know what a call site attached.
|
||||
message TaskLogEntry {
|
||||
int64 id = 1;
|
||||
google.protobuf.Timestamp time = 2;
|
||||
string level = 3;
|
||||
string msg = 4;
|
||||
string fields_json = 5;
|
||||
}
|
||||
// ReadTaskLog returns a page of one task attempt's decoded log. attempt is the
|
||||
// attempt the caller resolved (the dashboard sends the task's current attempt
|
||||
// when the request omitted one). levels, component, contains, since and until
|
||||
// carry the whole query the logging package's Tail accepts -- the wire mirrors
|
||||
// that query rather than a subset of it, so a filter cannot silently stop
|
||||
// working by crossing the boundary. limit is caller-capped
|
||||
// (docs/prds/state-store-contract.md §8: the log cap is 2000).
|
||||
message ReadTaskLogRequest {
|
||||
int64 task_id = 1;
|
||||
int64 attempt = 2;
|
||||
int64 limit = 3;
|
||||
repeated string levels = 4;
|
||||
string component = 5;
|
||||
string contains = 6;
|
||||
google.protobuf.Timestamp since = 7;
|
||||
google.protobuf.Timestamp until = 8;
|
||||
// stage filters on an entry's own "stage" field. Only entries a stage
|
||||
// tagged carry one -- agent and tool output is logged without a stage, so a
|
||||
// stage filter narrows the file rather than covering it. Empty means any.
|
||||
string stage = 9;
|
||||
// before_id is the byte-offset cursor a previous page returned as cursor: the
|
||||
// read returns the most recent matching entries ending at or before it. Zero
|
||||
// reads the tail, which is the page the dashboard opens on.
|
||||
int64 before_id = 10;
|
||||
}
|
||||
// found=false is not an error: the task has no log file for that attempt.
|
||||
// That is a different condition from a process that cannot read logs at all
|
||||
// (codes.Unavailable), and the dashboard reports them differently.
|
||||
message ReadTaskLogResponse {
|
||||
repeated TaskLogEntry entries = 1;
|
||||
bool truncated = 2;
|
||||
int64 attempt = 3;
|
||||
bool found = 4;
|
||||
repeated string components = 5;
|
||||
// file is the path read, so the page can name where the log came from. It
|
||||
// is the state directory's own layout, reported to an already-authenticated
|
||||
// operator; no caller is expected to open it.
|
||||
string file = 6;
|
||||
// more_available reports matching entries did not fit in this page; cursor
|
||||
// is the before_id for the next older one. truncated is separate: it means
|
||||
// the log is larger than the readable scan window, so its oldest entries
|
||||
// cannot be reached by paging at all.
|
||||
bool more_available = 7;
|
||||
int64 cursor = 8;
|
||||
}
|
||||
// StreamTaskLogContent returns one attempt's log verbatim, for a download. The
|
||||
// bytes are the file's own JSONL, not a re-encoding of it: this contract
|
||||
// transports the log, it does not restate the format. found=false, with no
|
||||
// chunks, means the attempt has no log file -- not an error.
|
||||
message StreamTaskLogContentRequest {
|
||||
int64 task_id = 1;
|
||||
int64 attempt = 2;
|
||||
}
|
||||
message StreamTaskLogContentResponse {
|
||||
bytes chunk = 1;
|
||||
int64 attempt = 2;
|
||||
bool found = 3;
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package state.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
message Identity {
|
||||
string id = 1;
|
||||
string kind = 2;
|
||||
string display_name = 3;
|
||||
string lifecycle = 4;
|
||||
int64 version = 5;
|
||||
google.protobuf.Timestamp created_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
// Task mirrors internal/domain/workflow.Task.
|
||||
message Task {
|
||||
int64 id = 1;
|
||||
string owner = 2;
|
||||
string repo = 3;
|
||||
int64 issue_number = 4;
|
||||
string title = 5;
|
||||
string body = 6;
|
||||
string labels = 7;
|
||||
string status = 8;
|
||||
string workflow = 9;
|
||||
// Retired: the per-task "current stage" column was overwritten as
|
||||
// workflow.Run advanced and carried no history. step_executions is the
|
||||
// durable per-step record now (docs/prds/execution-tree-state-machine.md);
|
||||
// ListSteps is its read.
|
||||
string stage = 10 [deprecated = true];
|
||||
string branch = 11;
|
||||
string plan = 12;
|
||||
string notes = 13;
|
||||
int64 pr_number = 14;
|
||||
int64 tokens_used = 15;
|
||||
int64 iterations = 16;
|
||||
int64 attempt = 17;
|
||||
string park_reason = 18;
|
||||
int64 retry_count = 19;
|
||||
int64 watch_comment_id = 20;
|
||||
string source = 21;
|
||||
string identity = 22;
|
||||
string binding_id = 23;
|
||||
int64 binding_version = 24;
|
||||
google.protobuf.Timestamp created_at = 25;
|
||||
google.protobuf.Timestamp updated_at = 26;
|
||||
// review_payload is the JSON-encoded review unit the remediate workflow's
|
||||
// current run must address (docs/prds/pr-review-remediation.md decision 4).
|
||||
string review_payload = 27;
|
||||
// The workflow pin: the exact definition version this run started with.
|
||||
// It has to cross the wire for the daemon's digest guard to hold, because
|
||||
// a retry reads the task back over this contract before deciding whether
|
||||
// to reuse the pinned YAML (docs/prds/runtime-control-plane.md:95).
|
||||
int64 workflow_definition_version = 28;
|
||||
string workflow_definition_digest = 29;
|
||||
string workflow_definition_yaml = 30;
|
||||
// review_cursor is the poll backstop's high-water mark over forge review
|
||||
// IDs for this task. It is separate from watch_comment_id (the review-
|
||||
// comment cursor) because the two forge sequences are independent; one
|
||||
// combined cursor would silently skip reviews once a larger comment ID
|
||||
// landed (docs/prds/pr-review-remediation.md decision 2).
|
||||
int64 review_cursor = 31;
|
||||
// park_class is the producer-recorded answer to "what kind of
|
||||
// intervention does this park need?" (taskstate.ParkClass:
|
||||
// needs_decision, transient, terminal). Store-side normalization makes
|
||||
// empty and unknown values needs_decision, so the class is advisory on
|
||||
// the wire and authoritative only as recorded at the park site.
|
||||
string park_class = 32;
|
||||
// remediation_rounds counts review-triggered remediation rounds
|
||||
// separately from retry_count, so an operator's manual retries no
|
||||
// longer draw down the review-remediation budget (and vice versa).
|
||||
int32 remediation_rounds = 33;
|
||||
// inputs_json is the JSON object of workflow inputs a binding dispatch
|
||||
// resolved (task.EncodeInputs); empty for a task no binding started.
|
||||
string inputs_json = 34;
|
||||
// org is the org the task belongs to, derived store-side from the task's
|
||||
// identity when the row is written; a task of a single-operator install
|
||||
// belongs to the default org (docs/prds/orgs-and-access.md).
|
||||
string org = 35;
|
||||
// The workflow.call linkage (docs/prds/workflow-calls.md): the task whose
|
||||
// workflow.call step started this one (0 on a root run) and how many
|
||||
// call hops this row is from that root. Columns default, so an older
|
||||
// writer reads as a depth-0 root run.
|
||||
int64 call_parent_task_id = 36;
|
||||
int32 call_depth = 37;
|
||||
// outputs_json is the JSON object of declared-output values this run wrote
|
||||
// (task.EncodeOutputs), empty for a run that wrote none. The container's
|
||||
// Update sends the whole row, so a column the message cannot carry is a
|
||||
// column that write drops (docs/prds/workflow-call-outputs.md, "Storage and
|
||||
// wire").
|
||||
string outputs_json = 38;
|
||||
// review_gate is the operator-approval gate's whole conversation with the
|
||||
// operator (docs/prds/pr-review-operator-response.md): the offer the gate
|
||||
// wrote before waiting, and the answer the response path filled in. It is
|
||||
// opaque here -- internal/domain/workflow/prreview owns the encoding -- but
|
||||
// it must cross so the dashboard can render the offer and the resumed run
|
||||
// can read the answer.
|
||||
string review_gate = 39;
|
||||
// rereview_rounds counts granted operator re-reviews, capped by
|
||||
// prreview.MaxRereviewRounds in the guarded response write. It is separate
|
||||
// from retry_count and remediation_rounds for the same reason those are
|
||||
// separate from each other.
|
||||
int64 rereview_rounds = 40;
|
||||
// retry_mode is the operator's worktree choice for the next dispatch
|
||||
// (taskstate.RetryMode: refresh_onto_base, continue_pushed_work). The retry
|
||||
// action writes it and the daemon's prepareWorkspace reads it, so it must
|
||||
// cross the wire for a retry to land on the source the operator chose. The
|
||||
// empty string reads as refresh_onto_base.
|
||||
string retry_mode = 41;
|
||||
// resume_from is the stage the next attempt starts at; empty runs every
|
||||
// stage. resume_results are the step results (JSON) it starts with.
|
||||
string resume_from = 42;
|
||||
bytes resume_results = 43;
|
||||
// origin names the conversation that created the task; empty for none.
|
||||
string origin = 44;
|
||||
// workspace is the workspace of its org the task belongs to; read-only
|
||||
// here.
|
||||
string workspace = 45;
|
||||
// binding_signature and binding_addr are the signature result and address
|
||||
// of the captured event that started a binding task.
|
||||
string binding_signature = 46;
|
||||
string binding_addr = 47;
|
||||
// park_blocker names what a parked task is missing (taskstate.Blocker),
|
||||
// recorded at the park site; empty when the park has no known fix.
|
||||
string park_blocker = 48;
|
||||
reserved 49;
|
||||
reserved "plan_view";
|
||||
// plan_document is the structured plan (JSON) plan was rendered from.
|
||||
string plan_document = 50;
|
||||
}
|
||||
// Event mirrors internal/events.Event. Data is carried as a JSON object
|
||||
// string (matching the store's own on-disk representation) rather than
|
||||
// google.protobuf.Struct, to stay a direct mirror of the existing column.
|
||||
message Event {
|
||||
int64 id = 1;
|
||||
google.protobuf.Timestamp at = 2;
|
||||
string kind = 3;
|
||||
int64 task_id = 4;
|
||||
string repo = 5;
|
||||
int64 issue = 6;
|
||||
string workflow = 7;
|
||||
string stage = 8;
|
||||
// attempt is the run this event belongs to. Zero means UNATTRIBUTED, not a
|
||||
// first attempt: rows written before the field existed, and the deliberately
|
||||
// task-agnostic producers, all carry zero. A reader must report those as
|
||||
// unattributable rather than presenting them as one run.
|
||||
int64 attempt = 11;
|
||||
string detail = 9;
|
||||
string data_json = 10;
|
||||
// Attribution. actor_id is the identity that performed the action and
|
||||
// actor_kind its kind, so a reader can tell an agent's action from a person's
|
||||
// without resolving the identity. principal_id is the identity whose authority
|
||||
// the action used, which is a different fact when an agent acts under a
|
||||
// person's standing approval; empty means unattributed. All three must cross
|
||||
// this boundary: a record whose attribution survives only in `detail` is not
|
||||
// queryable, which is the attribution this design exists to replace.
|
||||
string actor_id = 12;
|
||||
string actor_kind = 13;
|
||||
string principal_id = 14;
|
||||
}
|
||||
Reference in new issue
Block a user