grpcctl: add auth login and policy commands
- Add auth/login and auth/logout to mciasgrpcctl, calling the existing AuthService.Login/Logout RPCs; password is always prompted interactively (term.ReadPassword), never accepted as a flag, raw bytes zeroed after use - Add proto/mcias/v1/policy.proto with PolicyService (List, Create, Get, Update, Delete policy rules) - Regenerate gen/mcias/v1/ stubs to include policy - Implement internal/grpcserver/policyservice.go delegating to the same db layer as the REST policy handlers - Register PolicyService in grpcserver.go - Add policy list/create/get/update/delete to mciasgrpcctl - Update mciasgrpcctl man page with new commands Security: auth login uses the same interactive password prompt pattern as mciasctl; password never appears in process args, shell history, or logs; raw bytes zeroed after string conversion (same as REST CLI and REST server). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.4
|
||||
// protoc v3.20.3
|
||||
// source: mcias/v1/account.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v6.33.4
|
||||
// - protoc v3.20.3
|
||||
// source: mcias/v1/account.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.4
|
||||
// protoc v3.20.3
|
||||
// source: mcias/v1/admin.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v6.33.4
|
||||
// - protoc v3.20.3
|
||||
// source: mcias/v1/admin.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.4
|
||||
// protoc v3.20.3
|
||||
// source: mcias/v1/auth.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v6.33.4
|
||||
// - protoc v3.20.3
|
||||
// source: mcias/v1/auth.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.4
|
||||
// protoc v3.20.3
|
||||
// source: mcias/v1/common.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
779
gen/mcias/v1/policy.pb.go
Normal file
779
gen/mcias/v1/policy.pb.go
Normal file
@@ -0,0 +1,779 @@
|
||||
// PolicyService: CRUD management of policy rules.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v3.20.3
|
||||
// source: mcias/v1/policy.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
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)
|
||||
)
|
||||
|
||||
// PolicyRule is the wire representation of a policy rule record.
|
||||
type PolicyRule struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Priority int32 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||
Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
RuleJson string `protobuf:"bytes,5,opt,name=rule_json,json=ruleJson,proto3" json:"rule_json,omitempty"` // JSON-encoded RuleBody
|
||||
CreatedAt string `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // RFC3339
|
||||
UpdatedAt string `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // RFC3339
|
||||
NotBefore string `protobuf:"bytes,8,opt,name=not_before,json=notBefore,proto3" json:"not_before,omitempty"` // RFC3339; empty if unset
|
||||
ExpiresAt string `protobuf:"bytes,9,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // RFC3339; empty if unset
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *PolicyRule) Reset() {
|
||||
*x = PolicyRule{}
|
||||
mi := &file_mcias_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_mcias_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_mcias_v1_policy_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetPriority() int32 {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetEnabled() bool {
|
||||
if x != nil {
|
||||
return x.Enabled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetRuleJson() string {
|
||||
if x != nil {
|
||||
return x.RuleJson
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetCreatedAt() string {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetUpdatedAt() string {
|
||||
if x != nil {
|
||||
return x.UpdatedAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetNotBefore() string {
|
||||
if x != nil {
|
||||
return x.NotBefore
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PolicyRule) GetExpiresAt() string {
|
||||
if x != nil {
|
||||
return x.ExpiresAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListPolicyRulesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListPolicyRulesRequest) Reset() {
|
||||
*x = ListPolicyRulesRequest{}
|
||||
mi := &file_mcias_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_mcias_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_mcias_v1_policy_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type ListPolicyRulesResponse struct {
|
||||
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_mcias_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_mcias_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_mcias_v1_policy_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListPolicyRulesResponse) GetRules() []*PolicyRule {
|
||||
if x != nil {
|
||||
return x.Rules
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CreatePolicyRuleRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` // required
|
||||
RuleJson string `protobuf:"bytes,2,opt,name=rule_json,json=ruleJson,proto3" json:"rule_json,omitempty"` // required; JSON-encoded RuleBody
|
||||
Priority int32 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"` // default 100 when zero
|
||||
NotBefore string `protobuf:"bytes,4,opt,name=not_before,json=notBefore,proto3" json:"not_before,omitempty"` // RFC3339; optional
|
||||
ExpiresAt string `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // RFC3339; optional
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleRequest) Reset() {
|
||||
*x = CreatePolicyRuleRequest{}
|
||||
mi := &file_mcias_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_mcias_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_mcias_v1_policy_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleRequest) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleRequest) GetRuleJson() string {
|
||||
if x != nil {
|
||||
return x.RuleJson
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleRequest) GetPriority() int32 {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleRequest) GetNotBefore() string {
|
||||
if x != nil {
|
||||
return x.NotBefore
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleRequest) GetExpiresAt() string {
|
||||
if x != nil {
|
||||
return x.ExpiresAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreatePolicyRuleResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Rule *PolicyRule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleResponse) Reset() {
|
||||
*x = CreatePolicyRuleResponse{}
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreatePolicyRuleResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CreatePolicyRuleResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_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 CreatePolicyRuleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CreatePolicyRuleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_policy_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *CreatePolicyRuleResponse) GetRule() *PolicyRule {
|
||||
if x != nil {
|
||||
return x.Rule
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetPolicyRuleRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetPolicyRuleRequest) Reset() {
|
||||
*x = GetPolicyRuleRequest{}
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[5]
|
||||
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_mcias_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 GetPolicyRuleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetPolicyRuleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_policy_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetPolicyRuleRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetPolicyRuleResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Rule *PolicyRule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetPolicyRuleResponse) Reset() {
|
||||
*x = GetPolicyRuleResponse{}
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetPolicyRuleResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetPolicyRuleResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetPolicyRuleResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_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 GetPolicyRuleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetPolicyRuleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_policy_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *GetPolicyRuleResponse) GetRule() *PolicyRule {
|
||||
if x != nil {
|
||||
return x.Rule
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdatePolicyRuleRequest carries partial updates.
|
||||
// Fields left at their zero value are not changed on the server, except:
|
||||
// - clear_not_before=true removes the not_before constraint
|
||||
// - clear_expires_at=true removes the expires_at constraint
|
||||
//
|
||||
// has_priority / has_enabled use proto3 optional (field presence) so the
|
||||
// server can distinguish "not supplied" from "set to zero/false".
|
||||
type UpdatePolicyRuleRequest struct {
|
||||
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,oneof" json:"priority,omitempty"` // omit to leave unchanged
|
||||
Enabled *bool `protobuf:"varint,3,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"` // omit to leave unchanged
|
||||
NotBefore string `protobuf:"bytes,4,opt,name=not_before,json=notBefore,proto3" json:"not_before,omitempty"` // RFC3339; ignored when clear_not_before=true
|
||||
ExpiresAt string `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // RFC3339; ignored when clear_expires_at=true
|
||||
ClearNotBefore bool `protobuf:"varint,6,opt,name=clear_not_before,json=clearNotBefore,proto3" json:"clear_not_before,omitempty"`
|
||||
ClearExpiresAt bool `protobuf:"varint,7,opt,name=clear_expires_at,json=clearExpiresAt,proto3" json:"clear_expires_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) Reset() {
|
||||
*x = UpdatePolicyRuleRequest{}
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[7]
|
||||
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_mcias_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 UpdatePolicyRuleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdatePolicyRuleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_policy_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) GetPriority() int32 {
|
||||
if x != nil && x.Priority != nil {
|
||||
return *x.Priority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) GetEnabled() bool {
|
||||
if x != nil && x.Enabled != nil {
|
||||
return *x.Enabled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) GetNotBefore() string {
|
||||
if x != nil {
|
||||
return x.NotBefore
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) GetExpiresAt() string {
|
||||
if x != nil {
|
||||
return x.ExpiresAt
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) GetClearNotBefore() bool {
|
||||
if x != nil {
|
||||
return x.ClearNotBefore
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleRequest) GetClearExpiresAt() bool {
|
||||
if x != nil {
|
||||
return x.ClearExpiresAt
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type UpdatePolicyRuleResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Rule *PolicyRule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleResponse) Reset() {
|
||||
*x = UpdatePolicyRuleResponse{}
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdatePolicyRuleResponse) ProtoMessage() {}
|
||||
|
||||
func (x *UpdatePolicyRuleResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UpdatePolicyRuleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UpdatePolicyRuleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_policy_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *UpdatePolicyRuleResponse) GetRule() *PolicyRule {
|
||||
if x != nil {
|
||||
return x.Rule
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DeletePolicyRuleRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeletePolicyRuleRequest) Reset() {
|
||||
*x = DeletePolicyRuleRequest{}
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[9]
|
||||
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_mcias_v1_policy_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeletePolicyRuleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeletePolicyRuleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_policy_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *DeletePolicyRuleRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type DeletePolicyRuleResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeletePolicyRuleResponse) Reset() {
|
||||
*x = DeletePolicyRuleResponse{}
|
||||
mi := &file_mcias_v1_policy_proto_msgTypes[10]
|
||||
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_mcias_v1_policy_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeletePolicyRuleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeletePolicyRuleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_mcias_v1_policy_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
var File_mcias_v1_policy_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_mcias_v1_policy_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x15mcias/v1/policy.proto\x12\bmcias.v1\"\x8d\x02\n" +
|
||||
"\n" +
|
||||
"PolicyRule\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12 \n" +
|
||||
"\vdescription\x18\x02 \x01(\tR\vdescription\x12\x1a\n" +
|
||||
"\bpriority\x18\x03 \x01(\x05R\bpriority\x12\x18\n" +
|
||||
"\aenabled\x18\x04 \x01(\bR\aenabled\x12\x1b\n" +
|
||||
"\trule_json\x18\x05 \x01(\tR\bruleJson\x12\x1d\n" +
|
||||
"\n" +
|
||||
"created_at\x18\x06 \x01(\tR\tcreatedAt\x12\x1d\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\a \x01(\tR\tupdatedAt\x12\x1d\n" +
|
||||
"\n" +
|
||||
"not_before\x18\b \x01(\tR\tnotBefore\x12\x1d\n" +
|
||||
"\n" +
|
||||
"expires_at\x18\t \x01(\tR\texpiresAt\"\x18\n" +
|
||||
"\x16ListPolicyRulesRequest\"E\n" +
|
||||
"\x17ListPolicyRulesResponse\x12*\n" +
|
||||
"\x05rules\x18\x01 \x03(\v2\x14.mcias.v1.PolicyRuleR\x05rules\"\xb2\x01\n" +
|
||||
"\x17CreatePolicyRuleRequest\x12 \n" +
|
||||
"\vdescription\x18\x01 \x01(\tR\vdescription\x12\x1b\n" +
|
||||
"\trule_json\x18\x02 \x01(\tR\bruleJson\x12\x1a\n" +
|
||||
"\bpriority\x18\x03 \x01(\x05R\bpriority\x12\x1d\n" +
|
||||
"\n" +
|
||||
"not_before\x18\x04 \x01(\tR\tnotBefore\x12\x1d\n" +
|
||||
"\n" +
|
||||
"expires_at\x18\x05 \x01(\tR\texpiresAt\"D\n" +
|
||||
"\x18CreatePolicyRuleResponse\x12(\n" +
|
||||
"\x04rule\x18\x01 \x01(\v2\x14.mcias.v1.PolicyRuleR\x04rule\"&\n" +
|
||||
"\x14GetPolicyRuleRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\"A\n" +
|
||||
"\x15GetPolicyRuleResponse\x12(\n" +
|
||||
"\x04rule\x18\x01 \x01(\v2\x14.mcias.v1.PolicyRuleR\x04rule\"\x94\x02\n" +
|
||||
"\x17UpdatePolicyRuleRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1f\n" +
|
||||
"\bpriority\x18\x02 \x01(\x05H\x00R\bpriority\x88\x01\x01\x12\x1d\n" +
|
||||
"\aenabled\x18\x03 \x01(\bH\x01R\aenabled\x88\x01\x01\x12\x1d\n" +
|
||||
"\n" +
|
||||
"not_before\x18\x04 \x01(\tR\tnotBefore\x12\x1d\n" +
|
||||
"\n" +
|
||||
"expires_at\x18\x05 \x01(\tR\texpiresAt\x12(\n" +
|
||||
"\x10clear_not_before\x18\x06 \x01(\bR\x0eclearNotBefore\x12(\n" +
|
||||
"\x10clear_expires_at\x18\a \x01(\bR\x0eclearExpiresAtB\v\n" +
|
||||
"\t_priorityB\n" +
|
||||
"\n" +
|
||||
"\b_enabled\"D\n" +
|
||||
"\x18UpdatePolicyRuleResponse\x12(\n" +
|
||||
"\x04rule\x18\x01 \x01(\v2\x14.mcias.v1.PolicyRuleR\x04rule\")\n" +
|
||||
"\x17DeletePolicyRuleRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\"\x1a\n" +
|
||||
"\x18DeletePolicyRuleResponse2\xca\x03\n" +
|
||||
"\rPolicyService\x12V\n" +
|
||||
"\x0fListPolicyRules\x12 .mcias.v1.ListPolicyRulesRequest\x1a!.mcias.v1.ListPolicyRulesResponse\x12Y\n" +
|
||||
"\x10CreatePolicyRule\x12!.mcias.v1.CreatePolicyRuleRequest\x1a\".mcias.v1.CreatePolicyRuleResponse\x12P\n" +
|
||||
"\rGetPolicyRule\x12\x1e.mcias.v1.GetPolicyRuleRequest\x1a\x1f.mcias.v1.GetPolicyRuleResponse\x12Y\n" +
|
||||
"\x10UpdatePolicyRule\x12!.mcias.v1.UpdatePolicyRuleRequest\x1a\".mcias.v1.UpdatePolicyRuleResponse\x12Y\n" +
|
||||
"\x10DeletePolicyRule\x12!.mcias.v1.DeletePolicyRuleRequest\x1a\".mcias.v1.DeletePolicyRuleResponseB2Z0git.wntrmute.dev/kyle/mcias/gen/mcias/v1;mciasv1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_mcias_v1_policy_proto_rawDescOnce sync.Once
|
||||
file_mcias_v1_policy_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_mcias_v1_policy_proto_rawDescGZIP() []byte {
|
||||
file_mcias_v1_policy_proto_rawDescOnce.Do(func() {
|
||||
file_mcias_v1_policy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mcias_v1_policy_proto_rawDesc), len(file_mcias_v1_policy_proto_rawDesc)))
|
||||
})
|
||||
return file_mcias_v1_policy_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mcias_v1_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_mcias_v1_policy_proto_goTypes = []any{
|
||||
(*PolicyRule)(nil), // 0: mcias.v1.PolicyRule
|
||||
(*ListPolicyRulesRequest)(nil), // 1: mcias.v1.ListPolicyRulesRequest
|
||||
(*ListPolicyRulesResponse)(nil), // 2: mcias.v1.ListPolicyRulesResponse
|
||||
(*CreatePolicyRuleRequest)(nil), // 3: mcias.v1.CreatePolicyRuleRequest
|
||||
(*CreatePolicyRuleResponse)(nil), // 4: mcias.v1.CreatePolicyRuleResponse
|
||||
(*GetPolicyRuleRequest)(nil), // 5: mcias.v1.GetPolicyRuleRequest
|
||||
(*GetPolicyRuleResponse)(nil), // 6: mcias.v1.GetPolicyRuleResponse
|
||||
(*UpdatePolicyRuleRequest)(nil), // 7: mcias.v1.UpdatePolicyRuleRequest
|
||||
(*UpdatePolicyRuleResponse)(nil), // 8: mcias.v1.UpdatePolicyRuleResponse
|
||||
(*DeletePolicyRuleRequest)(nil), // 9: mcias.v1.DeletePolicyRuleRequest
|
||||
(*DeletePolicyRuleResponse)(nil), // 10: mcias.v1.DeletePolicyRuleResponse
|
||||
}
|
||||
var file_mcias_v1_policy_proto_depIdxs = []int32{
|
||||
0, // 0: mcias.v1.ListPolicyRulesResponse.rules:type_name -> mcias.v1.PolicyRule
|
||||
0, // 1: mcias.v1.CreatePolicyRuleResponse.rule:type_name -> mcias.v1.PolicyRule
|
||||
0, // 2: mcias.v1.GetPolicyRuleResponse.rule:type_name -> mcias.v1.PolicyRule
|
||||
0, // 3: mcias.v1.UpdatePolicyRuleResponse.rule:type_name -> mcias.v1.PolicyRule
|
||||
1, // 4: mcias.v1.PolicyService.ListPolicyRules:input_type -> mcias.v1.ListPolicyRulesRequest
|
||||
3, // 5: mcias.v1.PolicyService.CreatePolicyRule:input_type -> mcias.v1.CreatePolicyRuleRequest
|
||||
5, // 6: mcias.v1.PolicyService.GetPolicyRule:input_type -> mcias.v1.GetPolicyRuleRequest
|
||||
7, // 7: mcias.v1.PolicyService.UpdatePolicyRule:input_type -> mcias.v1.UpdatePolicyRuleRequest
|
||||
9, // 8: mcias.v1.PolicyService.DeletePolicyRule:input_type -> mcias.v1.DeletePolicyRuleRequest
|
||||
2, // 9: mcias.v1.PolicyService.ListPolicyRules:output_type -> mcias.v1.ListPolicyRulesResponse
|
||||
4, // 10: mcias.v1.PolicyService.CreatePolicyRule:output_type -> mcias.v1.CreatePolicyRuleResponse
|
||||
6, // 11: mcias.v1.PolicyService.GetPolicyRule:output_type -> mcias.v1.GetPolicyRuleResponse
|
||||
8, // 12: mcias.v1.PolicyService.UpdatePolicyRule:output_type -> mcias.v1.UpdatePolicyRuleResponse
|
||||
10, // 13: mcias.v1.PolicyService.DeletePolicyRule:output_type -> mcias.v1.DeletePolicyRuleResponse
|
||||
9, // [9:14] is the sub-list for method output_type
|
||||
4, // [4:9] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_mcias_v1_policy_proto_init() }
|
||||
func file_mcias_v1_policy_proto_init() {
|
||||
if File_mcias_v1_policy_proto != nil {
|
||||
return
|
||||
}
|
||||
file_mcias_v1_policy_proto_msgTypes[7].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mcias_v1_policy_proto_rawDesc), len(file_mcias_v1_policy_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mcias_v1_policy_proto_goTypes,
|
||||
DependencyIndexes: file_mcias_v1_policy_proto_depIdxs,
|
||||
MessageInfos: file_mcias_v1_policy_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mcias_v1_policy_proto = out.File
|
||||
file_mcias_v1_policy_proto_goTypes = nil
|
||||
file_mcias_v1_policy_proto_depIdxs = nil
|
||||
}
|
||||
299
gen/mcias/v1/policy_grpc.pb.go
Normal file
299
gen/mcias/v1/policy_grpc.pb.go
Normal file
@@ -0,0 +1,299 @@
|
||||
// PolicyService: CRUD management of policy rules.
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v3.20.3
|
||||
// source: mcias/v1/policy.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
PolicyService_ListPolicyRules_FullMethodName = "/mcias.v1.PolicyService/ListPolicyRules"
|
||||
PolicyService_CreatePolicyRule_FullMethodName = "/mcias.v1.PolicyService/CreatePolicyRule"
|
||||
PolicyService_GetPolicyRule_FullMethodName = "/mcias.v1.PolicyService/GetPolicyRule"
|
||||
PolicyService_UpdatePolicyRule_FullMethodName = "/mcias.v1.PolicyService/UpdatePolicyRule"
|
||||
PolicyService_DeletePolicyRule_FullMethodName = "/mcias.v1.PolicyService/DeletePolicyRule"
|
||||
)
|
||||
|
||||
// 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.
|
||||
//
|
||||
// PolicyService manages policy rules (admin only).
|
||||
type PolicyServiceClient interface {
|
||||
// ListPolicyRules returns all policy rules.
|
||||
// Requires: admin JWT.
|
||||
ListPolicyRules(ctx context.Context, in *ListPolicyRulesRequest, opts ...grpc.CallOption) (*ListPolicyRulesResponse, error)
|
||||
// CreatePolicyRule creates a new policy rule.
|
||||
// Requires: admin JWT.
|
||||
CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*CreatePolicyRuleResponse, error)
|
||||
// GetPolicyRule returns a single policy rule by ID.
|
||||
// Requires: admin JWT.
|
||||
GetPolicyRule(ctx context.Context, in *GetPolicyRuleRequest, opts ...grpc.CallOption) (*GetPolicyRuleResponse, error)
|
||||
// UpdatePolicyRule applies a partial update to a policy rule.
|
||||
// Requires: admin JWT.
|
||||
UpdatePolicyRule(ctx context.Context, in *UpdatePolicyRuleRequest, opts ...grpc.CallOption) (*UpdatePolicyRuleResponse, error)
|
||||
// DeletePolicyRule permanently removes a policy rule.
|
||||
// Requires: admin JWT.
|
||||
DeletePolicyRule(ctx context.Context, in *DeletePolicyRuleRequest, opts ...grpc.CallOption) (*DeletePolicyRuleResponse, error)
|
||||
}
|
||||
|
||||
type policyServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
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, PolicyService_ListPolicyRules_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *policyServiceClient) CreatePolicyRule(ctx context.Context, in *CreatePolicyRuleRequest, opts ...grpc.CallOption) (*CreatePolicyRuleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreatePolicyRuleResponse)
|
||||
err := c.cc.Invoke(ctx, PolicyService_CreatePolicyRule_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *policyServiceClient) GetPolicyRule(ctx context.Context, in *GetPolicyRuleRequest, opts ...grpc.CallOption) (*GetPolicyRuleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPolicyRuleResponse)
|
||||
err := c.cc.Invoke(ctx, PolicyService_GetPolicyRule_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *policyServiceClient) UpdatePolicyRule(ctx context.Context, in *UpdatePolicyRuleRequest, opts ...grpc.CallOption) (*UpdatePolicyRuleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdatePolicyRuleResponse)
|
||||
err := c.cc.Invoke(ctx, PolicyService_UpdatePolicyRule_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
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, 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.
|
||||
//
|
||||
// PolicyService manages policy rules (admin only).
|
||||
type PolicyServiceServer interface {
|
||||
// ListPolicyRules returns all policy rules.
|
||||
// Requires: admin JWT.
|
||||
ListPolicyRules(context.Context, *ListPolicyRulesRequest) (*ListPolicyRulesResponse, error)
|
||||
// CreatePolicyRule creates a new policy rule.
|
||||
// Requires: admin JWT.
|
||||
CreatePolicyRule(context.Context, *CreatePolicyRuleRequest) (*CreatePolicyRuleResponse, error)
|
||||
// GetPolicyRule returns a single policy rule by ID.
|
||||
// Requires: admin JWT.
|
||||
GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*GetPolicyRuleResponse, error)
|
||||
// UpdatePolicyRule applies a partial update to a policy rule.
|
||||
// Requires: admin JWT.
|
||||
UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*UpdatePolicyRuleResponse, error)
|
||||
// DeletePolicyRule permanently removes a policy rule.
|
||||
// Requires: admin JWT.
|
||||
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) (*CreatePolicyRuleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreatePolicyRule not implemented")
|
||||
}
|
||||
func (UnimplementedPolicyServiceServer) GetPolicyRule(context.Context, *GetPolicyRuleRequest) (*GetPolicyRuleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPolicyRule not implemented")
|
||||
}
|
||||
func (UnimplementedPolicyServiceServer) UpdatePolicyRule(context.Context, *UpdatePolicyRuleRequest) (*UpdatePolicyRuleResponse, 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: "mcias.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: "mcias/v1/policy.proto",
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.33.4
|
||||
// protoc v3.20.3
|
||||
// source: mcias/v1/token.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v6.33.4
|
||||
// - protoc v3.20.3
|
||||
// source: mcias/v1/token.proto
|
||||
|
||||
package mciasv1
|
||||
|
||||
Reference in New Issue
Block a user