Skip to content

Commit b3a1f6d

Browse files
authored
Define alpha public authentication status API (#64)
* Define public authentication status API * Move authentication status API to v1alpha1 * Fix Buf formatting for nil UUID validation * Fix Buf 1.72 checks
1 parent 6ae9dfa commit b3a1f6d

8 files changed

Lines changed: 70 additions & 10 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Public API for resolving the identity associated with an authenticated request.
2+
3+
edition = "2023";
4+
5+
package authentication.v1alpha1;
6+
7+
import "buf/validate/validate.proto";
8+
import "tilebox/v1/id.proto";
9+
10+
option features.field_presence = IMPLICIT;
11+
12+
// User is the Tilebox user associated with an authenticated request.
13+
message User {
14+
// The user's Tilebox ID.
15+
tilebox.v1.ID id = 1 [(buf.validate.field).required = true];
16+
// The user's display name.
17+
string name = 2;
18+
// The user's email address.
19+
string email = 3;
20+
}
21+
22+
// Organization is the Tilebox organization associated with an authenticated request.
23+
message Organization {
24+
// The organization's Tilebox ID.
25+
tilebox.v1.ID id = 1 [(buf.validate.field).required = true];
26+
// The organization's display name.
27+
string name = 2;
28+
// The organization's unique slug.
29+
string slug = 3;
30+
}
31+
32+
// APIKey identifies an API key without exposing its secret.
33+
message APIKey {
34+
// The API key's Tilebox ID.
35+
tilebox.v1.ID id = 1 [(buf.validate.field).required = true];
36+
// The non-secret identifier embedded in the API key.
37+
string identifier = 2;
38+
// The API key's user-provided description.
39+
string description = 3;
40+
}
41+
42+
// GetAuthenticationStatusRequest requests the identity associated with the calling credential.
43+
message GetAuthenticationStatusRequest {}
44+
45+
// AuthenticationStatus describes the identity associated with the calling credential.
46+
message AuthenticationStatus {
47+
// The authenticated user.
48+
User user = 1 [(buf.validate.field).required = true];
49+
// The organization the request acts within.
50+
Organization organization = 2 [(buf.validate.field).required = true];
51+
// The API key used to authenticate the request. Unset for JWT or session authentication.
52+
APIKey api_key = 3;
53+
}
54+
55+
// AuthenticationService exposes information about the effective authentication of a request.
56+
service AuthenticationService {
57+
// GetAuthenticationStatus resolves the calling credential to its effective user and organization.
58+
// Requests without valid authentication fail with UNAUTHENTICATED.
59+
rpc GetAuthenticationStatus(GetAuthenticationStatusRequest) returns (AuthenticationStatus) {}
60+
}

‎apis/datasets/stac/v1/processing.proto‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ option features.field_presence = IMPLICIT;
1111

1212
// ProcessingSoftware maps each application or library name to its version, tag, commit, or equivalent identifier.
1313
message ProcessingSoftware {
14-
map<string, string> versions = 1 [(buf.validate.field).map = {keys: {string: {min_len: 1}}}];
14+
map<string, string> versions = 1 [(buf.validate.field).map = {
15+
keys: {
16+
string: {min_len: 1}
17+
}
18+
}];
1519
}

‎apis/tilebox/v1/id.proto‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ option features.field_presence = IMPLICIT;
1010
message ID {
1111
bytes uuid = 1 [(buf.validate.field).bytes = {
1212
len: 16
13-
not_in: [
14-
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // Nil UUID
15-
]
13+
// Nil UUID.
14+
not_in: ["\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"]
1615
}];
1716
}

‎apis/workflows/v1/core.proto‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ message TaskSubmissionGroup {
261261
// to enable packed encoding of the repeated fields.
262262
repeated bytes inputs = 2 [(buf.validate.field).repeated = {
263263
min_items: 1 // we don't allow empty submission groups
264-
items: {bytes: {max_len: 2048}}
264+
items: {
265+
bytes: {max_len: 2048}
266+
}
265267
}];
266268
// Index of the task identifier in the identifier_lookup field of the containing TaskSubmissions message
267269
// for each task.

‎apis/workflows/v1/job.proto‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ edition = "2023";
55
package workflows.v1;
66

77
import "buf/validate/validate.proto";
8-
import "opentelemetry/proto/logs/v1/logs.proto";
9-
import "opentelemetry/proto/trace/v1/trace.proto";
108
import "tilebox/v1/id.proto";
119
import "tilebox/v1/query.proto";
1210
import "workflows/v1/core.proto";

‎apis/workflows/v1/telemetry.proto‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ edition = "2023";
33
package workflows.v1;
44

55
import "buf/validate/validate.proto";
6-
import "google/protobuf/timestamp.proto";
76
import "opentelemetry/proto/logs/v1/logs.proto";
87
import "opentelemetry/proto/trace/v1/trace.proto";
98
import "tilebox/v1/id.proto";

‎apis/workflows/v1/worker.proto‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package workflows.v1;
55
import "buf/validate/validate.proto";
66
import "google/protobuf/empty.proto";
77
import "tilebox/v1/id.proto";
8-
import "workflows/v1/automation.proto";
98
import "workflows/v1/core.proto";
109
import "workflows/v1/task.proto";
1110
import "workflows/v1/workflows.proto";

‎apis/workflows/v1/workflows.proto‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ edition = "2023";
55
package workflows.v1;
66

77
import "buf/validate/validate.proto";
8-
import "google/protobuf/empty.proto";
98
import "google/protobuf/timestamp.proto";
109
import "tilebox/v1/id.proto";
1110
import "workflows/v1/core.proto";

0 commit comments

Comments
 (0)