Skip to content

Commit

Permalink
Merge pull request #103 from josephschorr/remove-exp-regexes
Browse files Browse the repository at this point in the history
Change the regexes in the experimental API to prefix matches
  • Loading branch information
josephschorr authored May 6, 2024
2 parents 8e9616c + eb84316 commit aa9a74c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
11 changes: 11 additions & 0 deletions authzed/api/v1/error_reason.proto
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,15 @@ enum ErrorReason {
// "metadata": {}
// }
ERROR_REASON_INMEMORY_TOO_MANY_CONCURRENT_UPDATES = 24;

// The request failed because the precondition specified is empty.
//
// Example of an ErrorInfo:
//
// {
// "reason": "ERROR_REASON_EMPTY_PRECONDITION",
// "domain": "authzed.com",
// "metadata": {}
// }
ERROR_REASON_EMPTY_PRECONDITION = 25;
}
30 changes: 15 additions & 15 deletions authzed/api/v1/experimental_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ service ExperimentalService {
// EXPERIMENTAL: DiffSchema is an API that allows clients to request the difference between the
// specified schema and the schema stored in SpiceDB. This is useful for clients that need to
// introspect the schema of a SpiceDB instance.
rpc ExperimentalSchemaDiff(ExperimentalSchemaDiffRequest)
returns (ExperimentalSchemaDiffResponse) {
rpc ExperimentalDiffSchema(ExperimentalDiffSchemaRequest)
returns (ExperimentalDiffSchemaResponse) {
option (google.api.http) = {
post: "/v1/experimental/schemadiff"
post: "/v1/experimental/diffschema"
body: "*"
};
}
Expand Down Expand Up @@ -209,17 +209,17 @@ message ExperimentalReflectSchemaResponse {

// ExpSchemaFilter is a filter that can be applied to the schema on reflection.
message ExpSchemaFilter {
// optional_definition_name_match is a regex that is matched against the definition name.
string optional_definition_name_match = 1;
// optional_definition_name_filter is a prefix that is matched against the definition name.
string optional_definition_name_filter = 1;

// optional_caveat_name_match is a regex that is matched against the caveat name.
string optional_caveat_name_match = 2;
// optional_caveat_name_filter is a prefix that is matched against the caveat name.
string optional_caveat_name_filter = 2;

// optional_relation_name_match is a regex that is matched against the relation name.
string optional_relation_name_match = 3;
// optional_relation_name_filter is a prefix that is matched against the relation name.
string optional_relation_name_filter = 3;

// optional_permission_name_match is a regex that is matched against the permission name.
string optional_permission_name_match = 4;
// optional_permission_name_filter is a prefix that is matched against the permission name.
string optional_permission_name_filter = 4;
}

// ExpDefinition is the representation of a definition in the schema.
Expand Down Expand Up @@ -298,10 +298,10 @@ message ExperimentalComputablePermissionsRequest {
Consistency consistency = 1;
repeated ExpRelationReference relations = 2;

// optional_definition_name_match is a regex that is matched against the definition name(s)
// optional_definition_name_match is a prefix that is matched against the definition name(s)
// for the permissions returned.
// If not specified, will be ignored.
string optional_definition_name_match = 3;
string optional_definition_name_filter = 3;
}

// ExpRelationReference is a reference to a relation in the schema.
Expand Down Expand Up @@ -335,12 +335,12 @@ message ExperimentalDependentRelationsResponse {
ZedToken read_at = 2;
}

message ExperimentalSchemaDiffRequest {
message ExperimentalDiffSchemaRequest {
Consistency consistency = 1;
string comparison_schema = 2;
}

message ExperimentalSchemaDiffResponse {
message ExperimentalDiffSchemaResponse {
repeated ExpSchemaDiff diffs = 1;

// read_at is the ZedToken at which the schema was read.
Expand Down

0 comments on commit aa9a74c

Please sign in to comment.