Migrate module path from kyle/ to mc/ org
All import paths updated to git.wntrmute.dev/mc/. Bumps mcdsl to v1.2.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ go test ./internal/server -run TestPushManifest
|
|||||||
## Tech Stack
|
## Tech Stack
|
||||||
|
|
||||||
- **Language:** Go 1.25+, `CGO_ENABLED=0`, statically linked
|
- **Language:** Go 1.25+, `CGO_ENABLED=0`, statically linked
|
||||||
- **Module path:** `git.wntrmute.dev/kyle/mcr`
|
- **Module path:** `git.wntrmute.dev/mc/mcr`
|
||||||
- **Database:** SQLite via `modernc.org/sqlite` (pure-Go, no CGo)
|
- **Database:** SQLite via `modernc.org/sqlite` (pure-Go, no CGo)
|
||||||
- **Config:** TOML via `go-toml/v2`, env overrides via `MCR_*`
|
- **Config:** TOML via `go-toml/v2`, env overrides via `MCR_*`
|
||||||
- **APIs:** REST (chi) + gRPC (protobuf), kept in sync
|
- **APIs:** REST (chi) + gRPC (protobuf), kept in sync
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -24,8 +24,8 @@ lint:
|
|||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
|
|
||||||
proto:
|
proto:
|
||||||
protoc --go_out=. --go_opt=module=git.wntrmute.dev/kyle/mcr \
|
protoc --go_out=. --go_opt=module=git.wntrmute.dev/mc/mcr \
|
||||||
--go-grpc_out=. --go-grpc_opt=module=git.wntrmute.dev/kyle/mcr \
|
--go-grpc_out=. --go-grpc_opt=module=git.wntrmute.dev/mc/mcr \
|
||||||
proto/mcr/v1/*.proto
|
proto/mcr/v1/*.proto
|
||||||
|
|
||||||
proto-lint:
|
proto-lint:
|
||||||
|
|||||||
@@ -712,7 +712,7 @@ Lint fix:
|
|||||||
entry points with cobra subcommands.
|
entry points with cobra subcommands.
|
||||||
|
|
||||||
**Changes:**
|
**Changes:**
|
||||||
- `go.mod`: module `git.wntrmute.dev/kyle/mcr`, Go 1.25, cobra dependency
|
- `go.mod`: module `git.wntrmute.dev/mc/mcr`, Go 1.25, cobra dependency
|
||||||
- Directory skeleton: `cmd/mcrsrv/`, `cmd/mcr-web/`, `cmd/mcrctl/`,
|
- Directory skeleton: `cmd/mcrsrv/`, `cmd/mcr-web/`, `cmd/mcrctl/`,
|
||||||
`internal/`, `proto/mcr/v1/`, `gen/mcr/v1/`, `web/templates/`,
|
`internal/`, `proto/mcr/v1/`, `gen/mcr/v1/`, `web/templates/`,
|
||||||
`web/static/`, `deploy/docker/`, `deploy/examples/`, `deploy/scripts/`,
|
`web/static/`, `deploy/docker/`, `deploy/examples/`, `deploy/scripts/`,
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ produces a project that builds and lints cleanly with no functionality.
|
|||||||
### Step 0.1: Go module and directory structure
|
### Step 0.1: Go module and directory structure
|
||||||
|
|
||||||
**Acceptance criteria:**
|
**Acceptance criteria:**
|
||||||
- `go.mod` initialized with module path `git.wntrmute.dev/kyle/mcr`
|
- `go.mod` initialized with module path `git.wntrmute.dev/mc/mcr`
|
||||||
- Directory skeleton created per `ARCHITECTURE.md` §13:
|
- Directory skeleton created per `ARCHITECTURE.md` §13:
|
||||||
`cmd/mcrsrv/`, `cmd/mcr-web/`, `cmd/mcrctl/`, `internal/`, `proto/mcr/v1/`,
|
`cmd/mcrsrv/`, `cmd/mcr-web/`, `cmd/mcrctl/`, `internal/`, `proto/mcr/v1/`,
|
||||||
`gen/mcr/v1/`, `web/`, `deploy/`
|
`gen/mcr/v1/`, `web/`, `deploy/`
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials"
|
"google.golang.org/grpc/credentials"
|
||||||
|
|
||||||
mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/config"
|
"git.wntrmute.dev/mc/mcr/internal/config"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/webserver"
|
"git.wntrmute.dev/mc/mcr/internal/webserver"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "dev"
|
var version = "dev"
|
||||||
@@ -170,6 +170,7 @@ func runServer(configPath string) error {
|
|||||||
func dialGRPC(cfg *config.Config) (*grpc.ClientConn, error) {
|
func dialGRPC(cfg *config.Config) (*grpc.ClientConn, error) {
|
||||||
tlsCfg := &tls.Config{
|
tlsCfg := &tls.Config{
|
||||||
MinVersion: tls.VersionTLS13,
|
MinVersion: tls.VersionTLS13,
|
||||||
|
ServerName: cfg.Web.TLSServerName,
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.Web.CACert != "" {
|
if cfg.Web.CACert != "" {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials"
|
"google.golang.org/grpc/credentials"
|
||||||
|
|
||||||
mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// apiClient wraps both REST and gRPC transports. When grpcAddr is set
|
// apiClient wraps both REST and gRPC transports. When grpcAddr is set
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "dev"
|
var version = "dev"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func purgeCmd() *cobra.Command {
|
func purgeCmd() *cobra.Command {
|
||||||
|
|||||||
@@ -16,17 +16,17 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/config"
|
"git.wntrmute.dev/mc/mcr/internal/config"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/gc"
|
"git.wntrmute.dev/mc/mcr/internal/gc"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/oci"
|
"git.wntrmute.dev/mc/mcr/internal/oci"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/server"
|
"git.wntrmute.dev/mc/mcr/internal/server"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/storage"
|
"git.wntrmute.dev/mc/mcr/internal/storage"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/grpcserver"
|
"git.wntrmute.dev/mc/mcr/internal/grpcserver"
|
||||||
mcdsldb "git.wntrmute.dev/kyle/mcdsl/db"
|
mcdsldb "git.wntrmute.dev/mc/mcdsl/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "dev"
|
var version = "dev"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ tags = ["env:restricted"]
|
|||||||
[web]
|
[web]
|
||||||
listen_addr = "127.0.0.1:8080" # Web UI listen address
|
listen_addr = "127.0.0.1:8080" # Web UI listen address
|
||||||
grpc_addr = "127.0.0.1:9443" # mcrsrv gRPC address for the web UI
|
grpc_addr = "127.0.0.1:9443" # mcrsrv gRPC address for the web UI
|
||||||
|
tls_server_name = "" # Override TLS server name (when dial address differs from cert SAN)
|
||||||
ca_cert = "" # CA cert for verifying mcrsrv gRPC TLS
|
ca_cert = "" # CA cert for verifying mcrsrv gRPC TLS
|
||||||
|
|
||||||
[log]
|
[log]
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ service_token = "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL21jaW
|
|||||||
|
|
||||||
[web]
|
[web]
|
||||||
listen_addr = ":8080"
|
listen_addr = ":8080"
|
||||||
grpc_addr = "mcr:9443"
|
grpc_addr = "mcr-api:9443"
|
||||||
|
tls_server_name = "mcr.svc.mcp.metacircular.net"
|
||||||
ca_cert = "/srv/mcr/certs/ca.pem"
|
ca_cert = "/srv/mcr/certs/ca.pem"
|
||||||
|
|
||||||
[log]
|
[log]
|
||||||
|
|||||||
@@ -1,14 +1,97 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.36.11
|
||||||
|
// protoc v6.32.1
|
||||||
// source: mcr/v1/admin.proto
|
// source: mcr/v1/admin.proto
|
||||||
|
|
||||||
package mcrv1
|
package mcrv1
|
||||||
|
|
||||||
// HealthRequest is the request message for Health.
|
import (
|
||||||
type HealthRequest struct{}
|
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 HealthRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *HealthRequest) Reset() {
|
||||||
|
*x = HealthRequest{}
|
||||||
|
mi := &file_mcr_v1_admin_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *HealthRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*HealthRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *HealthRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_admin_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 HealthRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*HealthRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_admin_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
// HealthResponse is the response message for Health.
|
|
||||||
type HealthResponse struct {
|
type HealthResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
|
Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *HealthResponse) Reset() {
|
||||||
|
*x = HealthResponse{}
|
||||||
|
mi := &file_mcr_v1_admin_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *HealthResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*HealthResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *HealthResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_admin_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 HealthResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*HealthResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_admin_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *HealthResponse) GetStatus() string {
|
func (x *HealthResponse) GetStatus() string {
|
||||||
@@ -17,3 +100,65 @@ func (x *HealthResponse) GetStatus() string {
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var File_mcr_v1_admin_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
const file_mcr_v1_admin_proto_rawDesc = "" +
|
||||||
|
"\n" +
|
||||||
|
"\x12mcr/v1/admin.proto\x12\x06mcr.v1\"\x0f\n" +
|
||||||
|
"\rHealthRequest\"(\n" +
|
||||||
|
"\x0eHealthResponse\x12\x16\n" +
|
||||||
|
"\x06status\x18\x01 \x01(\tR\x06status2G\n" +
|
||||||
|
"\fAdminService\x127\n" +
|
||||||
|
"\x06Health\x12\x15.mcr.v1.HealthRequest\x1a\x16.mcr.v1.HealthResponseB,Z*git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1b\x06proto3"
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_mcr_v1_admin_proto_rawDescOnce sync.Once
|
||||||
|
file_mcr_v1_admin_proto_rawDescData []byte
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_mcr_v1_admin_proto_rawDescGZIP() []byte {
|
||||||
|
file_mcr_v1_admin_proto_rawDescOnce.Do(func() {
|
||||||
|
file_mcr_v1_admin_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mcr_v1_admin_proto_rawDesc), len(file_mcr_v1_admin_proto_rawDesc)))
|
||||||
|
})
|
||||||
|
return file_mcr_v1_admin_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_mcr_v1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_mcr_v1_admin_proto_goTypes = []any{
|
||||||
|
(*HealthRequest)(nil), // 0: mcr.v1.HealthRequest
|
||||||
|
(*HealthResponse)(nil), // 1: mcr.v1.HealthResponse
|
||||||
|
}
|
||||||
|
var file_mcr_v1_admin_proto_depIdxs = []int32{
|
||||||
|
0, // 0: mcr.v1.AdminService.Health:input_type -> mcr.v1.HealthRequest
|
||||||
|
1, // 1: mcr.v1.AdminService.Health:output_type -> mcr.v1.HealthResponse
|
||||||
|
1, // [1:2] is the sub-list for method output_type
|
||||||
|
0, // [0:1] 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_mcr_v1_admin_proto_init() }
|
||||||
|
func file_mcr_v1_admin_proto_init() {
|
||||||
|
if File_mcr_v1_admin_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mcr_v1_admin_proto_rawDesc), len(file_mcr_v1_admin_proto_rawDesc)),
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_mcr_v1_admin_proto_goTypes,
|
||||||
|
DependencyIndexes: file_mcr_v1_admin_proto_depIdxs,
|
||||||
|
MessageInfos: file_mcr_v1_admin_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_mcr_v1_admin_proto = out.File
|
||||||
|
file_mcr_v1_admin_proto_goTypes = nil
|
||||||
|
file_mcr_v1_admin_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,38 +1,92 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.6.1
|
||||||
|
// - protoc v6.32.1
|
||||||
// source: mcr/v1/admin.proto
|
// source: mcr/v1/admin.proto
|
||||||
|
|
||||||
package mcrv1
|
package mcrv1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
"google.golang.org/grpc"
|
codes "google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/codes"
|
status "google.golang.org/grpc/status"
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AdminServiceServer is the server API for AdminService.
|
// 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 (
|
||||||
|
AdminService_Health_FullMethodName = "/mcr.v1.AdminService/Health"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AdminServiceClient is the client API for AdminService 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 AdminServiceClient interface {
|
||||||
|
Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type adminServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient {
|
||||||
|
return &adminServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *adminServiceClient) Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(HealthResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AdminService_Health_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AdminServiceServer is the server API for AdminService service.
|
||||||
|
// All implementations must embed UnimplementedAdminServiceServer
|
||||||
|
// for forward compatibility.
|
||||||
type AdminServiceServer interface {
|
type AdminServiceServer interface {
|
||||||
Health(context.Context, *HealthRequest) (*HealthResponse, error)
|
Health(context.Context, *HealthRequest) (*HealthResponse, error)
|
||||||
mustEmbedUnimplementedAdminServiceServer()
|
mustEmbedUnimplementedAdminServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedAdminServiceServer should be embedded to have forward
|
// UnimplementedAdminServiceServer must be embedded to have
|
||||||
// compatible implementations.
|
// forward compatible implementations.
|
||||||
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
type UnimplementedAdminServiceServer struct{}
|
type UnimplementedAdminServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedAdminServiceServer) Health(context.Context, *HealthRequest) (*HealthResponse, error) {
|
func (UnimplementedAdminServiceServer) Health(context.Context, *HealthRequest) (*HealthResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Health not implemented")
|
return nil, status.Error(codes.Unimplemented, "method Health not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {}
|
||||||
|
func (UnimplementedAdminServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
|
// UnsafeAdminServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to AdminServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeAdminServiceServer interface {
|
||||||
|
mustEmbedUnimplementedAdminServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {}
|
|
||||||
|
|
||||||
// RegisterAdminServiceServer registers the AdminServiceServer with the grpc.Server.
|
|
||||||
func RegisterAdminServiceServer(s grpc.ServiceRegistrar, srv AdminServiceServer) {
|
func RegisterAdminServiceServer(s grpc.ServiceRegistrar, srv AdminServiceServer) {
|
||||||
|
// If the following call panics, it indicates UnimplementedAdminServiceServer 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(&AdminService_ServiceDesc, srv)
|
s.RegisterService(&AdminService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func adminServiceHealthHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
func _AdminService_Health_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(HealthRequest)
|
in := new(HealthRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -42,47 +96,26 @@ func adminServiceHealthHandler(srv any, ctx context.Context, dec func(any) error
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/mcr.v1.AdminService/Health",
|
FullMethod: AdminService_Health_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req any) (any, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(AdminServiceServer).Health(ctx, req.(*HealthRequest))
|
return srv.(AdminServiceServer).Health(ctx, req.(*HealthRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService.
|
// AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
var AdminService_ServiceDesc = grpc.ServiceDesc{
|
var AdminService_ServiceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "mcr.v1.AdminService",
|
ServiceName: "mcr.v1.AdminService",
|
||||||
HandlerType: (*AdminServiceServer)(nil),
|
HandlerType: (*AdminServiceServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
{
|
||||||
MethodName: "Health",
|
MethodName: "Health",
|
||||||
Handler: adminServiceHealthHandler,
|
Handler: _AdminService_Health_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "mcr/v1/admin.proto",
|
Metadata: "mcr/v1/admin.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdminServiceClient is the client API for AdminService.
|
|
||||||
type AdminServiceClient interface {
|
|
||||||
Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type adminServiceClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAdminServiceClient creates a new AdminServiceClient.
|
|
||||||
func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient {
|
|
||||||
return &adminServiceClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *adminServiceClient) Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) {
|
|
||||||
out := new(HealthResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/mcr.v1.AdminService/Health", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,18 +1,68 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.36.11
|
||||||
|
// protoc v6.32.1
|
||||||
// source: mcr/v1/audit.proto
|
// source: mcr/v1/audit.proto
|
||||||
|
|
||||||
package mcrv1
|
package mcrv1
|
||||||
|
|
||||||
// AuditEvent represents an audit log entry.
|
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 AuditEvent struct {
|
type AuditEvent struct {
|
||||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
EventTime string `protobuf:"bytes,2,opt,name=event_time,json=eventTime,proto3" json:"event_time,omitempty"`
|
EventTime string `protobuf:"bytes,2,opt,name=event_time,json=eventTime,proto3" json:"event_time,omitempty"`
|
||||||
EventType string `protobuf:"bytes,3,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
|
EventType string `protobuf:"bytes,3,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
|
||||||
ActorId string `protobuf:"bytes,4,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` //nolint:revive,stylecheck // proto field name
|
ActorId string `protobuf:"bytes,4,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
|
||||||
Repository string `protobuf:"bytes,5,opt,name=repository,proto3" json:"repository,omitempty"`
|
Repository string `protobuf:"bytes,5,opt,name=repository,proto3" json:"repository,omitempty"`
|
||||||
Digest string `protobuf:"bytes,6,opt,name=digest,proto3" json:"digest,omitempty"`
|
Digest string `protobuf:"bytes,6,opt,name=digest,proto3" json:"digest,omitempty"`
|
||||||
IpAddress string `protobuf:"bytes,7,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` //nolint:revive,stylecheck // proto field name
|
IpAddress string `protobuf:"bytes,7,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
|
||||||
Details map[string]string `protobuf:"bytes,8,rep,name=details,proto3" json:"details,omitempty"`
|
Details map[string]string `protobuf:"bytes,8,rep,name=details,proto3" json:"details,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AuditEvent) Reset() {
|
||||||
|
*x = AuditEvent{}
|
||||||
|
mi := &file_mcr_v1_audit_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *AuditEvent) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*AuditEvent) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *AuditEvent) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_audit_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 AuditEvent.ProtoReflect.Descriptor instead.
|
||||||
|
func (*AuditEvent) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_audit_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *AuditEvent) GetId() int64 {
|
func (x *AuditEvent) GetId() int64 {
|
||||||
@@ -71,14 +121,46 @@ func (x *AuditEvent) GetDetails() map[string]string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListAuditEventsRequest is the request message for ListAuditEvents.
|
|
||||||
type ListAuditEventsRequest struct {
|
type ListAuditEventsRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||||
EventType string `protobuf:"bytes,2,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
|
EventType string `protobuf:"bytes,2,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
|
||||||
ActorId string `protobuf:"bytes,3,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` //nolint:revive,stylecheck // proto field name
|
ActorId string `protobuf:"bytes,3,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
|
||||||
Repository string `protobuf:"bytes,4,opt,name=repository,proto3" json:"repository,omitempty"`
|
Repository string `protobuf:"bytes,4,opt,name=repository,proto3" json:"repository,omitempty"`
|
||||||
Since string `protobuf:"bytes,5,opt,name=since,proto3" json:"since,omitempty"`
|
Since string `protobuf:"bytes,5,opt,name=since,proto3" json:"since,omitempty"`
|
||||||
Until string `protobuf:"bytes,6,opt,name=until,proto3" json:"until,omitempty"`
|
Until string `protobuf:"bytes,6,opt,name=until,proto3" json:"until,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListAuditEventsRequest) Reset() {
|
||||||
|
*x = ListAuditEventsRequest{}
|
||||||
|
mi := &file_mcr_v1_audit_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListAuditEventsRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListAuditEventsRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListAuditEventsRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_audit_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 ListAuditEventsRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListAuditEventsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_audit_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListAuditEventsRequest) GetPagination() *PaginationRequest {
|
func (x *ListAuditEventsRequest) GetPagination() *PaginationRequest {
|
||||||
@@ -123,9 +205,41 @@ func (x *ListAuditEventsRequest) GetUntil() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListAuditEventsResponse is the response message for ListAuditEvents.
|
|
||||||
type ListAuditEventsResponse struct {
|
type ListAuditEventsResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Events []*AuditEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
|
Events []*AuditEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListAuditEventsResponse) Reset() {
|
||||||
|
*x = ListAuditEventsResponse{}
|
||||||
|
mi := &file_mcr_v1_audit_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListAuditEventsResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListAuditEventsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListAuditEventsResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_audit_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 ListAuditEventsResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListAuditEventsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_audit_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListAuditEventsResponse) GetEvents() []*AuditEvent {
|
func (x *ListAuditEventsResponse) GetEvents() []*AuditEvent {
|
||||||
@@ -134,3 +248,101 @@ func (x *ListAuditEventsResponse) GetEvents() []*AuditEvent {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var File_mcr_v1_audit_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
const file_mcr_v1_audit_proto_rawDesc = "" +
|
||||||
|
"\n" +
|
||||||
|
"\x12mcr/v1/audit.proto\x12\x06mcr.v1\x1a\x13mcr/v1/common.proto\"\xc3\x02\n" +
|
||||||
|
"\n" +
|
||||||
|
"AuditEvent\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"event_time\x18\x02 \x01(\tR\teventTime\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"event_type\x18\x03 \x01(\tR\teventType\x12\x19\n" +
|
||||||
|
"\bactor_id\x18\x04 \x01(\tR\aactorId\x12\x1e\n" +
|
||||||
|
"\n" +
|
||||||
|
"repository\x18\x05 \x01(\tR\n" +
|
||||||
|
"repository\x12\x16\n" +
|
||||||
|
"\x06digest\x18\x06 \x01(\tR\x06digest\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"ip_address\x18\a \x01(\tR\tipAddress\x129\n" +
|
||||||
|
"\adetails\x18\b \x03(\v2\x1f.mcr.v1.AuditEvent.DetailsEntryR\adetails\x1a:\n" +
|
||||||
|
"\fDetailsEntry\x12\x10\n" +
|
||||||
|
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||||
|
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd9\x01\n" +
|
||||||
|
"\x16ListAuditEventsRequest\x129\n" +
|
||||||
|
"\n" +
|
||||||
|
"pagination\x18\x01 \x01(\v2\x19.mcr.v1.PaginationRequestR\n" +
|
||||||
|
"pagination\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"event_type\x18\x02 \x01(\tR\teventType\x12\x19\n" +
|
||||||
|
"\bactor_id\x18\x03 \x01(\tR\aactorId\x12\x1e\n" +
|
||||||
|
"\n" +
|
||||||
|
"repository\x18\x04 \x01(\tR\n" +
|
||||||
|
"repository\x12\x14\n" +
|
||||||
|
"\x05since\x18\x05 \x01(\tR\x05since\x12\x14\n" +
|
||||||
|
"\x05until\x18\x06 \x01(\tR\x05until\"E\n" +
|
||||||
|
"\x17ListAuditEventsResponse\x12*\n" +
|
||||||
|
"\x06events\x18\x01 \x03(\v2\x12.mcr.v1.AuditEventR\x06events2b\n" +
|
||||||
|
"\fAuditService\x12R\n" +
|
||||||
|
"\x0fListAuditEvents\x12\x1e.mcr.v1.ListAuditEventsRequest\x1a\x1f.mcr.v1.ListAuditEventsResponseB,Z*git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1b\x06proto3"
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_mcr_v1_audit_proto_rawDescOnce sync.Once
|
||||||
|
file_mcr_v1_audit_proto_rawDescData []byte
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_mcr_v1_audit_proto_rawDescGZIP() []byte {
|
||||||
|
file_mcr_v1_audit_proto_rawDescOnce.Do(func() {
|
||||||
|
file_mcr_v1_audit_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mcr_v1_audit_proto_rawDesc), len(file_mcr_v1_audit_proto_rawDesc)))
|
||||||
|
})
|
||||||
|
return file_mcr_v1_audit_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_mcr_v1_audit_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||||
|
var file_mcr_v1_audit_proto_goTypes = []any{
|
||||||
|
(*AuditEvent)(nil), // 0: mcr.v1.AuditEvent
|
||||||
|
(*ListAuditEventsRequest)(nil), // 1: mcr.v1.ListAuditEventsRequest
|
||||||
|
(*ListAuditEventsResponse)(nil), // 2: mcr.v1.ListAuditEventsResponse
|
||||||
|
nil, // 3: mcr.v1.AuditEvent.DetailsEntry
|
||||||
|
(*PaginationRequest)(nil), // 4: mcr.v1.PaginationRequest
|
||||||
|
}
|
||||||
|
var file_mcr_v1_audit_proto_depIdxs = []int32{
|
||||||
|
3, // 0: mcr.v1.AuditEvent.details:type_name -> mcr.v1.AuditEvent.DetailsEntry
|
||||||
|
4, // 1: mcr.v1.ListAuditEventsRequest.pagination:type_name -> mcr.v1.PaginationRequest
|
||||||
|
0, // 2: mcr.v1.ListAuditEventsResponse.events:type_name -> mcr.v1.AuditEvent
|
||||||
|
1, // 3: mcr.v1.AuditService.ListAuditEvents:input_type -> mcr.v1.ListAuditEventsRequest
|
||||||
|
2, // 4: mcr.v1.AuditService.ListAuditEvents:output_type -> mcr.v1.ListAuditEventsResponse
|
||||||
|
4, // [4:5] is the sub-list for method output_type
|
||||||
|
3, // [3:4] 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_mcr_v1_audit_proto_init() }
|
||||||
|
func file_mcr_v1_audit_proto_init() {
|
||||||
|
if File_mcr_v1_audit_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file_mcr_v1_common_proto_init()
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mcr_v1_audit_proto_rawDesc), len(file_mcr_v1_audit_proto_rawDesc)),
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 4,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_mcr_v1_audit_proto_goTypes,
|
||||||
|
DependencyIndexes: file_mcr_v1_audit_proto_depIdxs,
|
||||||
|
MessageInfos: file_mcr_v1_audit_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_mcr_v1_audit_proto = out.File
|
||||||
|
file_mcr_v1_audit_proto_goTypes = nil
|
||||||
|
file_mcr_v1_audit_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,38 +1,92 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.6.1
|
||||||
|
// - protoc v6.32.1
|
||||||
// source: mcr/v1/audit.proto
|
// source: mcr/v1/audit.proto
|
||||||
|
|
||||||
package mcrv1
|
package mcrv1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
"google.golang.org/grpc"
|
codes "google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/codes"
|
status "google.golang.org/grpc/status"
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuditServiceServer is the server API for AuditService.
|
// 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 (
|
||||||
|
AuditService_ListAuditEvents_FullMethodName = "/mcr.v1.AuditService/ListAuditEvents"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AuditServiceClient is the client API for AuditService 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 AuditServiceClient interface {
|
||||||
|
ListAuditEvents(ctx context.Context, in *ListAuditEventsRequest, opts ...grpc.CallOption) (*ListAuditEventsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type auditServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAuditServiceClient(cc grpc.ClientConnInterface) AuditServiceClient {
|
||||||
|
return &auditServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *auditServiceClient) ListAuditEvents(ctx context.Context, in *ListAuditEventsRequest, opts ...grpc.CallOption) (*ListAuditEventsResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(ListAuditEventsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AuditService_ListAuditEvents_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AuditServiceServer is the server API for AuditService service.
|
||||||
|
// All implementations must embed UnimplementedAuditServiceServer
|
||||||
|
// for forward compatibility.
|
||||||
type AuditServiceServer interface {
|
type AuditServiceServer interface {
|
||||||
ListAuditEvents(context.Context, *ListAuditEventsRequest) (*ListAuditEventsResponse, error)
|
ListAuditEvents(context.Context, *ListAuditEventsRequest) (*ListAuditEventsResponse, error)
|
||||||
mustEmbedUnimplementedAuditServiceServer()
|
mustEmbedUnimplementedAuditServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedAuditServiceServer should be embedded to have forward
|
// UnimplementedAuditServiceServer must be embedded to have
|
||||||
// compatible implementations.
|
// forward compatible implementations.
|
||||||
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
type UnimplementedAuditServiceServer struct{}
|
type UnimplementedAuditServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedAuditServiceServer) ListAuditEvents(context.Context, *ListAuditEventsRequest) (*ListAuditEventsResponse, error) {
|
func (UnimplementedAuditServiceServer) ListAuditEvents(context.Context, *ListAuditEventsRequest) (*ListAuditEventsResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ListAuditEvents not implemented")
|
return nil, status.Error(codes.Unimplemented, "method ListAuditEvents not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAuditServiceServer) mustEmbedUnimplementedAuditServiceServer() {}
|
||||||
|
func (UnimplementedAuditServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
|
// UnsafeAuditServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to AuditServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeAuditServiceServer interface {
|
||||||
|
mustEmbedUnimplementedAuditServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (UnimplementedAuditServiceServer) mustEmbedUnimplementedAuditServiceServer() {}
|
|
||||||
|
|
||||||
// RegisterAuditServiceServer registers the AuditServiceServer with the grpc.Server.
|
|
||||||
func RegisterAuditServiceServer(s grpc.ServiceRegistrar, srv AuditServiceServer) {
|
func RegisterAuditServiceServer(s grpc.ServiceRegistrar, srv AuditServiceServer) {
|
||||||
|
// If the following call panics, it indicates UnimplementedAuditServiceServer 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(&AuditService_ServiceDesc, srv)
|
s.RegisterService(&AuditService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func auditServiceListAuditEventsHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
func _AuditService_ListAuditEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(ListAuditEventsRequest)
|
in := new(ListAuditEventsRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -42,47 +96,26 @@ func auditServiceListAuditEventsHandler(srv any, ctx context.Context, dec func(a
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/mcr.v1.AuditService/ListAuditEvents",
|
FullMethod: AuditService_ListAuditEvents_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req any) (any, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(AuditServiceServer).ListAuditEvents(ctx, req.(*ListAuditEventsRequest))
|
return srv.(AuditServiceServer).ListAuditEvents(ctx, req.(*ListAuditEventsRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuditService_ServiceDesc is the grpc.ServiceDesc for AuditService.
|
// AuditService_ServiceDesc is the grpc.ServiceDesc for AuditService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
var AuditService_ServiceDesc = grpc.ServiceDesc{
|
var AuditService_ServiceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "mcr.v1.AuditService",
|
ServiceName: "mcr.v1.AuditService",
|
||||||
HandlerType: (*AuditServiceServer)(nil),
|
HandlerType: (*AuditServiceServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
{
|
||||||
MethodName: "ListAuditEvents",
|
MethodName: "ListAuditEvents",
|
||||||
Handler: auditServiceListAuditEventsHandler,
|
Handler: _AuditService_ListAuditEvents_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "mcr/v1/audit.proto",
|
Metadata: "mcr/v1/audit.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuditServiceClient is the client API for AuditService.
|
|
||||||
type AuditServiceClient interface {
|
|
||||||
ListAuditEvents(ctx context.Context, in *ListAuditEventsRequest, opts ...grpc.CallOption) (*ListAuditEventsResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type auditServiceClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAuditServiceClient creates a new AuditServiceClient.
|
|
||||||
func NewAuditServiceClient(cc grpc.ClientConnInterface) AuditServiceClient {
|
|
||||||
return &auditServiceClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *auditServiceClient) ListAuditEvents(ctx context.Context, in *ListAuditEventsRequest, opts ...grpc.CallOption) (*ListAuditEventsResponse, error) {
|
|
||||||
out := new(ListAuditEventsResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/mcr.v1.AuditService/ListAuditEvents", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,12 +1,63 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.36.11
|
||||||
|
// protoc v6.32.1
|
||||||
// source: mcr/v1/common.proto
|
// source: mcr/v1/common.proto
|
||||||
|
|
||||||
package mcrv1
|
package mcrv1
|
||||||
|
|
||||||
// PaginationRequest controls pagination for list RPCs.
|
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)
|
||||||
|
)
|
||||||
|
|
||||||
|
// Pagination controls for list RPCs.
|
||||||
type PaginationRequest struct {
|
type PaginationRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
|
Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||||
Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
|
Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PaginationRequest) Reset() {
|
||||||
|
*x = PaginationRequest{}
|
||||||
|
mi := &file_mcr_v1_common_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PaginationRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PaginationRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PaginationRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_common_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 PaginationRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PaginationRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_common_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PaginationRequest) GetLimit() int32 {
|
func (x *PaginationRequest) GetLimit() int32 {
|
||||||
@@ -22,3 +73,60 @@ func (x *PaginationRequest) GetOffset() int32 {
|
|||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var File_mcr_v1_common_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
const file_mcr_v1_common_proto_rawDesc = "" +
|
||||||
|
"\n" +
|
||||||
|
"\x13mcr/v1/common.proto\x12\x06mcr.v1\"A\n" +
|
||||||
|
"\x11PaginationRequest\x12\x14\n" +
|
||||||
|
"\x05limit\x18\x01 \x01(\x05R\x05limit\x12\x16\n" +
|
||||||
|
"\x06offset\x18\x02 \x01(\x05R\x06offsetB,Z*git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1b\x06proto3"
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_mcr_v1_common_proto_rawDescOnce sync.Once
|
||||||
|
file_mcr_v1_common_proto_rawDescData []byte
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_mcr_v1_common_proto_rawDescGZIP() []byte {
|
||||||
|
file_mcr_v1_common_proto_rawDescOnce.Do(func() {
|
||||||
|
file_mcr_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mcr_v1_common_proto_rawDesc), len(file_mcr_v1_common_proto_rawDesc)))
|
||||||
|
})
|
||||||
|
return file_mcr_v1_common_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_mcr_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_mcr_v1_common_proto_goTypes = []any{
|
||||||
|
(*PaginationRequest)(nil), // 0: mcr.v1.PaginationRequest
|
||||||
|
}
|
||||||
|
var file_mcr_v1_common_proto_depIdxs = []int32{
|
||||||
|
0, // [0:0] is the sub-list for method output_type
|
||||||
|
0, // [0:0] 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_mcr_v1_common_proto_init() }
|
||||||
|
func file_mcr_v1_common_proto_init() {
|
||||||
|
if File_mcr_v1_common_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mcr_v1_common_proto_rawDesc), len(file_mcr_v1_common_proto_rawDesc)),
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_mcr_v1_common_proto_goTypes,
|
||||||
|
DependencyIndexes: file_mcr_v1_common_proto_depIdxs,
|
||||||
|
MessageInfos: file_mcr_v1_common_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_mcr_v1_common_proto = out.File
|
||||||
|
file_mcr_v1_common_proto_goTypes = nil
|
||||||
|
file_mcr_v1_common_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,23 +1,73 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.36.11
|
||||||
|
// protoc v6.32.1
|
||||||
// source: mcr/v1/policy.proto
|
// source: mcr/v1/policy.proto
|
||||||
|
|
||||||
package mcrv1
|
package mcrv1
|
||||||
|
|
||||||
// PolicyRule represents a policy rule.
|
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 PolicyRule struct {
|
type PolicyRule struct {
|
||||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
|
Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
Effect string `protobuf:"bytes,4,opt,name=effect,proto3" json:"effect,omitempty"`
|
Effect string `protobuf:"bytes,4,opt,name=effect,proto3" json:"effect,omitempty"`
|
||||||
Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"`
|
Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"`
|
||||||
AccountTypes []string `protobuf:"bytes,6,rep,name=account_types,json=accountTypes,proto3" json:"account_types,omitempty"`
|
AccountTypes []string `protobuf:"bytes,6,rep,name=account_types,json=accountTypes,proto3" json:"account_types,omitempty"`
|
||||||
SubjectUuid string `protobuf:"bytes,7,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"` //nolint:revive,stylecheck // proto field name
|
SubjectUuid string `protobuf:"bytes,7,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"`
|
||||||
Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,omitempty"`
|
Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,omitempty"`
|
||||||
Repositories []string `protobuf:"bytes,9,rep,name=repositories,proto3" json:"repositories,omitempty"`
|
Repositories []string `protobuf:"bytes,9,rep,name=repositories,proto3" json:"repositories,omitempty"`
|
||||||
Enabled bool `protobuf:"varint,10,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
Enabled bool `protobuf:"varint,10,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||||
CreatedBy string `protobuf:"bytes,11,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"`
|
CreatedBy string `protobuf:"bytes,11,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"`
|
||||||
CreatedAt string `protobuf:"bytes,12,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
CreatedAt string `protobuf:"bytes,12,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||||
UpdatedAt string `protobuf:"bytes,13,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
UpdatedAt string `protobuf:"bytes,13,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PolicyRule) Reset() {
|
||||||
|
*x = PolicyRule{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PolicyRule) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PolicyRule) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PolicyRule) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 PolicyRule.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PolicyRule) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PolicyRule) GetId() int64 {
|
func (x *PolicyRule) GetId() int64 {
|
||||||
@@ -111,9 +161,41 @@ func (x *PolicyRule) GetUpdatedAt() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListPolicyRulesRequest is the request message for ListPolicyRules.
|
|
||||||
type ListPolicyRulesRequest struct {
|
type ListPolicyRulesRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListPolicyRulesRequest) Reset() {
|
||||||
|
*x = ListPolicyRulesRequest{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListPolicyRulesRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListPolicyRulesRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListPolicyRulesRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 ListPolicyRulesRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListPolicyRulesRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListPolicyRulesRequest) GetPagination() *PaginationRequest {
|
func (x *ListPolicyRulesRequest) GetPagination() *PaginationRequest {
|
||||||
@@ -123,9 +205,41 @@ func (x *ListPolicyRulesRequest) GetPagination() *PaginationRequest {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListPolicyRulesResponse is the response message for ListPolicyRules.
|
|
||||||
type ListPolicyRulesResponse struct {
|
type ListPolicyRulesResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Rules []*PolicyRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
|
Rules []*PolicyRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListPolicyRulesResponse) Reset() {
|
||||||
|
*x = ListPolicyRulesResponse{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListPolicyRulesResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListPolicyRulesResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListPolicyRulesResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 ListPolicyRulesResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListPolicyRulesResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ListPolicyRulesResponse) GetRules() []*PolicyRule {
|
func (x *ListPolicyRulesResponse) GetRules() []*PolicyRule {
|
||||||
@@ -135,17 +249,49 @@ func (x *ListPolicyRulesResponse) GetRules() []*PolicyRule {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreatePolicyRuleRequest is the request message for CreatePolicyRule.
|
|
||||||
type CreatePolicyRuleRequest struct {
|
type CreatePolicyRuleRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Priority int32 `protobuf:"varint,1,opt,name=priority,proto3" json:"priority,omitempty"`
|
Priority int32 `protobuf:"varint,1,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
Effect string `protobuf:"bytes,3,opt,name=effect,proto3" json:"effect,omitempty"`
|
Effect string `protobuf:"bytes,3,opt,name=effect,proto3" json:"effect,omitempty"`
|
||||||
Roles []string `protobuf:"bytes,4,rep,name=roles,proto3" json:"roles,omitempty"`
|
Roles []string `protobuf:"bytes,4,rep,name=roles,proto3" json:"roles,omitempty"`
|
||||||
AccountTypes []string `protobuf:"bytes,5,rep,name=account_types,json=accountTypes,proto3" json:"account_types,omitempty"`
|
AccountTypes []string `protobuf:"bytes,5,rep,name=account_types,json=accountTypes,proto3" json:"account_types,omitempty"`
|
||||||
SubjectUuid string `protobuf:"bytes,6,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"` //nolint:revive,stylecheck // proto field name
|
SubjectUuid string `protobuf:"bytes,6,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"`
|
||||||
Actions []string `protobuf:"bytes,7,rep,name=actions,proto3" json:"actions,omitempty"`
|
Actions []string `protobuf:"bytes,7,rep,name=actions,proto3" json:"actions,omitempty"`
|
||||||
Repositories []string `protobuf:"bytes,8,rep,name=repositories,proto3" json:"repositories,omitempty"`
|
Repositories []string `protobuf:"bytes,8,rep,name=repositories,proto3" json:"repositories,omitempty"`
|
||||||
Enabled bool `protobuf:"varint,9,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
Enabled bool `protobuf:"varint,9,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreatePolicyRuleRequest) Reset() {
|
||||||
|
*x = CreatePolicyRuleRequest{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreatePolicyRuleRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*CreatePolicyRuleRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *CreatePolicyRuleRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 CreatePolicyRuleRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*CreatePolicyRuleRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CreatePolicyRuleRequest) GetPriority() int32 {
|
func (x *CreatePolicyRuleRequest) GetPriority() int32 {
|
||||||
@@ -211,9 +357,41 @@ func (x *CreatePolicyRuleRequest) GetEnabled() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPolicyRuleRequest is the request message for GetPolicyRule.
|
|
||||||
type GetPolicyRuleRequest struct {
|
type GetPolicyRuleRequest struct {
|
||||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name
|
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 *GetPolicyRuleRequest) Reset() {
|
||||||
|
*x = GetPolicyRuleRequest{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetPolicyRuleRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetPolicyRuleRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetPolicyRuleRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 GetPolicyRuleRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetPolicyRuleRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetPolicyRuleRequest) GetId() int64 {
|
func (x *GetPolicyRuleRequest) GetId() int64 {
|
||||||
@@ -223,19 +401,52 @@ func (x *GetPolicyRuleRequest) GetId() int64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdatePolicyRuleRequest is the request message for UpdatePolicyRule.
|
|
||||||
type UpdatePolicyRuleRequest struct {
|
type UpdatePolicyRuleRequest struct {
|
||||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
|
Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||||
Effect string `protobuf:"bytes,4,opt,name=effect,proto3" json:"effect,omitempty"`
|
Effect string `protobuf:"bytes,4,opt,name=effect,proto3" json:"effect,omitempty"`
|
||||||
Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"`
|
Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"`
|
||||||
AccountTypes []string `protobuf:"bytes,6,rep,name=account_types,json=accountTypes,proto3" json:"account_types,omitempty"`
|
AccountTypes []string `protobuf:"bytes,6,rep,name=account_types,json=accountTypes,proto3" json:"account_types,omitempty"`
|
||||||
SubjectUuid string `protobuf:"bytes,7,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"` //nolint:revive,stylecheck // proto field name
|
SubjectUuid string `protobuf:"bytes,7,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"`
|
||||||
Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,omitempty"`
|
Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,omitempty"`
|
||||||
Repositories []string `protobuf:"bytes,9,rep,name=repositories,proto3" json:"repositories,omitempty"`
|
Repositories []string `protobuf:"bytes,9,rep,name=repositories,proto3" json:"repositories,omitempty"`
|
||||||
Enabled bool `protobuf:"varint,10,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
Enabled bool `protobuf:"varint,10,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||||
|
// Field mask for partial updates — only fields listed here are applied.
|
||||||
UpdateMask []string `protobuf:"bytes,11,rep,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
|
UpdateMask []string `protobuf:"bytes,11,rep,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdatePolicyRuleRequest) Reset() {
|
||||||
|
*x = UpdatePolicyRuleRequest{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[5]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdatePolicyRuleRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UpdatePolicyRuleRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *UpdatePolicyRuleRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 UpdatePolicyRuleRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*UpdatePolicyRuleRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdatePolicyRuleRequest) GetId() int64 {
|
func (x *UpdatePolicyRuleRequest) GetId() int64 {
|
||||||
@@ -315,9 +526,41 @@ func (x *UpdatePolicyRuleRequest) GetUpdateMask() []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeletePolicyRuleRequest is the request message for DeletePolicyRule.
|
|
||||||
type DeletePolicyRuleRequest struct {
|
type DeletePolicyRuleRequest struct {
|
||||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name
|
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 *DeletePolicyRuleRequest) Reset() {
|
||||||
|
*x = DeletePolicyRuleRequest{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[6]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeletePolicyRuleRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DeletePolicyRuleRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DeletePolicyRuleRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 DeletePolicyRuleRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DeletePolicyRuleRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeletePolicyRuleRequest) GetId() int64 {
|
func (x *DeletePolicyRuleRequest) GetId() int64 {
|
||||||
@@ -327,5 +570,173 @@ func (x *DeletePolicyRuleRequest) GetId() int64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeletePolicyRuleResponse is the response message for DeletePolicyRule.
|
type DeletePolicyRuleResponse struct {
|
||||||
type DeletePolicyRuleResponse struct{}
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeletePolicyRuleResponse) Reset() {
|
||||||
|
*x = DeletePolicyRuleResponse{}
|
||||||
|
mi := &file_mcr_v1_policy_proto_msgTypes[7]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeletePolicyRuleResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DeletePolicyRuleResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DeletePolicyRuleResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_mcr_v1_policy_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 DeletePolicyRuleResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DeletePolicyRuleResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_mcr_v1_policy_proto_rawDescGZIP(), []int{7}
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_mcr_v1_policy_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
const file_mcr_v1_policy_proto_rawDesc = "" +
|
||||||
|
"\n" +
|
||||||
|
"\x13mcr/v1/policy.proto\x12\x06mcr.v1\x1a\x13mcr/v1/common.proto\"\x85\x03\n" +
|
||||||
|
"\n" +
|
||||||
|
"PolicyRule\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
|
||||||
|
"\bpriority\x18\x02 \x01(\x05R\bpriority\x12 \n" +
|
||||||
|
"\vdescription\x18\x03 \x01(\tR\vdescription\x12\x16\n" +
|
||||||
|
"\x06effect\x18\x04 \x01(\tR\x06effect\x12\x14\n" +
|
||||||
|
"\x05roles\x18\x05 \x03(\tR\x05roles\x12#\n" +
|
||||||
|
"\raccount_types\x18\x06 \x03(\tR\faccountTypes\x12!\n" +
|
||||||
|
"\fsubject_uuid\x18\a \x01(\tR\vsubjectUuid\x12\x18\n" +
|
||||||
|
"\aactions\x18\b \x03(\tR\aactions\x12\"\n" +
|
||||||
|
"\frepositories\x18\t \x03(\tR\frepositories\x12\x18\n" +
|
||||||
|
"\aenabled\x18\n" +
|
||||||
|
" \x01(\bR\aenabled\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"created_by\x18\v \x01(\tR\tcreatedBy\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"created_at\x18\f \x01(\tR\tcreatedAt\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"updated_at\x18\r \x01(\tR\tupdatedAt\"S\n" +
|
||||||
|
"\x16ListPolicyRulesRequest\x129\n" +
|
||||||
|
"\n" +
|
||||||
|
"pagination\x18\x01 \x01(\v2\x19.mcr.v1.PaginationRequestR\n" +
|
||||||
|
"pagination\"C\n" +
|
||||||
|
"\x17ListPolicyRulesResponse\x12(\n" +
|
||||||
|
"\x05rules\x18\x01 \x03(\v2\x12.mcr.v1.PolicyRuleR\x05rules\"\xa5\x02\n" +
|
||||||
|
"\x17CreatePolicyRuleRequest\x12\x1a\n" +
|
||||||
|
"\bpriority\x18\x01 \x01(\x05R\bpriority\x12 \n" +
|
||||||
|
"\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" +
|
||||||
|
"\x06effect\x18\x03 \x01(\tR\x06effect\x12\x14\n" +
|
||||||
|
"\x05roles\x18\x04 \x03(\tR\x05roles\x12#\n" +
|
||||||
|
"\raccount_types\x18\x05 \x03(\tR\faccountTypes\x12!\n" +
|
||||||
|
"\fsubject_uuid\x18\x06 \x01(\tR\vsubjectUuid\x12\x18\n" +
|
||||||
|
"\aactions\x18\a \x03(\tR\aactions\x12\"\n" +
|
||||||
|
"\frepositories\x18\b \x03(\tR\frepositories\x12\x18\n" +
|
||||||
|
"\aenabled\x18\t \x01(\bR\aenabled\"&\n" +
|
||||||
|
"\x14GetPolicyRuleRequest\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x03R\x02id\"\xd6\x02\n" +
|
||||||
|
"\x17UpdatePolicyRuleRequest\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
|
||||||
|
"\bpriority\x18\x02 \x01(\x05R\bpriority\x12 \n" +
|
||||||
|
"\vdescription\x18\x03 \x01(\tR\vdescription\x12\x16\n" +
|
||||||
|
"\x06effect\x18\x04 \x01(\tR\x06effect\x12\x14\n" +
|
||||||
|
"\x05roles\x18\x05 \x03(\tR\x05roles\x12#\n" +
|
||||||
|
"\raccount_types\x18\x06 \x03(\tR\faccountTypes\x12!\n" +
|
||||||
|
"\fsubject_uuid\x18\a \x01(\tR\vsubjectUuid\x12\x18\n" +
|
||||||
|
"\aactions\x18\b \x03(\tR\aactions\x12\"\n" +
|
||||||
|
"\frepositories\x18\t \x03(\tR\frepositories\x12\x18\n" +
|
||||||
|
"\aenabled\x18\n" +
|
||||||
|
" \x01(\bR\aenabled\x12\x1f\n" +
|
||||||
|
"\vupdate_mask\x18\v \x03(\tR\n" +
|
||||||
|
"updateMask\")\n" +
|
||||||
|
"\x17DeletePolicyRuleRequest\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\x03R\x02id\"\x1a\n" +
|
||||||
|
"\x18DeletePolicyRuleResponse2\x8f\x03\n" +
|
||||||
|
"\rPolicyService\x12R\n" +
|
||||||
|
"\x0fListPolicyRules\x12\x1e.mcr.v1.ListPolicyRulesRequest\x1a\x1f.mcr.v1.ListPolicyRulesResponse\x12G\n" +
|
||||||
|
"\x10CreatePolicyRule\x12\x1f.mcr.v1.CreatePolicyRuleRequest\x1a\x12.mcr.v1.PolicyRule\x12A\n" +
|
||||||
|
"\rGetPolicyRule\x12\x1c.mcr.v1.GetPolicyRuleRequest\x1a\x12.mcr.v1.PolicyRule\x12G\n" +
|
||||||
|
"\x10UpdatePolicyRule\x12\x1f.mcr.v1.UpdatePolicyRuleRequest\x1a\x12.mcr.v1.PolicyRule\x12U\n" +
|
||||||
|
"\x10DeletePolicyRule\x12\x1f.mcr.v1.DeletePolicyRuleRequest\x1a .mcr.v1.DeletePolicyRuleResponseB,Z*git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1b\x06proto3"
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_mcr_v1_policy_proto_rawDescOnce sync.Once
|
||||||
|
file_mcr_v1_policy_proto_rawDescData []byte
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_mcr_v1_policy_proto_rawDescGZIP() []byte {
|
||||||
|
file_mcr_v1_policy_proto_rawDescOnce.Do(func() {
|
||||||
|
file_mcr_v1_policy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mcr_v1_policy_proto_rawDesc), len(file_mcr_v1_policy_proto_rawDesc)))
|
||||||
|
})
|
||||||
|
return file_mcr_v1_policy_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_mcr_v1_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||||
|
var file_mcr_v1_policy_proto_goTypes = []any{
|
||||||
|
(*PolicyRule)(nil), // 0: mcr.v1.PolicyRule
|
||||||
|
(*ListPolicyRulesRequest)(nil), // 1: mcr.v1.ListPolicyRulesRequest
|
||||||
|
(*ListPolicyRulesResponse)(nil), // 2: mcr.v1.ListPolicyRulesResponse
|
||||||
|
(*CreatePolicyRuleRequest)(nil), // 3: mcr.v1.CreatePolicyRuleRequest
|
||||||
|
(*GetPolicyRuleRequest)(nil), // 4: mcr.v1.GetPolicyRuleRequest
|
||||||
|
(*UpdatePolicyRuleRequest)(nil), // 5: mcr.v1.UpdatePolicyRuleRequest
|
||||||
|
(*DeletePolicyRuleRequest)(nil), // 6: mcr.v1.DeletePolicyRuleRequest
|
||||||
|
(*DeletePolicyRuleResponse)(nil), // 7: mcr.v1.DeletePolicyRuleResponse
|
||||||
|
(*PaginationRequest)(nil), // 8: mcr.v1.PaginationRequest
|
||||||
|
}
|
||||||
|
var file_mcr_v1_policy_proto_depIdxs = []int32{
|
||||||
|
8, // 0: mcr.v1.ListPolicyRulesRequest.pagination:type_name -> mcr.v1.PaginationRequest
|
||||||
|
0, // 1: mcr.v1.ListPolicyRulesResponse.rules:type_name -> mcr.v1.PolicyRule
|
||||||
|
1, // 2: mcr.v1.PolicyService.ListPolicyRules:input_type -> mcr.v1.ListPolicyRulesRequest
|
||||||
|
3, // 3: mcr.v1.PolicyService.CreatePolicyRule:input_type -> mcr.v1.CreatePolicyRuleRequest
|
||||||
|
4, // 4: mcr.v1.PolicyService.GetPolicyRule:input_type -> mcr.v1.GetPolicyRuleRequest
|
||||||
|
5, // 5: mcr.v1.PolicyService.UpdatePolicyRule:input_type -> mcr.v1.UpdatePolicyRuleRequest
|
||||||
|
6, // 6: mcr.v1.PolicyService.DeletePolicyRule:input_type -> mcr.v1.DeletePolicyRuleRequest
|
||||||
|
2, // 7: mcr.v1.PolicyService.ListPolicyRules:output_type -> mcr.v1.ListPolicyRulesResponse
|
||||||
|
0, // 8: mcr.v1.PolicyService.CreatePolicyRule:output_type -> mcr.v1.PolicyRule
|
||||||
|
0, // 9: mcr.v1.PolicyService.GetPolicyRule:output_type -> mcr.v1.PolicyRule
|
||||||
|
0, // 10: mcr.v1.PolicyService.UpdatePolicyRule:output_type -> mcr.v1.PolicyRule
|
||||||
|
7, // 11: mcr.v1.PolicyService.DeletePolicyRule:output_type -> mcr.v1.DeletePolicyRuleResponse
|
||||||
|
7, // [7:12] is the sub-list for method output_type
|
||||||
|
2, // [2:7] is the sub-list for method input_type
|
||||||
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
2, // [2:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:2] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_mcr_v1_policy_proto_init() }
|
||||||
|
func file_mcr_v1_policy_proto_init() {
|
||||||
|
if File_mcr_v1_policy_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file_mcr_v1_common_proto_init()
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mcr_v1_policy_proto_rawDesc), len(file_mcr_v1_policy_proto_rawDesc)),
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 8,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_mcr_v1_policy_proto_goTypes,
|
||||||
|
DependencyIndexes: file_mcr_v1_policy_proto_depIdxs,
|
||||||
|
MessageInfos: file_mcr_v1_policy_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_mcr_v1_policy_proto = out.File
|
||||||
|
file_mcr_v1_policy_proto_goTypes = nil
|
||||||
|
file_mcr_v1_policy_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,178 +1,34 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.6.1
|
||||||
|
// - protoc v6.32.1
|
||||||
// source: mcr/v1/policy.proto
|
// source: mcr/v1/policy.proto
|
||||||
|
|
||||||
package mcrv1
|
package mcrv1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
"google.golang.org/grpc"
|
codes "google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/codes"
|
status "google.golang.org/grpc/status"
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// PolicyServiceServer is the server API for PolicyService.
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
type PolicyServiceServer interface {
|
// is compatible with the grpc package it is being compiled against.
|
||||||
ListPolicyRules(context.Context, *ListPolicyRulesRequest) (*ListPolicyRulesResponse, error)
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
CreatePolicyRule(context.Context, *CreatePolicyRuleRequest) (*PolicyRule, error)
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*PolicyRule, error)
|
|
||||||
UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*PolicyRule, error)
|
|
||||||
DeletePolicyRule(context.Context, *DeletePolicyRuleRequest) (*DeletePolicyRuleResponse, error)
|
|
||||||
mustEmbedUnimplementedPolicyServiceServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedPolicyServiceServer should be embedded to have forward
|
const (
|
||||||
// compatible implementations.
|
PolicyService_ListPolicyRules_FullMethodName = "/mcr.v1.PolicyService/ListPolicyRules"
|
||||||
type UnimplementedPolicyServiceServer struct{}
|
PolicyService_CreatePolicyRule_FullMethodName = "/mcr.v1.PolicyService/CreatePolicyRule"
|
||||||
|
PolicyService_GetPolicyRule_FullMethodName = "/mcr.v1.PolicyService/GetPolicyRule"
|
||||||
|
PolicyService_UpdatePolicyRule_FullMethodName = "/mcr.v1.PolicyService/UpdatePolicyRule"
|
||||||
|
PolicyService_DeletePolicyRule_FullMethodName = "/mcr.v1.PolicyService/DeletePolicyRule"
|
||||||
|
)
|
||||||
|
|
||||||
func (UnimplementedPolicyServiceServer) ListPolicyRules(context.Context, *ListPolicyRulesRequest) (*ListPolicyRulesResponse, error) {
|
// PolicyServiceClient is the client API for PolicyService service.
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ListPolicyRules not implemented")
|
//
|
||||||
}
|
// 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.
|
||||||
|
|
||||||
func (UnimplementedPolicyServiceServer) CreatePolicyRule(context.Context, *CreatePolicyRuleRequest) (*PolicyRule, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CreatePolicyRule not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedPolicyServiceServer) GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*PolicyRule, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPolicyRule not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedPolicyServiceServer) UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*PolicyRule, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdatePolicyRule not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedPolicyServiceServer) DeletePolicyRule(context.Context, *DeletePolicyRuleRequest) (*DeletePolicyRuleResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DeletePolicyRule not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedPolicyServiceServer) mustEmbedUnimplementedPolicyServiceServer() {}
|
|
||||||
|
|
||||||
// RegisterPolicyServiceServer registers the PolicyServiceServer with the grpc.Server.
|
|
||||||
func RegisterPolicyServiceServer(s grpc.ServiceRegistrar, srv PolicyServiceServer) {
|
|
||||||
s.RegisterService(&PolicyService_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func policyServiceListPolicyRulesHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
||||||
in := new(ListPolicyRulesRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(PolicyServiceServer).ListPolicyRules(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/mcr.v1.PolicyService/ListPolicyRules",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req any) (any, error) {
|
|
||||||
return srv.(PolicyServiceServer).ListPolicyRules(ctx, req.(*ListPolicyRulesRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func policyServiceCreatePolicyRuleHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
||||||
in := new(CreatePolicyRuleRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(PolicyServiceServer).CreatePolicyRule(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/mcr.v1.PolicyService/CreatePolicyRule",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req any) (any, error) {
|
|
||||||
return srv.(PolicyServiceServer).CreatePolicyRule(ctx, req.(*CreatePolicyRuleRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func policyServiceGetPolicyRuleHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
||||||
in := new(GetPolicyRuleRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(PolicyServiceServer).GetPolicyRule(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/mcr.v1.PolicyService/GetPolicyRule",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req any) (any, error) {
|
|
||||||
return srv.(PolicyServiceServer).GetPolicyRule(ctx, req.(*GetPolicyRuleRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func policyServiceUpdatePolicyRuleHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
||||||
in := new(UpdatePolicyRuleRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(PolicyServiceServer).UpdatePolicyRule(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/mcr.v1.PolicyService/UpdatePolicyRule",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req any) (any, error) {
|
|
||||||
return srv.(PolicyServiceServer).UpdatePolicyRule(ctx, req.(*UpdatePolicyRuleRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func policyServiceDeletePolicyRuleHandler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
||||||
in := new(DeletePolicyRuleRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(PolicyServiceServer).DeletePolicyRule(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/mcr.v1.PolicyService/DeletePolicyRule",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req any) (any, error) {
|
|
||||||
return srv.(PolicyServiceServer).DeletePolicyRule(ctx, req.(*DeletePolicyRuleRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// PolicyService_ServiceDesc is the grpc.ServiceDesc for PolicyService.
|
|
||||||
var PolicyService_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "mcr.v1.PolicyService",
|
|
||||||
HandlerType: (*PolicyServiceServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "ListPolicyRules",
|
|
||||||
Handler: policyServiceListPolicyRulesHandler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "CreatePolicyRule",
|
|
||||||
Handler: policyServiceCreatePolicyRuleHandler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "GetPolicyRule",
|
|
||||||
Handler: policyServiceGetPolicyRuleHandler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "UpdatePolicyRule",
|
|
||||||
Handler: policyServiceUpdatePolicyRuleHandler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "DeletePolicyRule",
|
|
||||||
Handler: policyServiceDeletePolicyRuleHandler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "mcr/v1/policy.proto",
|
|
||||||
}
|
|
||||||
|
|
||||||
// PolicyServiceClient is the client API for PolicyService.
|
|
||||||
type PolicyServiceClient interface {
|
type PolicyServiceClient interface {
|
||||||
ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error)
|
ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error)
|
||||||
CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error)
|
CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error)
|
||||||
@@ -185,14 +41,14 @@ type policyServiceClient struct {
|
|||||||
cc grpc.ClientConnInterface
|
cc grpc.ClientConnInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPolicyServiceClient creates a new PolicyServiceClient.
|
|
||||||
func NewPolicyServiceClient(cc grpc.ClientConnInterface) PolicyServiceClient {
|
func NewPolicyServiceClient(cc grpc.ClientConnInterface) PolicyServiceClient {
|
||||||
return &policyServiceClient{cc}
|
return &policyServiceClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *policyServiceClient) ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error) {
|
func (c *policyServiceClient) ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(ListPolicyRulesResponse)
|
out := new(ListPolicyRulesResponse)
|
||||||
err := c.cc.Invoke(ctx, "/mcr.v1.PolicyService/ListPolicyRules", in, out, opts...)
|
err := c.cc.Invoke(ctx, PolicyService_ListPolicyRules_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -200,8 +56,9 @@ func (c *policyServiceClient) ListPolicyRules(ctx context.Context, in *ListPolic
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *policyServiceClient) CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) {
|
func (c *policyServiceClient) CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(PolicyRule)
|
out := new(PolicyRule)
|
||||||
err := c.cc.Invoke(ctx, "/mcr.v1.PolicyService/CreatePolicyRule", in, out, opts...)
|
err := c.cc.Invoke(ctx, PolicyService_CreatePolicyRule_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -209,8 +66,9 @@ func (c *policyServiceClient) CreatePolicyRule(ctx context.Context, in *CreatePo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *policyServiceClient) GetPolicyRule(ctx context.Context, in *GetPolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) {
|
func (c *policyServiceClient) GetPolicyRule(ctx context.Context, in *GetPolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(PolicyRule)
|
out := new(PolicyRule)
|
||||||
err := c.cc.Invoke(ctx, "/mcr.v1.PolicyService/GetPolicyRule", in, out, opts...)
|
err := c.cc.Invoke(ctx, PolicyService_GetPolicyRule_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -218,8 +76,9 @@ func (c *policyServiceClient) GetPolicyRule(ctx context.Context, in *GetPolicyRu
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *policyServiceClient) UpdatePolicyRule(ctx context.Context, in *UpdatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) {
|
func (c *policyServiceClient) UpdatePolicyRule(ctx context.Context, in *UpdatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(PolicyRule)
|
out := new(PolicyRule)
|
||||||
err := c.cc.Invoke(ctx, "/mcr.v1.PolicyService/UpdatePolicyRule", in, out, opts...)
|
err := c.cc.Invoke(ctx, PolicyService_UpdatePolicyRule_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -227,10 +86,188 @@ func (c *policyServiceClient) UpdatePolicyRule(ctx context.Context, in *UpdatePo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *policyServiceClient) DeletePolicyRule(ctx context.Context, in *DeletePolicyRuleRequest, opts ...grpc.CallOption) (*DeletePolicyRuleResponse, error) {
|
func (c *policyServiceClient) DeletePolicyRule(ctx context.Context, in *DeletePolicyRuleRequest, opts ...grpc.CallOption) (*DeletePolicyRuleResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(DeletePolicyRuleResponse)
|
out := new(DeletePolicyRuleResponse)
|
||||||
err := c.cc.Invoke(ctx, "/mcr.v1.PolicyService/DeletePolicyRule", in, out, opts...)
|
err := c.cc.Invoke(ctx, PolicyService_DeletePolicyRule_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PolicyServiceServer is the server API for PolicyService service.
|
||||||
|
// All implementations must embed UnimplementedPolicyServiceServer
|
||||||
|
// for forward compatibility.
|
||||||
|
type PolicyServiceServer interface {
|
||||||
|
ListPolicyRules(context.Context, *ListPolicyRulesRequest) (*ListPolicyRulesResponse, error)
|
||||||
|
CreatePolicyRule(context.Context, *CreatePolicyRuleRequest) (*PolicyRule, error)
|
||||||
|
GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*PolicyRule, error)
|
||||||
|
UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*PolicyRule, error)
|
||||||
|
DeletePolicyRule(context.Context, *DeletePolicyRuleRequest) (*DeletePolicyRuleResponse, error)
|
||||||
|
mustEmbedUnimplementedPolicyServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedPolicyServiceServer 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 UnimplementedPolicyServiceServer struct{}
|
||||||
|
|
||||||
|
func (UnimplementedPolicyServiceServer) ListPolicyRules(context.Context, *ListPolicyRulesRequest) (*ListPolicyRulesResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method ListPolicyRules not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedPolicyServiceServer) CreatePolicyRule(context.Context, *CreatePolicyRuleRequest) (*PolicyRule, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method CreatePolicyRule not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedPolicyServiceServer) GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*PolicyRule, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method GetPolicyRule not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedPolicyServiceServer) UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*PolicyRule, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method UpdatePolicyRule not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedPolicyServiceServer) DeletePolicyRule(context.Context, *DeletePolicyRuleRequest) (*DeletePolicyRuleResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method DeletePolicyRule not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedPolicyServiceServer) mustEmbedUnimplementedPolicyServiceServer() {}
|
||||||
|
func (UnimplementedPolicyServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
|
// UnsafePolicyServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to PolicyServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafePolicyServiceServer interface {
|
||||||
|
mustEmbedUnimplementedPolicyServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterPolicyServiceServer(s grpc.ServiceRegistrar, srv PolicyServiceServer) {
|
||||||
|
// If the following call panics, it indicates UnimplementedPolicyServiceServer 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(&PolicyService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _PolicyService_ListPolicyRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListPolicyRulesRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(PolicyServiceServer).ListPolicyRules(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: PolicyService_ListPolicyRules_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(PolicyServiceServer).ListPolicyRules(ctx, req.(*ListPolicyRulesRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _PolicyService_CreatePolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreatePolicyRuleRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(PolicyServiceServer).CreatePolicyRule(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: PolicyService_CreatePolicyRule_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(PolicyServiceServer).CreatePolicyRule(ctx, req.(*CreatePolicyRuleRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _PolicyService_GetPolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetPolicyRuleRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(PolicyServiceServer).GetPolicyRule(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: PolicyService_GetPolicyRule_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(PolicyServiceServer).GetPolicyRule(ctx, req.(*GetPolicyRuleRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _PolicyService_UpdatePolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdatePolicyRuleRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(PolicyServiceServer).UpdatePolicyRule(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: PolicyService_UpdatePolicyRule_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(PolicyServiceServer).UpdatePolicyRule(ctx, req.(*UpdatePolicyRuleRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _PolicyService_DeletePolicyRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeletePolicyRuleRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(PolicyServiceServer).DeletePolicyRule(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: PolicyService_DeletePolicyRule_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(PolicyServiceServer).DeletePolicyRule(ctx, req.(*DeletePolicyRuleRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PolicyService_ServiceDesc is the grpc.ServiceDesc for PolicyService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var PolicyService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "mcr.v1.PolicyService",
|
||||||
|
HandlerType: (*PolicyServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "ListPolicyRules",
|
||||||
|
Handler: _PolicyService_ListPolicyRules_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CreatePolicyRule",
|
||||||
|
Handler: _PolicyService_CreatePolicyRule_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetPolicyRule",
|
||||||
|
Handler: _PolicyService_GetPolicyRule_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdatePolicyRule",
|
||||||
|
Handler: _PolicyService_UpdatePolicyRule_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeletePolicyRule",
|
||||||
|
Handler: _PolicyService_DeletePolicyRule_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "mcr/v1/policy.proto",
|
||||||
|
}
|
||||||
|
|||||||
@@ -812,7 +812,7 @@ const file_mcr_v1_registry_proto_rawDesc = "" +
|
|||||||
"\rGetRepository\x12\x1c.mcr.v1.GetRepositoryRequest\x1a\x1d.mcr.v1.GetRepositoryResponse\x12U\n" +
|
"\rGetRepository\x12\x1c.mcr.v1.GetRepositoryRequest\x1a\x1d.mcr.v1.GetRepositoryResponse\x12U\n" +
|
||||||
"\x10DeleteRepository\x12\x1f.mcr.v1.DeleteRepositoryRequest\x1a .mcr.v1.DeleteRepositoryResponse\x12O\n" +
|
"\x10DeleteRepository\x12\x1f.mcr.v1.DeleteRepositoryRequest\x1a .mcr.v1.DeleteRepositoryResponse\x12O\n" +
|
||||||
"\x0eGarbageCollect\x12\x1d.mcr.v1.GarbageCollectRequest\x1a\x1e.mcr.v1.GarbageCollectResponse\x12F\n" +
|
"\x0eGarbageCollect\x12\x1d.mcr.v1.GarbageCollectRequest\x1a\x1e.mcr.v1.GarbageCollectResponse\x12F\n" +
|
||||||
"\vGetGCStatus\x12\x1a.mcr.v1.GetGCStatusRequest\x1a\x1b.mcr.v1.GetGCStatusResponseB,Z*git.wntrmute.dev/kyle/mcr/gen/mcr/v1;mcrv1b\x06proto3"
|
"\vGetGCStatus\x12\x1a.mcr.v1.GetGCStatusRequest\x1a\x1b.mcr.v1.GetGCStatusResponseB,Z*git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1b\x06proto3"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
file_mcr_v1_registry_proto_rawDescOnce sync.Once
|
file_mcr_v1_registry_proto_rawDescOnce sync.Once
|
||||||
|
|||||||
6
go.mod
6
go.mod
@@ -1,13 +1,14 @@
|
|||||||
module git.wntrmute.dev/kyle/mcr
|
module git.wntrmute.dev/mc/mcr
|
||||||
|
|
||||||
go 1.25.7
|
go 1.25.7
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.wntrmute.dev/kyle/mcdsl v1.1.0
|
git.wntrmute.dev/mc/mcdsl v1.2.0
|
||||||
github.com/go-chi/chi/v5 v5.2.5
|
github.com/go-chi/chi/v5 v5.2.5
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/spf13/cobra v1.10.2
|
github.com/spf13/cobra v1.10.2
|
||||||
google.golang.org/grpc v1.79.3
|
google.golang.org/grpc v1.79.3
|
||||||
|
google.golang.org/protobuf v1.36.11
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -22,7 +23,6 @@ require (
|
|||||||
golang.org/x/sys v0.42.0 // indirect
|
golang.org/x/sys v0.42.0 // indirect
|
||||||
golang.org/x/text v0.32.0 // indirect
|
golang.org/x/text v0.32.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||||
google.golang.org/protobuf v1.36.11 // indirect
|
|
||||||
modernc.org/libc v1.70.0 // indirect
|
modernc.org/libc v1.70.0 // indirect
|
||||||
modernc.org/mathutil v1.7.1 // indirect
|
modernc.org/mathutil v1.7.1 // indirect
|
||||||
modernc.org/memory v1.11.0 // indirect
|
modernc.org/memory v1.11.0 // indirect
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -1,5 +1,5 @@
|
|||||||
git.wntrmute.dev/kyle/mcdsl v1.1.0 h1:NXfEXRtaCRPNjCbqqgU7L2SgDAZkQn9kd40xJDgxnns=
|
git.wntrmute.dev/mc/mcdsl v1.2.0 h1:41hep7/PNZJfN0SN/nM+rQpyF1GSZcvNNjyVG81DI7U=
|
||||||
git.wntrmute.dev/kyle/mcdsl v1.1.0/go.mod h1:wo0tGfUAxci3XnOe4/rFmR0RjUElKdYUazc+Np986sg=
|
git.wntrmute.dev/mc/mcdsl v1.2.0/go.mod h1:lXYrAt74ZUix6rx9oVN8d2zH1YJoyp4uxPVKQ+SSxuM=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
mcdslauth "git.wntrmute.dev/kyle/mcdsl/auth"
|
mcdslauth "git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client communicates with an MCIAS server for authentication and token
|
// Client communicates with an MCIAS server for authentication and token
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
mcdslconfig "git.wntrmute.dev/kyle/mcdsl/config"
|
mcdslconfig "git.wntrmute.dev/mc/mcdsl/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config is the top-level MCR configuration. It embeds config.Base for
|
// Config is the top-level MCR configuration. It embeds config.Base for
|
||||||
@@ -27,6 +27,7 @@ type WebConfig struct {
|
|||||||
ListenAddr string `toml:"listen_addr"`
|
ListenAddr string `toml:"listen_addr"`
|
||||||
GRPCAddr string `toml:"grpc_addr"`
|
GRPCAddr string `toml:"grpc_addr"`
|
||||||
CACert string `toml:"ca_cert"`
|
CACert string `toml:"ca_cert"`
|
||||||
|
TLSServerName string `toml:"tls_server_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load reads a TOML config file, applies environment variable overrides
|
// Load reads a TOML config file, applies environment variable overrides
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
mcdsldb "git.wntrmute.dev/kyle/mcdsl/db"
|
mcdsldb "git.wntrmute.dev/mc/mcdsl/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DB wraps a SQLite database connection.
|
// DB wraps a SQLite database connection.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/gc"
|
"git.wntrmute.dev/mc/mcr/internal/gc"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FindAndDeleteUnreferencedBlobs finds all blob rows with no manifest_blobs
|
// FindAndDeleteUnreferencedBlobs finds all blob rows with no manifest_blobs
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package db
|
package db
|
||||||
|
|
||||||
import (
|
import (
|
||||||
mcdsldb "git.wntrmute.dev/kyle/mcdsl/db"
|
mcdsldb "git.wntrmute.dev/mc/mcdsl/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Migrations is the ordered list of MCR schema migrations.
|
// Migrations is the ordered list of MCR schema migrations.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ruleBody is the JSON structure stored in the rule_json column.
|
// ruleBody is the JSON structure stored in the rule_json column.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package db
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLoadEnabledPolicyRules(t *testing.T) {
|
func TestLoadEnabledPolicyRules(t *testing.T) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package grpcserver
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// adminService implements pb.AdminServiceServer.
|
// adminService implements pb.AdminServiceServer.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHealthReturnsOk(t *testing.T) {
|
func TestHealthReturnsOk(t *testing.T) {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// auditService implements pb.AuditServiceServer.
|
// auditService implements pb.AuditServiceServer.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package grpcserver
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestListAuditEventsEmpty(t *testing.T) {
|
func TestListAuditEventsEmpty(t *testing.T) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package grpcserver
|
package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
mcdslgrpc "git.wntrmute.dev/kyle/mcdsl/grpcserver"
|
mcdslgrpc "git.wntrmute.dev/mc/mcdsl/grpcserver"
|
||||||
)
|
)
|
||||||
|
|
||||||
// methodMap builds the mcdsl grpcserver.MethodMap for MCR.
|
// methodMap builds the mcdsl grpcserver.MethodMap for MCR.
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ import (
|
|||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
mcdslauth "git.wntrmute.dev/kyle/mcdsl/auth"
|
mcdslauth "git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// mockMCIAS starts a fake MCIAS HTTP server for token validation.
|
// mockMCIAS starts a fake MCIAS HTTP server for token validation.
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
mcdslauth "git.wntrmute.dev/kyle/mcdsl/auth"
|
mcdslauth "git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
var validActions = map[string]bool{
|
var validActions = map[string]bool{
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fakePolicyReloader struct {
|
type fakePolicyReloader struct {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
mcdslauth "git.wntrmute.dev/kyle/mcdsl/auth"
|
mcdslauth "git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/gc"
|
"git.wntrmute.dev/mc/mcr/internal/gc"
|
||||||
)
|
)
|
||||||
|
|
||||||
// registryService implements pb.RegistryServiceServer.
|
// registryService implements pb.RegistryServiceServer.
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
mcdslauth "git.wntrmute.dev/kyle/mcdsl/auth"
|
mcdslauth "git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// testMCIAS is a package-level variable set by adminDeps for reuse.
|
// testMCIAS is a package-level variable set by adminDeps for reuse.
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
mcdslauth "git.wntrmute.dev/kyle/mcdsl/auth"
|
mcdslauth "git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
mcdslgrpc "git.wntrmute.dev/kyle/mcdsl/grpcserver"
|
mcdslgrpc "git.wntrmute.dev/mc/mcdsl/grpcserver"
|
||||||
|
|
||||||
pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/gc"
|
"git.wntrmute.dev/mc/mcr/internal/gc"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuditFunc is a callback for recording audit events. It follows the same
|
// AuditFunc is a callback for recording audit events. It follows the same
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *Handler) handleBlobGet(w http.ResponseWriter, r *http.Request, repo, digest string) {
|
func (h *Handler) handleBlobGet(w http.ResponseWriter, r *http.Request, repo, digest string) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
type catalogResponse struct {
|
type catalogResponse struct {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// handleManifestDelete handles DELETE /v2/<name>/manifests/<digest>.
|
// handleManifestDelete handles DELETE /v2/<name>/manifests/<digest>.
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/storage"
|
"git.wntrmute.dev/mc/mcr/internal/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DBQuerier provides the database operations needed by OCI handlers.
|
// DBQuerier provides the database operations needed by OCI handlers.
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/storage"
|
"git.wntrmute.dev/mc/mcr/internal/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// manifestKey uniquely identifies a manifest for test lookup.
|
// manifestKey uniquely identifies a manifest for test lookup.
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *Handler) handleManifestGet(w http.ResponseWriter, r *http.Request, repo, reference string) {
|
func (h *Handler) handleManifestGet(w http.ResponseWriter, r *http.Request, repo, reference string) {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
type tagListResponse struct {
|
type tagListResponse struct {
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/storage"
|
"git.wntrmute.dev/mc/mcr/internal/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// uploadManager tracks in-progress blob writers by UUID.
|
// uploadManager tracks in-progress blob writers by UUID.
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/storage"
|
"git.wntrmute.dev/mc/mcr/internal/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// testHandlerWithStorage creates a handler with real storage in t.TempDir().
|
// testHandlerWithStorage creates a handler with real storage in t.TempDir().
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
type adminErrorResponse struct {
|
type adminErrorResponse struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AdminListAuditHandler handles GET /v1/audit.
|
// AdminListAuditHandler handles GET /v1/audit.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAdminListAuditEvents(t *testing.T) {
|
func TestAdminListAuditEvents(t *testing.T) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAdminHealthHandler(t *testing.T) {
|
func TestAdminHealthHandler(t *testing.T) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/gc"
|
"git.wntrmute.dev/mc/mcr/internal/gc"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GCLastRun records the result of the last GC run.
|
// GCLastRun records the result of the last GC run.
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PolicyReloader can reload policy rules from a store.
|
// PolicyReloader can reload policy rules from a store.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAdminPolicyCRUDCycle(t *testing.T) {
|
func TestAdminPolicyCRUDCycle(t *testing.T) {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AdminListReposHandler handles GET /v1/repositories.
|
// AdminListReposHandler handles GET /v1/repositories.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// seedRepoForAdmin inserts a repository with a manifest and tags into the test DB.
|
// seedRepoForAdmin inserts a repository with a manifest and tags into the test DB.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package server
|
|||||||
import (
|
import (
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AdminDeps holds the dependencies needed by admin routes.
|
// AdminDeps holds the dependencies needed by admin routes.
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/db"
|
"git.wntrmute.dev/mc/mcr/internal/db"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
func openAdminTestDB(t *testing.T) *db.DB {
|
func openAdminTestDB(t *testing.T) *db.DB {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TokenValidator abstracts token validation so the middleware can work
|
// TokenValidator abstracts token validation so the middleware can work
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fakeValidator struct {
|
type fakeValidator struct {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PolicyEvaluator abstracts the policy engine for testability.
|
// PolicyEvaluator abstracts the policy engine for testability.
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/policy"
|
"git.wntrmute.dev/mc/mcr/internal/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fakePolicyEvaluator struct {
|
type fakePolicyEvaluator struct {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRoutesV2Authenticated(t *testing.T) {
|
func TestRoutesV2Authenticated(t *testing.T) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/internal/auth"
|
"git.wntrmute.dev/mc/mcr/internal/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
type fakeLoginClient struct {
|
type fakeLoginClient struct {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import (
|
|||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
|
|
||||||
mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
"git.wntrmute.dev/kyle/mcr/web"
|
"git.wntrmute.dev/mc/mcr/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LoginFunc authenticates a user and returns a bearer token.
|
// LoginFunc authenticates a user and returns a bearer token.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1"
|
mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// fakeRegistryService implements RegistryServiceServer for testing.
|
// fakeRegistryService implements RegistryServiceServer for testing.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcr/web"
|
"git.wntrmute.dev/mc/mcr/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
// templateSet wraps parsed templates and provides a render method.
|
// templateSet wraps parsed templates and provides a render method.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package mcr.v1;
|
package mcr.v1;
|
||||||
|
|
||||||
option go_package = "git.wntrmute.dev/kyle/mcr/gen/mcr/v1;mcrv1";
|
option go_package = "git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1";
|
||||||
|
|
||||||
service AdminService {
|
service AdminService {
|
||||||
rpc Health(HealthRequest) returns (HealthResponse);
|
rpc Health(HealthRequest) returns (HealthResponse);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package mcr.v1;
|
package mcr.v1;
|
||||||
|
|
||||||
option go_package = "git.wntrmute.dev/kyle/mcr/gen/mcr/v1;mcrv1";
|
option go_package = "git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1";
|
||||||
|
|
||||||
import "mcr/v1/common.proto";
|
import "mcr/v1/common.proto";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package mcr.v1;
|
package mcr.v1;
|
||||||
|
|
||||||
option go_package = "git.wntrmute.dev/kyle/mcr/gen/mcr/v1;mcrv1";
|
option go_package = "git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1";
|
||||||
|
|
||||||
// Pagination controls for list RPCs.
|
// Pagination controls for list RPCs.
|
||||||
message PaginationRequest {
|
message PaginationRequest {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package mcr.v1;
|
package mcr.v1;
|
||||||
|
|
||||||
option go_package = "git.wntrmute.dev/kyle/mcr/gen/mcr/v1;mcrv1";
|
option go_package = "git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1";
|
||||||
|
|
||||||
import "mcr/v1/common.proto";
|
import "mcr/v1/common.proto";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package mcr.v1;
|
package mcr.v1;
|
||||||
|
|
||||||
option go_package = "git.wntrmute.dev/kyle/mcr/gen/mcr/v1;mcrv1";
|
option go_package = "git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1";
|
||||||
|
|
||||||
import "mcr/v1/common.proto";
|
import "mcr/v1/common.proto";
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pelletier/go-toml/v2"
|
"github.com/pelletier/go-toml/v2"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcdsl/auth"
|
"git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Base contains the configuration sections common to all Metacircular
|
// Base contains the configuration sections common to all Metacircular
|
||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
"git.wntrmute.dev/kyle/mcdsl/auth"
|
"git.wntrmute.dev/mc/mcdsl/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MethodMap classifies gRPC methods for access control.
|
// MethodMap classifies gRPC methods for access control.
|
||||||
10
vendor/modules.txt
vendored
10
vendor/modules.txt
vendored
@@ -1,9 +1,9 @@
|
|||||||
# git.wntrmute.dev/kyle/mcdsl v1.1.0
|
# git.wntrmute.dev/mc/mcdsl v1.2.0
|
||||||
## explicit; go 1.25.7
|
## explicit; go 1.25.7
|
||||||
git.wntrmute.dev/kyle/mcdsl/auth
|
git.wntrmute.dev/mc/mcdsl/auth
|
||||||
git.wntrmute.dev/kyle/mcdsl/config
|
git.wntrmute.dev/mc/mcdsl/config
|
||||||
git.wntrmute.dev/kyle/mcdsl/db
|
git.wntrmute.dev/mc/mcdsl/db
|
||||||
git.wntrmute.dev/kyle/mcdsl/grpcserver
|
git.wntrmute.dev/mc/mcdsl/grpcserver
|
||||||
# github.com/dustin/go-humanize v1.0.1
|
# github.com/dustin/go-humanize v1.0.1
|
||||||
## explicit; go 1.16
|
## explicit; go 1.16
|
||||||
github.com/dustin/go-humanize
|
github.com/dustin/go-humanize
|
||||||
|
|||||||
Reference in New Issue
Block a user