Skip to content

Commit 0aa4ec4

Browse files
authored
Merge pull request #125 from josephschorr/rel-expiration-api
Add support for relationship expiration in the API
2 parents d80b0c6 + 8c4ebbf commit 0aa4ec4

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

authzed/api/v1/core.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ option java_package = "com.authzed.api.v1";
66
option java_multiple_files = true;
77

88
import "google/protobuf/struct.proto";
9+
import "google/protobuf/timestamp.proto";
910
import "validate/validate.proto";
1011

1112
// Relationship specifies how a resource relates to a subject. Relationships
@@ -24,8 +25,11 @@ message Relationship {
2425
// subject is the subject to which the resource is related, in some manner.
2526
SubjectReference subject = 3 [ (validate.rules).message.required = true ];
2627

27-
// optional_caveat is a reference to a the caveat that must be enforced over the relationship
28+
// optional_caveat is a reference to a the caveat that must be enforced over the relationship.
2829
ContextualizedCaveat optional_caveat = 4 [ (validate.rules).message.required = false ];
30+
31+
// optional_expires_at is the time at which the relationship expires, if any.
32+
google.protobuf.Timestamp optional_expires_at = 5;
2933
}
3034

3135
// ContextualizedCaveat represents a reference to a caveat to be used by caveated relationships.

authzed/api/v1/debug.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "authzed/api/v1/core.proto";
55
import "validate/validate.proto";
66
import "google/protobuf/struct.proto";
77
import "google/protobuf/duration.proto";
8+
import "google/protobuf/timestamp.proto";
89

910
option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1";
1011
option java_package = "com.authzed.api.v1";
@@ -77,6 +78,10 @@ message CheckDebugTrace {
7778
// and a permissionship of PERMISSIONSHIP_HAS_PERMISSION indicates the subject was found within this relation.
7879
SubProblems sub_problems = 7;
7980
}
81+
82+
// optional_expires_at is the time at which at least one of the relationships used to
83+
// compute this result, expires (if any). This is *not* related to the caching window.
84+
google.protobuf.Timestamp optional_expires_at = 10;
8085
}
8186

8287
// CaveatEvalInfo holds information about a caveat expression that was evaluated.

authzed/api/v1/permission_service.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ option java_multiple_files = true;
88
import "google/protobuf/struct.proto";
99
import "google/api/annotations.proto";
1010
import "google/rpc/status.proto";
11+
import "google/protobuf/timestamp.proto";
1112
import "validate/validate.proto";
1213

1314
import "authzed/api/v1/core.proto";
@@ -405,6 +406,10 @@ message CheckPermissionResponse {
405406

406407
// debug_trace is the debugging trace of this check, if requested.
407408
DebugInformation debug_trace = 4;
409+
410+
// optional_expires_at is the time at which at least one of the relationships used to
411+
// compute this result, expires (if any). This is *not* related to the caching window.
412+
google.protobuf.Timestamp optional_expires_at = 5;
408413
}
409414

410415
// CheckBulkPermissionsRequest issues a check on whether a subject has permission

0 commit comments

Comments
 (0)