Skip to content

Commit

Permalink
Add support for relationship expiration in the API
Browse files Browse the repository at this point in the history
  • Loading branch information
josephschorr committed Nov 26, 2024
1 parent d80b0c6 commit 196cae9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion authzed/api/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ message Relationship {
// subject is the subject to which the resource is related, in some manner.
SubjectReference subject = 3 [ (validate.rules).message.required = true ];

// optional_caveat is a reference to a the caveat that must be enforced over the relationship
// optional_caveat is a reference to a the caveat that must be enforced over the relationship.
ContextualizedCaveat optional_caveat = 4 [ (validate.rules).message.required = false ];

// optional_expires_at is the time at which the relationship expires, if any.
google.protobuf.Timestamp optional_expires_at = 5;

Check failure on line 31 in authzed/api/v1/core.proto

View workflow job for this annotation

GitHub Actions / Lint & Publish Draft/Branch

field authzed.api.v1.Relationship.optional_expires_at: unknown type google.protobuf.Timestamp
}

// ContextualizedCaveat represents a reference to a caveat to be used by caveated relationships.
Expand Down
4 changes: 4 additions & 0 deletions authzed/api/v1/debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ message CheckDebugTrace {
// and a permissionship of PERMISSIONSHIP_HAS_PERMISSION indicates the subject was found within this relation.
SubProblems sub_problems = 7;
}

// optional_expires_at is the time at which at least one of the relationships used to
// compute this result, expires (if any). This is *not* related to the caching window.
google.protobuf.Timestamp optional_expires_at = 10;
}

// CaveatEvalInfo holds information about a caveat expression that was evaluated.
Expand Down
4 changes: 4 additions & 0 deletions authzed/api/v1/permission_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ message CheckPermissionResponse {

// debug_trace is the debugging trace of this check, if requested.
DebugInformation debug_trace = 4;

// optional_expires_at is the time at which at least one of the relationships used to
// compute this result, expires (if any). This is *not* related to the caching window.
google.protobuf.Timestamp optional_expires_at = 5;
}

// CheckBulkPermissionsRequest issues a check on whether a subject has permission
Expand Down

0 comments on commit 196cae9

Please sign in to comment.