diff --git a/CLAUDE.md b/CLAUDE.md index 85f91a1..0d67332 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -32,7 +32,7 @@ go test ./internal/server -run TestPushManifest ## Tech Stack - **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) - **Config:** TOML via `go-toml/v2`, env overrides via `MCR_*` - **APIs:** REST (chi) + gRPC (protobuf), kept in sync diff --git a/Makefile b/Makefile index c41866a..3dddbf7 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,8 @@ lint: golangci-lint run ./... proto: - protoc --go_out=. --go_opt=module=git.wntrmute.dev/kyle/mcr \ - --go-grpc_out=. --go-grpc_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/mc/mcr \ proto/mcr/v1/*.proto proto-lint: diff --git a/PROGRESS.md b/PROGRESS.md index 689f4ae..61629b3 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -712,7 +712,7 @@ Lint fix: entry points with cobra subcommands. **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/`, `internal/`, `proto/mcr/v1/`, `gen/mcr/v1/`, `web/templates/`, `web/static/`, `deploy/docker/`, `deploy/examples/`, `deploy/scripts/`, diff --git a/PROJECT_PLAN.md b/PROJECT_PLAN.md index c99c1cb..09ec82e 100644 --- a/PROJECT_PLAN.md +++ b/PROJECT_PLAN.md @@ -63,7 +63,7 @@ produces a project that builds and lints cleanly with no functionality. ### Step 0.1: Go module and directory structure **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: `cmd/mcrsrv/`, `cmd/mcr-web/`, `cmd/mcrctl/`, `internal/`, `proto/mcr/v1/`, `gen/mcr/v1/`, `web/`, `deploy/` diff --git a/cmd/mcr-web/main.go b/cmd/mcr-web/main.go index bdc92bf..755d536 100644 --- a/cmd/mcr-web/main.go +++ b/cmd/mcr-web/main.go @@ -17,10 +17,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/config" - "git.wntrmute.dev/kyle/mcr/internal/webserver" + mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/config" + "git.wntrmute.dev/mc/mcr/internal/webserver" ) var version = "dev" @@ -170,6 +170,7 @@ func runServer(configPath string) error { func dialGRPC(cfg *config.Config) (*grpc.ClientConn, error) { tlsCfg := &tls.Config{ MinVersion: tls.VersionTLS13, + ServerName: cfg.Web.TLSServerName, } if cfg.Web.CACert != "" { diff --git a/cmd/mcrctl/client.go b/cmd/mcrctl/client.go index e92347b..b3e966d 100644 --- a/cmd/mcrctl/client.go +++ b/cmd/mcrctl/client.go @@ -14,7 +14,7 @@ import ( "google.golang.org/grpc" "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 diff --git a/cmd/mcrctl/main.go b/cmd/mcrctl/main.go index 619cd62..07282dd 100644 --- a/cmd/mcrctl/main.go +++ b/cmd/mcrctl/main.go @@ -11,7 +11,7 @@ import ( "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" diff --git a/cmd/mcrctl/purge.go b/cmd/mcrctl/purge.go index bd1dda0..dd62482 100644 --- a/cmd/mcrctl/purge.go +++ b/cmd/mcrctl/purge.go @@ -11,7 +11,7 @@ import ( "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 { diff --git a/cmd/mcrsrv/main.go b/cmd/mcrsrv/main.go index 70b5dfd..63dd5d5 100644 --- a/cmd/mcrsrv/main.go +++ b/cmd/mcrsrv/main.go @@ -16,17 +16,17 @@ import ( "github.com/spf13/cobra" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/config" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/gc" - "git.wntrmute.dev/kyle/mcr/internal/oci" - "git.wntrmute.dev/kyle/mcr/internal/policy" - "git.wntrmute.dev/kyle/mcr/internal/server" - "git.wntrmute.dev/kyle/mcr/internal/storage" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/config" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/gc" + "git.wntrmute.dev/mc/mcr/internal/oci" + "git.wntrmute.dev/mc/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/server" + "git.wntrmute.dev/mc/mcr/internal/storage" - "git.wntrmute.dev/kyle/mcr/internal/grpcserver" - mcdsldb "git.wntrmute.dev/kyle/mcdsl/db" + "git.wntrmute.dev/mc/mcr/internal/grpcserver" + mcdsldb "git.wntrmute.dev/mc/mcdsl/db" ) var version = "dev" diff --git a/deploy/examples/mcr.toml b/deploy/examples/mcr.toml index 806b041..0e587d8 100644 --- a/deploy/examples/mcr.toml +++ b/deploy/examples/mcr.toml @@ -25,9 +25,10 @@ service_name = "mcr" tags = ["env:restricted"] [web] -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 -ca_cert = "" # CA cert for verifying mcrsrv gRPC TLS +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 +tls_server_name = "" # Override TLS server name (when dial address differs from cert SAN) +ca_cert = "" # CA cert for verifying mcrsrv gRPC TLS [log] level = "info" # debug, info, warn, error diff --git a/deploy/mcr-rift.toml b/deploy/mcr-rift.toml index e8a0a68..2cc959a 100644 --- a/deploy/mcr-rift.toml +++ b/deploy/mcr-rift.toml @@ -30,9 +30,10 @@ service_name = "mcr" service_token = "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL21jaWFzLm1ldGFjaXJjdWxhci5uZXQiLCJzdWIiOiIwYWM3NDk3ZS0wZTE5LTRhOWMtYWI3Yi03YWZjMzc0ZDU3NzIiLCJleHAiOjE4MDYwMzczNzMsIm5iZiI6MTc3NDUwMTM3MywiaWF0IjoxNzc0NTAxMzczLCJqdGkiOiI1NTM0ZDU0OS1kYzY5LTRiNzctYTY5MC0xNzQ3NjE0MDUzYzEiLCJyb2xlcyI6bnVsbH0.bsnoGMrFzJJCIanGuiAvpqmlO2OssvFjYynQgiSt_TPMuLxziRuwuRIL9C_kRnHdF7C6c1mTHncKVj1hkLPiCg" [web] -listen_addr = ":8080" -grpc_addr = "mcr:9443" -ca_cert = "/srv/mcr/certs/ca.pem" +listen_addr = ":8080" +grpc_addr = "mcr-api:9443" +tls_server_name = "mcr.svc.mcp.metacircular.net" +ca_cert = "/srv/mcr/certs/ca.pem" [log] level = "info" diff --git a/gen/mcr/v1/admin.pb.go b/gen/mcr/v1/admin.pb.go index a75c8df..eff50df 100644 --- a/gen/mcr/v1/admin.pb.go +++ b/gen/mcr/v1/admin.pb.go @@ -1,14 +1,97 @@ // 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 package mcrv1 -// HealthRequest is the request message for Health. -type HealthRequest struct{} +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 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 { - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + 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 { @@ -17,3 +100,65 @@ func (x *HealthResponse) GetStatus() string { } 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 +} diff --git a/gen/mcr/v1/admin_grpc.pb.go b/gen/mcr/v1/admin_grpc.pb.go index cca450b..8d6a27e 100644 --- a/gen/mcr/v1/admin_grpc.pb.go +++ b/gen/mcr/v1/admin_grpc.pb.go @@ -1,38 +1,92 @@ // 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 package mcrv1 import ( - "context" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + 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 { Health(context.Context, *HealthRequest) (*HealthResponse, error) mustEmbedUnimplementedAdminServiceServer() } -// UnimplementedAdminServiceServer should be embedded to have forward -// compatible implementations. +// UnimplementedAdminServiceServer 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 UnimplementedAdminServiceServer struct{} 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) { + // 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) } -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) if err := dec(in); err != nil { return nil, err @@ -42,47 +96,26 @@ func adminServiceHealthHandler(srv any, ctx context.Context, dec func(any) error } info := &grpc.UnaryServerInfo{ 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 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{ ServiceName: "mcr.v1.AdminService", HandlerType: (*AdminServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Health", - Handler: adminServiceHealthHandler, + Handler: _AdminService_Health_Handler, }, }, Streams: []grpc.StreamDesc{}, 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 -} diff --git a/gen/mcr/v1/audit.pb.go b/gen/mcr/v1/audit.pb.go index 164e7cc..a686e93 100644 --- a/gen/mcr/v1/audit.pb.go +++ b/gen/mcr/v1/audit.pb.go @@ -1,18 +1,68 @@ // 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 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 { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name - 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"` - ActorId string `protobuf:"bytes,4,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` //nolint:revive,stylecheck // proto field name - Repository string `protobuf:"bytes,5,opt,name=repository,proto3" json:"repository,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 - Details map[string]string `protobuf:"bytes,8,rep,name=details,proto3" json:"details,omitempty"` + 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"` + 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"` + Repository string `protobuf:"bytes,5,opt,name=repository,proto3" json:"repository,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"` + 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 { @@ -71,14 +121,46 @@ func (x *AuditEvent) GetDetails() map[string]string { return nil } -// ListAuditEventsRequest is the request message for ListAuditEvents. type ListAuditEventsRequest struct { - 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"` - ActorId string `protobuf:"bytes,3,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` //nolint:revive,stylecheck // proto field name - Repository string `protobuf:"bytes,4,opt,name=repository,proto3" json:"repository,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"` + state protoimpl.MessageState `protogen:"open.v1"` + 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"` + 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"` + Since string `protobuf:"bytes,5,opt,name=since,proto3" json:"since,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 { @@ -123,9 +205,41 @@ func (x *ListAuditEventsRequest) GetUntil() string { return "" } -// ListAuditEventsResponse is the response message for ListAuditEvents. type ListAuditEventsResponse struct { - Events []*AuditEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + 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 { @@ -134,3 +248,101 @@ func (x *ListAuditEventsResponse) GetEvents() []*AuditEvent { } 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 +} diff --git a/gen/mcr/v1/audit_grpc.pb.go b/gen/mcr/v1/audit_grpc.pb.go index 304880d..64b5ed4 100644 --- a/gen/mcr/v1/audit_grpc.pb.go +++ b/gen/mcr/v1/audit_grpc.pb.go @@ -1,38 +1,92 @@ // 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 package mcrv1 import ( - "context" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + 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 { ListAuditEvents(context.Context, *ListAuditEventsRequest) (*ListAuditEventsResponse, error) mustEmbedUnimplementedAuditServiceServer() } -// UnimplementedAuditServiceServer should be embedded to have forward -// compatible implementations. +// UnimplementedAuditServiceServer 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 UnimplementedAuditServiceServer struct{} 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) { + // 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) } -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) if err := dec(in); err != nil { return nil, err @@ -42,47 +96,26 @@ func auditServiceListAuditEventsHandler(srv any, ctx context.Context, dec func(a } info := &grpc.UnaryServerInfo{ 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 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{ ServiceName: "mcr.v1.AuditService", HandlerType: (*AuditServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListAuditEvents", - Handler: auditServiceListAuditEventsHandler, + Handler: _AuditService_ListAuditEvents_Handler, }, }, Streams: []grpc.StreamDesc{}, 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 -} diff --git a/gen/mcr/v1/common.pb.go b/gen/mcr/v1/common.pb.go index f71ec2a..71e512e 100644 --- a/gen/mcr/v1/common.pb.go +++ b/gen/mcr/v1/common.pb.go @@ -1,12 +1,63 @@ // 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 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 { - Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` - Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,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 { @@ -22,3 +73,60 @@ func (x *PaginationRequest) GetOffset() int32 { } 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 +} diff --git a/gen/mcr/v1/policy.pb.go b/gen/mcr/v1/policy.pb.go index 32e60a2..14361df 100644 --- a/gen/mcr/v1/policy.pb.go +++ b/gen/mcr/v1/policy.pb.go @@ -1,23 +1,73 @@ // 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 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 { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name - Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,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"` - 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"` - SubjectUuid string `protobuf:"bytes,7,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"` //nolint:revive,stylecheck // proto field name - Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,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"` - 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"` - UpdatedAt string `protobuf:"bytes,13,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + 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"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,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"` + 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"` + Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,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"` + 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"` + 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 { @@ -111,9 +161,41 @@ func (x *PolicyRule) GetUpdatedAt() string { return "" } -// ListPolicyRulesRequest is the request message for ListPolicyRules. type ListPolicyRulesRequest struct { - Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + 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 { @@ -123,9 +205,41 @@ func (x *ListPolicyRulesRequest) GetPagination() *PaginationRequest { return nil } -// ListPolicyRulesResponse is the response message for ListPolicyRules. type ListPolicyRulesResponse struct { - Rules []*PolicyRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + 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 { @@ -135,17 +249,49 @@ func (x *ListPolicyRulesResponse) GetRules() []*PolicyRule { return nil } -// CreatePolicyRuleRequest is the request message for CreatePolicyRule. type CreatePolicyRuleRequest struct { - Priority int32 `protobuf:"varint,1,opt,name=priority,proto3" json:"priority,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"` - 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"` - SubjectUuid string `protobuf:"bytes,6,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"` //nolint:revive,stylecheck // proto field name - Actions []string `protobuf:"bytes,7,rep,name=actions,proto3" json:"actions,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"` + state protoimpl.MessageState `protogen:"open.v1"` + Priority int32 `protobuf:"varint,1,opt,name=priority,proto3" json:"priority,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"` + 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"` + 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"` + Repositories []string `protobuf:"bytes,8,rep,name=repositories,proto3" json:"repositories,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 { @@ -211,9 +357,41 @@ func (x *CreatePolicyRuleRequest) GetEnabled() bool { return false } -// GetPolicyRuleRequest is the request message for GetPolicyRule. 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 { @@ -223,19 +401,52 @@ func (x *GetPolicyRuleRequest) GetId() int64 { return 0 } -// UpdatePolicyRuleRequest is the request message for UpdatePolicyRule. type UpdatePolicyRuleRequest struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //nolint:revive,stylecheck // proto field name - Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,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"` - 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"` - SubjectUuid string `protobuf:"bytes,7,opt,name=subject_uuid,json=subjectUuid,proto3" json:"subject_uuid,omitempty"` //nolint:revive,stylecheck // proto field name - Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,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"` - UpdateMask []string `protobuf:"bytes,11,rep,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + 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"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,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"` + 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"` + Actions []string `protobuf:"bytes,8,rep,name=actions,proto3" json:"actions,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"` + // 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"` + 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 { @@ -315,9 +526,41 @@ func (x *UpdatePolicyRuleRequest) GetUpdateMask() []string { return nil } -// DeletePolicyRuleRequest is the request message for DeletePolicyRule. 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 { @@ -327,5 +570,173 @@ func (x *DeletePolicyRuleRequest) GetId() int64 { 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 +} diff --git a/gen/mcr/v1/policy_grpc.pb.go b/gen/mcr/v1/policy_grpc.pb.go index d97a505..de2c597 100644 --- a/gen/mcr/v1/policy_grpc.pb.go +++ b/gen/mcr/v1/policy_grpc.pb.go @@ -1,178 +1,34 @@ // 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 package mcrv1 import ( - "context" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" ) -// PolicyServiceServer is the server API for PolicyService. -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() -} +// 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 -// UnimplementedPolicyServiceServer should be embedded to have forward -// compatible implementations. -type UnimplementedPolicyServiceServer struct{} +const ( + PolicyService_ListPolicyRules_FullMethodName = "/mcr.v1.PolicyService/ListPolicyRules" + 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) { - return nil, status.Errorf(codes.Unimplemented, "method ListPolicyRules not implemented") -} - -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. +// PolicyServiceClient is the client API for PolicyService 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 PolicyServiceClient interface { ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error) CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*PolicyRule, error) @@ -185,14 +41,14 @@ type policyServiceClient struct { cc grpc.ClientConnInterface } -// NewPolicyServiceClient creates a new PolicyServiceClient. func NewPolicyServiceClient(cc grpc.ClientConnInterface) PolicyServiceClient { return &policyServiceClient{cc} } func (c *policyServiceClient) ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 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 { 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) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 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 { 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) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 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 { 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) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 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 { 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) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 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 { return nil, err } 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", +} diff --git a/gen/mcr/v1/registry.pb.go b/gen/mcr/v1/registry.pb.go index f1479d8..b41e04a 100644 --- a/gen/mcr/v1/registry.pb.go +++ b/gen/mcr/v1/registry.pb.go @@ -812,7 +812,7 @@ const file_mcr_v1_registry_proto_rawDesc = "" + "\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" + "\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 ( file_mcr_v1_registry_proto_rawDescOnce sync.Once diff --git a/go.mod b/go.mod index d6a4b06..5aa8057 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,14 @@ -module git.wntrmute.dev/kyle/mcr +module git.wntrmute.dev/mc/mcr go 1.25.7 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/google/uuid v1.6.0 github.com/spf13/cobra v1.10.2 google.golang.org/grpc v1.79.3 + google.golang.org/protobuf v1.36.11 ) require ( @@ -22,7 +23,6 @@ require ( golang.org/x/sys v0.42.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/protobuf v1.36.11 // indirect modernc.org/libc v1.70.0 // indirect modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.11.0 // indirect diff --git a/go.sum b/go.sum index 3d2127d..03b3e72 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.wntrmute.dev/kyle/mcdsl v1.1.0 h1:NXfEXRtaCRPNjCbqqgU7L2SgDAZkQn9kd40xJDgxnns= -git.wntrmute.dev/kyle/mcdsl v1.1.0/go.mod h1:wo0tGfUAxci3XnOe4/rFmR0RjUElKdYUazc+Np986sg= +git.wntrmute.dev/mc/mcdsl v1.2.0 h1:41hep7/PNZJfN0SN/nM+rQpyF1GSZcvNNjyVG81DI7U= +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/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= diff --git a/internal/auth/client.go b/internal/auth/client.go index 1f8ef3c..1640b5f 100644 --- a/internal/auth/client.go +++ b/internal/auth/client.go @@ -4,7 +4,7 @@ import ( "errors" "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 diff --git a/internal/config/config.go b/internal/config/config.go index d1ec816..a849706 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -5,7 +5,7 @@ import ( "os" "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 @@ -24,9 +24,10 @@ type StorageConfig struct { // WebConfig holds the web UI server settings. type WebConfig struct { - ListenAddr string `toml:"listen_addr"` - GRPCAddr string `toml:"grpc_addr"` - CACert string `toml:"ca_cert"` + ListenAddr string `toml:"listen_addr"` + GRPCAddr string `toml:"grpc_addr"` + CACert string `toml:"ca_cert"` + TLSServerName string `toml:"tls_server_name"` } // Load reads a TOML config file, applies environment variable overrides diff --git a/internal/db/db.go b/internal/db/db.go index 728aebe..1a597e3 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -4,7 +4,7 @@ import ( "database/sql" "fmt" - mcdsldb "git.wntrmute.dev/kyle/mcdsl/db" + mcdsldb "git.wntrmute.dev/mc/mcdsl/db" ) // DB wraps a SQLite database connection. diff --git a/internal/db/gc.go b/internal/db/gc.go index f985465..fff65b6 100644 --- a/internal/db/gc.go +++ b/internal/db/gc.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "git.wntrmute.dev/kyle/mcr/internal/gc" + "git.wntrmute.dev/mc/mcr/internal/gc" ) // FindAndDeleteUnreferencedBlobs finds all blob rows with no manifest_blobs diff --git a/internal/db/migrate.go b/internal/db/migrate.go index 7e83589..b5641cb 100644 --- a/internal/db/migrate.go +++ b/internal/db/migrate.go @@ -1,7 +1,7 @@ package db import ( - mcdsldb "git.wntrmute.dev/kyle/mcdsl/db" + mcdsldb "git.wntrmute.dev/mc/mcdsl/db" ) // Migrations is the ordered list of MCR schema migrations. diff --git a/internal/db/policy.go b/internal/db/policy.go index 207d121..f0e0f9f 100644 --- a/internal/db/policy.go +++ b/internal/db/policy.go @@ -4,7 +4,7 @@ import ( "encoding/json" "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. diff --git a/internal/db/policy_test.go b/internal/db/policy_test.go index 1d5fb49..ac403b5 100644 --- a/internal/db/policy_test.go +++ b/internal/db/policy_test.go @@ -3,7 +3,7 @@ package db import ( "testing" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/policy" ) func TestLoadEnabledPolicyRules(t *testing.T) { diff --git a/internal/grpcserver/admin.go b/internal/grpcserver/admin.go index 9995654..3dc8805 100644 --- a/internal/grpcserver/admin.go +++ b/internal/grpcserver/admin.go @@ -3,7 +3,7 @@ package grpcserver import ( "context" - pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" ) // adminService implements pb.AdminServiceServer. diff --git a/internal/grpcserver/admin_test.go b/internal/grpcserver/admin_test.go index 8261458..b5aa275 100644 --- a/internal/grpcserver/admin_test.go +++ b/internal/grpcserver/admin_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" ) func TestHealthReturnsOk(t *testing.T) { diff --git a/internal/grpcserver/audit.go b/internal/grpcserver/audit.go index 85173fc..73e3bc3 100644 --- a/internal/grpcserver/audit.go +++ b/internal/grpcserver/audit.go @@ -6,8 +6,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" - "git.wntrmute.dev/kyle/mcr/internal/db" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/internal/db" ) // auditService implements pb.AuditServiceServer. diff --git a/internal/grpcserver/audit_test.go b/internal/grpcserver/audit_test.go index c005dce..53aff41 100644 --- a/internal/grpcserver/audit_test.go +++ b/internal/grpcserver/audit_test.go @@ -3,7 +3,7 @@ package grpcserver import ( "testing" - pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" ) func TestListAuditEventsEmpty(t *testing.T) { diff --git a/internal/grpcserver/interceptors.go b/internal/grpcserver/interceptors.go index 0781b0a..726f031 100644 --- a/internal/grpcserver/interceptors.go +++ b/internal/grpcserver/interceptors.go @@ -1,7 +1,7 @@ package grpcserver import ( - mcdslgrpc "git.wntrmute.dev/kyle/mcdsl/grpcserver" + mcdslgrpc "git.wntrmute.dev/mc/mcdsl/grpcserver" ) // methodMap builds the mcdsl grpcserver.MethodMap for MCR. diff --git a/internal/grpcserver/interceptors_test.go b/internal/grpcserver/interceptors_test.go index 48fc19e..12b57d0 100644 --- a/internal/grpcserver/interceptors_test.go +++ b/internal/grpcserver/interceptors_test.go @@ -16,10 +16,10 @@ import ( "google.golang.org/grpc/metadata" "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" - "git.wntrmute.dev/kyle/mcr/internal/db" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/internal/db" ) // mockMCIAS starts a fake MCIAS HTTP server for token validation. diff --git a/internal/grpcserver/policy.go b/internal/grpcserver/policy.go index 9558ada..7c4ff1a 100644 --- a/internal/grpcserver/policy.go +++ b/internal/grpcserver/policy.go @@ -9,11 +9,11 @@ import ( "google.golang.org/grpc/codes" "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" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" ) var validActions = map[string]bool{ diff --git a/internal/grpcserver/policy_test.go b/internal/grpcserver/policy_test.go index d9d7d51..ddcb3b0 100644 --- a/internal/grpcserver/policy_test.go +++ b/internal/grpcserver/policy_test.go @@ -6,8 +6,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" - "git.wntrmute.dev/kyle/mcr/internal/policy" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/internal/policy" ) type fakePolicyReloader struct { diff --git a/internal/grpcserver/registry.go b/internal/grpcserver/registry.go index 316dc58..874969c 100644 --- a/internal/grpcserver/registry.go +++ b/internal/grpcserver/registry.go @@ -11,11 +11,11 @@ import ( "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" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/gc" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/gc" ) // registryService implements pb.RegistryServiceServer. diff --git a/internal/grpcserver/registry_test.go b/internal/grpcserver/registry_test.go index e931aec..ed407aa 100644 --- a/internal/grpcserver/registry_test.go +++ b/internal/grpcserver/registry_test.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "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. diff --git a/internal/grpcserver/server.go b/internal/grpcserver/server.go index 4b7562d..366c9ba 100644 --- a/internal/grpcserver/server.go +++ b/internal/grpcserver/server.go @@ -11,13 +11,13 @@ import ( "net" "sync" - mcdslauth "git.wntrmute.dev/kyle/mcdsl/auth" - mcdslgrpc "git.wntrmute.dev/kyle/mcdsl/grpcserver" + mcdslauth "git.wntrmute.dev/mc/mcdsl/auth" + mcdslgrpc "git.wntrmute.dev/mc/mcdsl/grpcserver" - pb "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/gc" - "git.wntrmute.dev/kyle/mcr/internal/policy" + pb "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/gc" + "git.wntrmute.dev/mc/mcr/internal/policy" ) // AuditFunc is a callback for recording audit events. It follows the same diff --git a/internal/oci/blob.go b/internal/oci/blob.go index d6d9d91..b8aed21 100644 --- a/internal/oci/blob.go +++ b/internal/oci/blob.go @@ -7,8 +7,8 @@ import ( "net/http" "strconv" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" ) func (h *Handler) handleBlobGet(w http.ResponseWriter, r *http.Request, repo, digest string) { diff --git a/internal/oci/catalog.go b/internal/oci/catalog.go index fbcda55..8b16fb3 100644 --- a/internal/oci/catalog.go +++ b/internal/oci/catalog.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/policy" ) type catalogResponse struct { diff --git a/internal/oci/delete.go b/internal/oci/delete.go index eeacfc2..f509e66 100644 --- a/internal/oci/delete.go +++ b/internal/oci/delete.go @@ -5,8 +5,8 @@ import ( "fmt" "net/http" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" ) // handleManifestDelete handles DELETE /v2//manifests/. diff --git a/internal/oci/handler.go b/internal/oci/handler.go index 95a0ad4..8ba6d0f 100644 --- a/internal/oci/handler.go +++ b/internal/oci/handler.go @@ -6,10 +6,10 @@ import ( "net/http" "strings" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" - "git.wntrmute.dev/kyle/mcr/internal/storage" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/storage" ) // DBQuerier provides the database operations needed by OCI handlers. diff --git a/internal/oci/handler_test.go b/internal/oci/handler_test.go index 251dc69..5e03f56 100644 --- a/internal/oci/handler_test.go +++ b/internal/oci/handler_test.go @@ -10,10 +10,10 @@ import ( "github.com/go-chi/chi/v5" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" - "git.wntrmute.dev/kyle/mcr/internal/storage" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/storage" ) // manifestKey uniquely identifies a manifest for test lookup. diff --git a/internal/oci/manifest.go b/internal/oci/manifest.go index c1aab6b..c150ad2 100644 --- a/internal/oci/manifest.go +++ b/internal/oci/manifest.go @@ -10,9 +10,9 @@ import ( "net/http" "strconv" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" ) func (h *Handler) handleManifestGet(w http.ResponseWriter, r *http.Request, repo, reference string) { diff --git a/internal/oci/tags.go b/internal/oci/tags.go index a8b64b7..4f4ec74 100644 --- a/internal/oci/tags.go +++ b/internal/oci/tags.go @@ -7,8 +7,8 @@ import ( "net/http" "strconv" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" ) type tagListResponse struct { diff --git a/internal/oci/upload.go b/internal/oci/upload.go index f332236..168a889 100644 --- a/internal/oci/upload.go +++ b/internal/oci/upload.go @@ -8,9 +8,9 @@ import ( "net/http" "sync" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" - "git.wntrmute.dev/kyle/mcr/internal/storage" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/storage" ) // uploadManager tracks in-progress blob writers by UUID. diff --git a/internal/oci/upload_test.go b/internal/oci/upload_test.go index b85a3c9..6854637 100644 --- a/internal/oci/upload_test.go +++ b/internal/oci/upload_test.go @@ -12,8 +12,8 @@ import ( "github.com/go-chi/chi/v5" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/storage" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/storage" ) // testHandlerWithStorage creates a handler with real storage in t.TempDir(). diff --git a/internal/server/admin.go b/internal/server/admin.go index 4146712..fa1c7db 100644 --- a/internal/server/admin.go +++ b/internal/server/admin.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net/http" - "git.wntrmute.dev/kyle/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/auth" ) type adminErrorResponse struct { diff --git a/internal/server/admin_audit.go b/internal/server/admin_audit.go index b6ba860..63510b0 100644 --- a/internal/server/admin_audit.go +++ b/internal/server/admin_audit.go @@ -4,7 +4,7 @@ import ( "net/http" "strconv" - "git.wntrmute.dev/kyle/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/db" ) // AdminListAuditHandler handles GET /v1/audit. diff --git a/internal/server/admin_audit_test.go b/internal/server/admin_audit_test.go index ebc15f5..eec8a17 100644 --- a/internal/server/admin_audit_test.go +++ b/internal/server/admin_audit_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "git.wntrmute.dev/kyle/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/db" ) func TestAdminListAuditEvents(t *testing.T) { diff --git a/internal/server/admin_auth_test.go b/internal/server/admin_auth_test.go index 6b0f083..3353813 100644 --- a/internal/server/admin_auth_test.go +++ b/internal/server/admin_auth_test.go @@ -6,7 +6,7 @@ import ( "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) { diff --git a/internal/server/admin_gc.go b/internal/server/admin_gc.go index 7281670..d835145 100644 --- a/internal/server/admin_gc.go +++ b/internal/server/admin_gc.go @@ -9,7 +9,7 @@ import ( "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. diff --git a/internal/server/admin_policy.go b/internal/server/admin_policy.go index 2fae888..4b479da 100644 --- a/internal/server/admin_policy.go +++ b/internal/server/admin_policy.go @@ -9,9 +9,9 @@ import ( "github.com/go-chi/chi/v5" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" ) // PolicyReloader can reload policy rules from a store. diff --git a/internal/server/admin_policy_test.go b/internal/server/admin_policy_test.go index 95d9c25..51bbca6 100644 --- a/internal/server/admin_policy_test.go +++ b/internal/server/admin_policy_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "git.wntrmute.dev/kyle/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/db" ) func TestAdminPolicyCRUDCycle(t *testing.T) { diff --git a/internal/server/admin_repo.go b/internal/server/admin_repo.go index b61f090..d730da4 100644 --- a/internal/server/admin_repo.go +++ b/internal/server/admin_repo.go @@ -7,8 +7,8 @@ import ( "github.com/go-chi/chi/v5" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/db" ) // AdminListReposHandler handles GET /v1/repositories. diff --git a/internal/server/admin_repo_test.go b/internal/server/admin_repo_test.go index 9581b41..f4292de 100644 --- a/internal/server/admin_repo_test.go +++ b/internal/server/admin_repo_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "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. diff --git a/internal/server/admin_routes.go b/internal/server/admin_routes.go index c691f3e..b986424 100644 --- a/internal/server/admin_routes.go +++ b/internal/server/admin_routes.go @@ -3,7 +3,7 @@ package server import ( "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. diff --git a/internal/server/admin_test.go b/internal/server/admin_test.go index 79d2528..5b6a013 100644 --- a/internal/server/admin_test.go +++ b/internal/server/admin_test.go @@ -10,9 +10,9 @@ import ( "github.com/go-chi/chi/v5" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/db" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/db" + "git.wntrmute.dev/mc/mcr/internal/policy" ) func openAdminTestDB(t *testing.T) *db.DB { diff --git a/internal/server/middleware.go b/internal/server/middleware.go index e4fc862..6ddfde4 100644 --- a/internal/server/middleware.go +++ b/internal/server/middleware.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "git.wntrmute.dev/kyle/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/auth" ) // TokenValidator abstracts token validation so the middleware can work diff --git a/internal/server/middleware_test.go b/internal/server/middleware_test.go index 5b71a9f..6f35972 100644 --- a/internal/server/middleware_test.go +++ b/internal/server/middleware_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "git.wntrmute.dev/kyle/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/auth" ) type fakeValidator struct { diff --git a/internal/server/policy.go b/internal/server/policy.go index cda6d0b..a82b852 100644 --- a/internal/server/policy.go +++ b/internal/server/policy.go @@ -5,8 +5,8 @@ import ( "github.com/go-chi/chi/v5" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/policy" ) // PolicyEvaluator abstracts the policy engine for testability. diff --git a/internal/server/policy_test.go b/internal/server/policy_test.go index 3480a1d..a5c45b1 100644 --- a/internal/server/policy_test.go +++ b/internal/server/policy_test.go @@ -8,8 +8,8 @@ import ( "github.com/go-chi/chi/v5" - "git.wntrmute.dev/kyle/mcr/internal/auth" - "git.wntrmute.dev/kyle/mcr/internal/policy" + "git.wntrmute.dev/mc/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/policy" ) type fakePolicyEvaluator struct { diff --git a/internal/server/routes_test.go b/internal/server/routes_test.go index fb2041e..6ddc044 100644 --- a/internal/server/routes_test.go +++ b/internal/server/routes_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "git.wntrmute.dev/kyle/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/auth" ) func TestRoutesV2Authenticated(t *testing.T) { diff --git a/internal/server/token_test.go b/internal/server/token_test.go index 9bf7d70..f183cc2 100644 --- a/internal/server/token_test.go +++ b/internal/server/token_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "git.wntrmute.dev/kyle/mcr/internal/auth" + "git.wntrmute.dev/mc/mcr/internal/auth" ) type fakeLoginClient struct { diff --git a/internal/webserver/handlers.go b/internal/webserver/handlers.go index 919c9f1..b1de414 100644 --- a/internal/webserver/handlers.go +++ b/internal/webserver/handlers.go @@ -7,7 +7,7 @@ import ( "strconv" "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/metadata" diff --git a/internal/webserver/server.go b/internal/webserver/server.go index 1f49957..2c9a876 100644 --- a/internal/webserver/server.go +++ b/internal/webserver/server.go @@ -14,8 +14,8 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" - mcrv1 "git.wntrmute.dev/kyle/mcr/gen/mcr/v1" - "git.wntrmute.dev/kyle/mcr/web" + mcrv1 "git.wntrmute.dev/mc/mcr/gen/mcr/v1" + "git.wntrmute.dev/mc/mcr/web" ) // LoginFunc authenticates a user and returns a bearer token. diff --git a/internal/webserver/server_test.go b/internal/webserver/server_test.go index d6b94a5..6de9e1e 100644 --- a/internal/webserver/server_test.go +++ b/internal/webserver/server_test.go @@ -15,7 +15,7 @@ import ( "google.golang.org/grpc/credentials/insecure" "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. diff --git a/internal/webserver/templates.go b/internal/webserver/templates.go index 191b8b2..1f2867e 100644 --- a/internal/webserver/templates.go +++ b/internal/webserver/templates.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "git.wntrmute.dev/kyle/mcr/web" + "git.wntrmute.dev/mc/mcr/web" ) // templateSet wraps parsed templates and provides a render method. diff --git a/proto/mcr/v1/admin.proto b/proto/mcr/v1/admin.proto index 06fb68c..90c901b 100644 --- a/proto/mcr/v1/admin.proto +++ b/proto/mcr/v1/admin.proto @@ -2,7 +2,7 @@ syntax = "proto3"; 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 { rpc Health(HealthRequest) returns (HealthResponse); diff --git a/proto/mcr/v1/audit.proto b/proto/mcr/v1/audit.proto index f9f987a..f72c97f 100644 --- a/proto/mcr/v1/audit.proto +++ b/proto/mcr/v1/audit.proto @@ -2,7 +2,7 @@ syntax = "proto3"; 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"; diff --git a/proto/mcr/v1/common.proto b/proto/mcr/v1/common.proto index 6bcf41b..2b3984f 100644 --- a/proto/mcr/v1/common.proto +++ b/proto/mcr/v1/common.proto @@ -2,7 +2,7 @@ syntax = "proto3"; 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. message PaginationRequest { diff --git a/proto/mcr/v1/policy.proto b/proto/mcr/v1/policy.proto index 6ee8906..4932216 100644 --- a/proto/mcr/v1/policy.proto +++ b/proto/mcr/v1/policy.proto @@ -2,7 +2,7 @@ syntax = "proto3"; 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"; diff --git a/proto/mcr/v1/registry.proto b/proto/mcr/v1/registry.proto index ee8d95f..25faf28 100644 --- a/proto/mcr/v1/registry.proto +++ b/proto/mcr/v1/registry.proto @@ -2,7 +2,7 @@ syntax = "proto3"; 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"; diff --git a/vendor/git.wntrmute.dev/kyle/mcdsl/auth/auth.go b/vendor/git.wntrmute.dev/mc/mcdsl/auth/auth.go similarity index 100% rename from vendor/git.wntrmute.dev/kyle/mcdsl/auth/auth.go rename to vendor/git.wntrmute.dev/mc/mcdsl/auth/auth.go diff --git a/vendor/git.wntrmute.dev/kyle/mcdsl/auth/cache.go b/vendor/git.wntrmute.dev/mc/mcdsl/auth/cache.go similarity index 100% rename from vendor/git.wntrmute.dev/kyle/mcdsl/auth/cache.go rename to vendor/git.wntrmute.dev/mc/mcdsl/auth/cache.go diff --git a/vendor/git.wntrmute.dev/kyle/mcdsl/auth/context.go b/vendor/git.wntrmute.dev/mc/mcdsl/auth/context.go similarity index 100% rename from vendor/git.wntrmute.dev/kyle/mcdsl/auth/context.go rename to vendor/git.wntrmute.dev/mc/mcdsl/auth/context.go diff --git a/vendor/git.wntrmute.dev/kyle/mcdsl/config/config.go b/vendor/git.wntrmute.dev/mc/mcdsl/config/config.go similarity index 99% rename from vendor/git.wntrmute.dev/kyle/mcdsl/config/config.go rename to vendor/git.wntrmute.dev/mc/mcdsl/config/config.go index 14772de..023a7ef 100644 --- a/vendor/git.wntrmute.dev/kyle/mcdsl/config/config.go +++ b/vendor/git.wntrmute.dev/mc/mcdsl/config/config.go @@ -34,7 +34,7 @@ import ( "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 diff --git a/vendor/git.wntrmute.dev/kyle/mcdsl/config/duration.go b/vendor/git.wntrmute.dev/mc/mcdsl/config/duration.go similarity index 100% rename from vendor/git.wntrmute.dev/kyle/mcdsl/config/duration.go rename to vendor/git.wntrmute.dev/mc/mcdsl/config/duration.go diff --git a/vendor/git.wntrmute.dev/kyle/mcdsl/db/db.go b/vendor/git.wntrmute.dev/mc/mcdsl/db/db.go similarity index 100% rename from vendor/git.wntrmute.dev/kyle/mcdsl/db/db.go rename to vendor/git.wntrmute.dev/mc/mcdsl/db/db.go diff --git a/vendor/git.wntrmute.dev/kyle/mcdsl/grpcserver/server.go b/vendor/git.wntrmute.dev/mc/mcdsl/grpcserver/server.go similarity index 99% rename from vendor/git.wntrmute.dev/kyle/mcdsl/grpcserver/server.go rename to vendor/git.wntrmute.dev/mc/mcdsl/grpcserver/server.go index 1fba879..57d8588 100644 --- a/vendor/git.wntrmute.dev/kyle/mcdsl/grpcserver/server.go +++ b/vendor/git.wntrmute.dev/mc/mcdsl/grpcserver/server.go @@ -21,7 +21,7 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - "git.wntrmute.dev/kyle/mcdsl/auth" + "git.wntrmute.dev/mc/mcdsl/auth" ) // MethodMap classifies gRPC methods for access control. diff --git a/vendor/modules.txt b/vendor/modules.txt index ebf539e..abd9b69 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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 -git.wntrmute.dev/kyle/mcdsl/auth -git.wntrmute.dev/kyle/mcdsl/config -git.wntrmute.dev/kyle/mcdsl/db -git.wntrmute.dev/kyle/mcdsl/grpcserver +git.wntrmute.dev/mc/mcdsl/auth +git.wntrmute.dev/mc/mcdsl/config +git.wntrmute.dev/mc/mcdsl/db +git.wntrmute.dev/mc/mcdsl/grpcserver # github.com/dustin/go-humanize v1.0.1 ## explicit; go 1.16 github.com/dustin/go-humanize