Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for relationship expiration in the API #125

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion authzed/api/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ option java_package = "com.authzed.api.v1";
option java_multiple_files = true;

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "validate/validate.proto";

// Relationship specifies how a resource relates to a subject. Relationships
Expand All @@ -24,8 +25,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;
}

// ContextualizedCaveat represents a reference to a caveat to be used by caveated relationships.
Expand Down
5 changes: 5 additions & 0 deletions authzed/api/v1/debug.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "authzed/api/v1/core.proto";
import "validate/validate.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1";
option java_package = "com.authzed.api.v1";
Expand Down Expand Up @@ -77,6 +78,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
5 changes: 5 additions & 0 deletions authzed/api/v1/permission_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ option java_multiple_files = true;
import "google/protobuf/struct.proto";
import "google/api/annotations.proto";
import "google/rpc/status.proto";
import "google/protobuf/timestamp.proto";
import "validate/validate.proto";

import "authzed/api/v1/core.proto";
Expand Down Expand Up @@ -405,6 +406,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
Loading