photoncloud-monorepo/prismnet/crates/prismnet-api/proto/prismnet.proto
centra d2149b6249 fix(lightningstor): Fix SigV4 canonicalization for AWS S3 auth
- Replace form_urlencoded with RFC 3986 compliant URI encoding
- Implement aws_uri_encode() matching AWS SigV4 spec exactly
- Unreserved chars (A-Z,a-z,0-9,-,_,.,~) not encoded
- All other chars percent-encoded with uppercase hex
- Preserve slashes in paths, encode in query params
- Normalize empty paths to '/' per AWS spec
- Fix test expectations (body hash, HMAC values)
- Add comprehensive SigV4 signature determinism test

This fixes the canonicalization mismatch that caused signature
validation failures in T047. Auth can now be enabled for production.

Refs: T058.S1
2025-12-12 06:23:46 +09:00

451 lines
9.7 KiB
Protocol Buffer

syntax = "proto3";
package prismnet;
// =============================================================================
// VPC Service
// =============================================================================
service VpcService {
rpc CreateVpc(CreateVpcRequest) returns (CreateVpcResponse);
rpc GetVpc(GetVpcRequest) returns (GetVpcResponse);
rpc ListVpcs(ListVpcsRequest) returns (ListVpcsResponse);
rpc UpdateVpc(UpdateVpcRequest) returns (UpdateVpcResponse);
rpc DeleteVpc(DeleteVpcRequest) returns (DeleteVpcResponse);
}
message Vpc {
string id = 1;
string org_id = 2;
string project_id = 3;
string name = 4;
string description = 5;
string cidr_block = 6;
VpcStatus status = 7;
uint64 created_at = 8;
uint64 updated_at = 9;
}
enum VpcStatus {
VPC_STATUS_UNSPECIFIED = 0;
VPC_STATUS_PROVISIONING = 1;
VPC_STATUS_ACTIVE = 2;
VPC_STATUS_UPDATING = 3;
VPC_STATUS_DELETING = 4;
VPC_STATUS_ERROR = 5;
}
message CreateVpcRequest {
string org_id = 1;
string project_id = 2;
string name = 3;
string description = 4;
string cidr_block = 5;
}
message CreateVpcResponse {
Vpc vpc = 1;
}
message GetVpcRequest {
string org_id = 1;
string project_id = 2;
string id = 3;
}
message GetVpcResponse {
Vpc vpc = 1;
}
message ListVpcsRequest {
string org_id = 1;
string project_id = 2;
int32 page_size = 3;
string page_token = 4;
}
message ListVpcsResponse {
repeated Vpc vpcs = 1;
string next_page_token = 2;
}
message UpdateVpcRequest {
string org_id = 1;
string project_id = 2;
string id = 3;
string name = 4;
string description = 5;
}
message UpdateVpcResponse {
Vpc vpc = 1;
}
message DeleteVpcRequest {
string org_id = 1;
string project_id = 2;
string id = 3;
}
message DeleteVpcResponse {}
// =============================================================================
// Subnet Service
// =============================================================================
service SubnetService {
rpc CreateSubnet(CreateSubnetRequest) returns (CreateSubnetResponse);
rpc GetSubnet(GetSubnetRequest) returns (GetSubnetResponse);
rpc ListSubnets(ListSubnetsRequest) returns (ListSubnetsResponse);
rpc UpdateSubnet(UpdateSubnetRequest) returns (UpdateSubnetResponse);
rpc DeleteSubnet(DeleteSubnetRequest) returns (DeleteSubnetResponse);
}
message Subnet {
string id = 1;
string vpc_id = 2;
string name = 3;
string description = 4;
string cidr_block = 5;
string gateway_ip = 6;
bool dhcp_enabled = 7;
repeated string dns_servers = 8;
SubnetStatus status = 9;
uint64 created_at = 10;
uint64 updated_at = 11;
}
enum SubnetStatus {
SUBNET_STATUS_UNSPECIFIED = 0;
SUBNET_STATUS_PROVISIONING = 1;
SUBNET_STATUS_ACTIVE = 2;
SUBNET_STATUS_UPDATING = 3;
SUBNET_STATUS_DELETING = 4;
SUBNET_STATUS_ERROR = 5;
}
message CreateSubnetRequest {
string vpc_id = 1;
string name = 2;
string description = 3;
string cidr_block = 4;
string gateway_ip = 5;
bool dhcp_enabled = 6;
}
message CreateSubnetResponse {
Subnet subnet = 1;
}
message GetSubnetRequest {
string org_id = 1;
string project_id = 2;
string vpc_id = 3;
string id = 4;
}
message GetSubnetResponse {
Subnet subnet = 1;
}
message ListSubnetsRequest {
string org_id = 1;
string project_id = 2;
string vpc_id = 3;
int32 page_size = 4;
string page_token = 5;
}
message ListSubnetsResponse {
repeated Subnet subnets = 1;
string next_page_token = 2;
}
message UpdateSubnetRequest {
string org_id = 1;
string project_id = 2;
string vpc_id = 3;
string id = 4;
string name = 5;
string description = 6;
bool dhcp_enabled = 7;
}
message UpdateSubnetResponse {
Subnet subnet = 1;
}
message DeleteSubnetRequest {
string org_id = 1;
string project_id = 2;
string vpc_id = 3;
string id = 4;
}
message DeleteSubnetResponse {}
// =============================================================================
// Port Service
// =============================================================================
service PortService {
rpc CreatePort(CreatePortRequest) returns (CreatePortResponse);
rpc GetPort(GetPortRequest) returns (GetPortResponse);
rpc ListPorts(ListPortsRequest) returns (ListPortsResponse);
rpc UpdatePort(UpdatePortRequest) returns (UpdatePortResponse);
rpc DeletePort(DeletePortRequest) returns (DeletePortResponse);
rpc AttachDevice(AttachDeviceRequest) returns (AttachDeviceResponse);
rpc DetachDevice(DetachDeviceRequest) returns (DetachDeviceResponse);
}
message Port {
string id = 1;
string subnet_id = 2;
string name = 3;
string description = 4;
string mac_address = 5;
string ip_address = 6;
string device_id = 7;
DeviceType device_type = 8;
repeated string security_group_ids = 9;
bool admin_state_up = 10;
PortStatus status = 11;
uint64 created_at = 12;
uint64 updated_at = 13;
}
enum PortStatus {
PORT_STATUS_UNSPECIFIED = 0;
PORT_STATUS_BUILD = 1;
PORT_STATUS_ACTIVE = 2;
PORT_STATUS_DOWN = 3;
PORT_STATUS_ERROR = 4;
}
enum DeviceType {
DEVICE_TYPE_UNSPECIFIED = 0;
DEVICE_TYPE_NONE = 1;
DEVICE_TYPE_VM = 2;
DEVICE_TYPE_ROUTER = 3;
DEVICE_TYPE_LOAD_BALANCER = 4;
DEVICE_TYPE_DHCP_SERVER = 5;
DEVICE_TYPE_OTHER = 6;
}
message CreatePortRequest {
string org_id = 1;
string project_id = 2;
string subnet_id = 3;
string name = 4;
string description = 5;
string ip_address = 6;
repeated string security_group_ids = 7;
}
message CreatePortResponse {
Port port = 1;
}
message GetPortRequest {
string org_id = 1;
string project_id = 2;
string subnet_id = 3;
string id = 4;
}
message GetPortResponse {
Port port = 1;
}
message ListPortsRequest {
string org_id = 1;
string project_id = 2;
string subnet_id = 3;
string device_id = 4;
int32 page_size = 5;
string page_token = 6;
}
message ListPortsResponse {
repeated Port ports = 1;
string next_page_token = 2;
}
message UpdatePortRequest {
string org_id = 1;
string project_id = 2;
string subnet_id = 3;
string id = 4;
string name = 5;
string description = 6;
repeated string security_group_ids = 7;
bool admin_state_up = 8;
}
message UpdatePortResponse {
Port port = 1;
}
message DeletePortRequest {
string org_id = 1;
string project_id = 2;
string subnet_id = 3;
string id = 4;
}
message DeletePortResponse {}
message AttachDeviceRequest {
string org_id = 1;
string project_id = 2;
string subnet_id = 3;
string port_id = 4;
string device_id = 5;
DeviceType device_type = 6;
}
message AttachDeviceResponse {
Port port = 1;
}
message DetachDeviceRequest {
string org_id = 1;
string project_id = 2;
string subnet_id = 3;
string port_id = 4;
}
message DetachDeviceResponse {
Port port = 1;
}
// =============================================================================
// Security Group Service
// =============================================================================
service SecurityGroupService {
rpc CreateSecurityGroup(CreateSecurityGroupRequest) returns (CreateSecurityGroupResponse);
rpc GetSecurityGroup(GetSecurityGroupRequest) returns (GetSecurityGroupResponse);
rpc ListSecurityGroups(ListSecurityGroupsRequest) returns (ListSecurityGroupsResponse);
rpc UpdateSecurityGroup(UpdateSecurityGroupRequest) returns (UpdateSecurityGroupResponse);
rpc DeleteSecurityGroup(DeleteSecurityGroupRequest) returns (DeleteSecurityGroupResponse);
rpc AddRule(AddRuleRequest) returns (AddRuleResponse);
rpc RemoveRule(RemoveRuleRequest) returns (RemoveRuleResponse);
}
message SecurityGroup {
string id = 1;
string project_id = 2;
string name = 3;
string description = 4;
repeated SecurityGroupRule rules = 5;
uint64 created_at = 6;
uint64 updated_at = 7;
}
message SecurityGroupRule {
string id = 1;
string security_group_id = 2;
RuleDirection direction = 3;
IpProtocol protocol = 4;
uint32 port_range_min = 5;
uint32 port_range_max = 6;
string remote_cidr = 7;
string remote_group_id = 8;
string description = 9;
uint64 created_at = 10;
}
enum RuleDirection {
RULE_DIRECTION_UNSPECIFIED = 0;
RULE_DIRECTION_INGRESS = 1;
RULE_DIRECTION_EGRESS = 2;
}
enum IpProtocol {
IP_PROTOCOL_UNSPECIFIED = 0;
IP_PROTOCOL_ANY = 1;
IP_PROTOCOL_TCP = 2;
IP_PROTOCOL_UDP = 3;
IP_PROTOCOL_ICMP = 4;
IP_PROTOCOL_ICMPV6 = 5;
}
message CreateSecurityGroupRequest {
string org_id = 1;
string project_id = 2;
string name = 3;
string description = 4;
}
message CreateSecurityGroupResponse {
SecurityGroup security_group = 1;
}
message GetSecurityGroupRequest {
string org_id = 1;
string project_id = 2;
string id = 3;
}
message GetSecurityGroupResponse {
SecurityGroup security_group = 1;
}
message ListSecurityGroupsRequest {
string org_id = 1;
string project_id = 2;
int32 page_size = 3;
string page_token = 4;
}
message ListSecurityGroupsResponse {
repeated SecurityGroup security_groups = 1;
string next_page_token = 2;
}
message UpdateSecurityGroupRequest {
string org_id = 1;
string project_id = 2;
string id = 3;
string name = 4;
string description = 5;
}
message UpdateSecurityGroupResponse {
SecurityGroup security_group = 1;
}
message DeleteSecurityGroupRequest {
string org_id = 1;
string project_id = 2;
string id = 3;
}
message DeleteSecurityGroupResponse {}
message AddRuleRequest {
string org_id = 1;
string project_id = 2;
string security_group_id = 3;
RuleDirection direction = 4;
IpProtocol protocol = 5;
uint32 port_range_min = 6;
uint32 port_range_max = 7;
string remote_cidr = 8;
string remote_group_id = 9;
string description = 10;
}
message AddRuleResponse {
SecurityGroupRule rule = 1;
}
message RemoveRuleRequest {
string org_id = 1;
string project_id = 2;
string security_group_id = 3;
string rule_id = 4;
}
message RemoveRuleResponse {}