-
Notifications
You must be signed in to change notification settings - Fork 0
/
policy.proto
83 lines (71 loc) · 1.99 KB
/
policy.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
syntax = "proto3";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "path.proto";
import "common.proto";
package hoppipolla.policy;
// Body responsible for issuing a policy.
//
// It can be a governmental entity, an association, an organization,
// or even an individual.
message Issuer {
string id = 1;
string name = 2;
optional string description = 3;
}
// Policy validating a path based on hops and relative NIP data using
// Hoppipolla ASP conventions.
message Policy {
string id = 1;
string issuer_id = 2;
bool active = 3;
string statements = 4;
optional string description = 5;
}
service PolicyManager {
rpc CreatePolicy(CreatePolicyRequest) returns (CreatePolicyResponse) {}
rpc DeletePolicy(DeletePolicyRequest) returns (google.protobuf.Empty) {}
rpc CreateIssuer(CreateIssuerRequest) returns (CreateIssuerResponse) {}
rpc ListPolicies(google.protobuf.Empty) returns (ListPoliciesResponse) {}
rpc ValidatePath(ValidatePathRequest) returns (ValidatePathResponse) {}
rpc GetLatestPolicyTimestamp(google.protobuf.Empty)
returns (GetLatestPolicyTimestampResponse) {}
rpc GetDefaultIssuer(google.protobuf.Empty)
returns (GetDefaultIssuerResponse) {}
}
message CreatePolicyRequest {
string issuer_id = 1;
string statements = 2;
optional string description = 3;
}
message CreatePolicyResponse {
string id = 1;
}
message DeletePolicyRequest {
string id = 1;
}
message CreateIssuerRequest {
string name = 1;
}
message CreateIssuerResponse {
string id = 1;
}
message ListPoliciesResponse {
repeated Policy policies = 1;
}
message ValidatePathRequest {
hoppipolla.path.Path path = 1;
optional hoppipolla.common.Interval data_interval = 2;
}
message ValidatePathResponse {
string fingerprint = 1;
bool valid = 2;
}
message GetLatestPolicyTimestampResponse {
google.protobuf.Timestamp timestamp = 1;
}
message GetDefaultIssuerResponse {
string id = 1;
string name = 2;
optional string description = 3;
}