Files
mcr/proto/mcr/v1/policy.proto
Kyle Isom d5580f01f2 Migrate module path from kyle/ to mc/ org
All import paths updated to git.wntrmute.dev/mc/. Bumps mcdsl to v1.2.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 02:05:59 -07:00

77 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
package mcr.v1;
option go_package = "git.wntrmute.dev/mc/mcr/gen/mcr/v1;mcrv1";
import "mcr/v1/common.proto";
service PolicyService {
rpc ListPolicyRules(ListPolicyRulesRequest) returns (ListPolicyRulesResponse);
rpc CreatePolicyRule(CreatePolicyRuleRequest) returns (PolicyRule);
rpc GetPolicyRule(GetPolicyRuleRequest) returns (PolicyRule);
rpc UpdatePolicyRule(UpdatePolicyRuleRequest) returns (PolicyRule);
rpc DeletePolicyRule(DeletePolicyRuleRequest) returns (DeletePolicyRuleResponse);
}
message PolicyRule {
int64 id = 1;
int32 priority = 2;
string description = 3;
string effect = 4;
repeated string roles = 5;
repeated string account_types = 6;
string subject_uuid = 7;
repeated string actions = 8;
repeated string repositories = 9;
bool enabled = 10;
string created_by = 11;
string created_at = 12;
string updated_at = 13;
}
message ListPolicyRulesRequest {
PaginationRequest pagination = 1;
}
message ListPolicyRulesResponse {
repeated PolicyRule rules = 1;
}
message CreatePolicyRuleRequest {
int32 priority = 1;
string description = 2;
string effect = 3;
repeated string roles = 4;
repeated string account_types = 5;
string subject_uuid = 6;
repeated string actions = 7;
repeated string repositories = 8;
bool enabled = 9;
}
message GetPolicyRuleRequest {
int64 id = 1;
}
message UpdatePolicyRuleRequest {
int64 id = 1;
int32 priority = 2;
string description = 3;
string effect = 4;
repeated string roles = 5;
repeated string account_types = 6;
string subject_uuid = 7;
repeated string actions = 8;
repeated string repositories = 9;
bool enabled = 10;
// Field mask for partial updates — only fields listed here are applied.
repeated string update_mask = 11;
}
message DeletePolicyRuleRequest {
int64 id = 1;
}
message DeletePolicyRuleResponse {}