Skip to content

Commit 25d8b7b

Browse files
authored
add-v4
add v4 schema side-by-side of v3
2 parents 7959443 + 5e79287 commit 25d8b7b

File tree

6 files changed

+861
-2
lines changed

6 files changed

+861
-2
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
pull-requests: write
2020

2121
env:
22-
BUF_VERSION: "1.61.0"
22+
BUF_VERSION: "1.62.1"
2323

2424
jobs:
2525
build:

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ EXT_BIN_DIR := ${EXT_DIR}/bin
1616
EXT_TMP_DIR := ${EXT_DIR}/tmp
1717

1818
SVU_VER := 3.3.0
19-
BUF_VER := 1.61.0
19+
BUF_VER := 1.62.1
2020

2121
PROJECT := directory
2222
BUF_REPO := "buf.build/aserto-dev/${PROJECT}"
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
syntax = "proto3";
2+
3+
package aserto.directory.common.v4;
4+
5+
import "google/api/field_behavior.proto";
6+
import "google/protobuf/struct.proto";
7+
import "google/protobuf/timestamp.proto";
8+
9+
option go_package = "github.com/aserto-dev/go-directory/aserto/directory/common/v4;common";
10+
11+
// Manifest
12+
message Manifest {
13+
// manifest payload
14+
bytes body = 1;
15+
// last updated timestamp (UTC)
16+
google.protobuf.Timestamp updated_at = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
17+
// manifest instance etag
18+
string etag = 23 [(google.api.field_behavior) = OPTIONAL];
19+
}
20+
21+
// Model
22+
message Model {
23+
// model representation of manifest
24+
google.protobuf.Struct model = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
25+
// last updated timestamp (UTC)
26+
google.protobuf.Timestamp updated_at = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
27+
// manifest instance etag
28+
string etag = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
29+
}
30+
31+
// Object
32+
message Object {
33+
// object type name
34+
string object_type = 1 [(google.api.field_behavior) = REQUIRED];
35+
// external object identifier (cs-string, no spaces or tabs)
36+
string object_id = 2 [(google.api.field_behavior) = REQUIRED];
37+
// property bag
38+
google.protobuf.Struct properties = 4 [(google.api.field_behavior) = OPTIONAL];
39+
// last updated timestamp (UTC)
40+
google.protobuf.Timestamp updated_at = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
41+
// object instance etag
42+
string etag = 23 [(google.api.field_behavior) = OPTIONAL];
43+
}
44+
45+
// Relation
46+
message Relation {
47+
// object type
48+
string object_type = 1 [(google.api.field_behavior) = REQUIRED];
49+
// object identifier
50+
string object_id = 2 [(google.api.field_behavior) = REQUIRED];
51+
// object relation name
52+
string relation = 3 [(google.api.field_behavior) = REQUIRED];
53+
// subject type
54+
string subject_type = 4 [(google.api.field_behavior) = REQUIRED];
55+
// subject identifier
56+
string subject_id = 5 [(google.api.field_behavior) = REQUIRED];
57+
// optional subject relation name
58+
string subject_relation = 6 [(google.api.field_behavior) = OPTIONAL];
59+
// last updated timestamp (UTC)
60+
google.protobuf.Timestamp updated_at = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
61+
// object instance etag
62+
string etag = 23 [(google.api.field_behavior) = OPTIONAL];
63+
}
64+
65+
// Object identifier
66+
message ObjectIdentifier {
67+
// object type (lc-string)
68+
string object_type = 1 [(google.api.field_behavior) = REQUIRED];
69+
// object identifier (cs-string)
70+
string object_id = 2 [(google.api.field_behavior) = REQUIRED];
71+
}
72+
73+
// Relation identifier
74+
message RelationIdentifier {
75+
// object type
76+
string object_type = 1 [(google.api.field_behavior) = REQUIRED];
77+
// object identifier
78+
string object_id = 2 [(google.api.field_behavior) = REQUIRED];
79+
// object relation name
80+
string relation = 3 [(google.api.field_behavior) = REQUIRED];
81+
// subject type
82+
string subject_type = 4 [(google.api.field_behavior) = REQUIRED];
83+
// subject identifier
84+
string subject_id = 5 [(google.api.field_behavior) = REQUIRED];
85+
// optional subject relation name
86+
string subject_relation = 6 [(google.api.field_behavior) = OPTIONAL];
87+
}
88+
89+
// Pagination request
90+
message PaginationRequest {
91+
// requested page size, valid value between 1-100 rows (default 100)
92+
int32 size = 1 [(google.api.field_behavior) = OPTIONAL];
93+
// pagination start token, default ""
94+
string token = 2 [(google.api.field_behavior) = OPTIONAL];
95+
}
96+
97+
// Pagination response
98+
message PaginationResponse {
99+
// next page token, when empty there are no more pages to fetch
100+
string next_token = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
101+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
syntax = "proto3";
2+
3+
package aserto.directory.v4;
4+
5+
import "protoc-gen-openapiv2/options/annotations.proto";
6+
7+
option go_package = "github.com/aserto-dev/go-directory/aserto/directory/v4;directory";
8+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
9+
info: {
10+
title: "Directory Service"
11+
version: "4.0"
12+
contact: {
13+
name: "Aserto, Inc."
14+
url: "https://github.com/aserto-dev/pb-directory"
15+
email: "support@aserto.com"
16+
}
17+
license: {
18+
name: "Apache 2.0 License"
19+
url: "https://github.com/aserto-dev/pb-directory/blob/main/LICENSE"
20+
}
21+
}
22+
external_docs: {
23+
url: "https://docs.aserto.com"
24+
description: "Aserto API Reference."
25+
}
26+
27+
schemes: HTTP
28+
schemes: HTTPS
29+
schemes: WSS
30+
consumes: "application/json"
31+
produces: "application/json"
32+
33+
security_definitions: {
34+
security: {
35+
key: "AuthorizationHeader"
36+
value: {
37+
type: TYPE_API_KEY
38+
in: IN_HEADER
39+
name: "authorization"
40+
}
41+
}
42+
}
43+
security: {
44+
security_requirement: {
45+
key: "AuthorizationHeader"
46+
value: {}
47+
}
48+
}
49+
};

0 commit comments

Comments
 (0)