spicedb-rust 0.3.4

A client for spicedb
Documentation
syntax = "proto3";
package authzed.api.v1;

option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1";
option java_package = "com.authzed.api.v1";
option java_multiple_files = true;

// Defines the supported values for `google.rpc.ErrorInfo.reason` for the
// `authzed.com` error domain.
enum ErrorReason {
  // Do not use this default value.
  ERROR_REASON_UNSPECIFIED = 0;

  // The request gave a schema that could not be parsed.
  //
  // Example of an ErrorInfo:
  //
  //     { 
  //       "reason": "ERROR_REASON_SCHEMA_PARSE_ERROR",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "start_line_number": "1",
  //         "start_column_position": "19",
  //         "end_line_number": "1",
  //         "end_column_position": "19",
  //         "source_code": "somedefinition",
  //       }
  //     }
  //
  // The line numbers and column positions are 0-indexed and may not be present.
  ERROR_REASON_SCHEMA_PARSE_ERROR = 1;

  // The request contains a schema with a type error.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_SCHEMA_TYPE_ERROR",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "definition_name": "somedefinition",
  //         ... additional keys based on the kind of type error ...
  //       }
  //     }
  ERROR_REASON_SCHEMA_TYPE_ERROR = 2;

  // The request referenced an unknown object definition in the schema.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_UNKNOWN_DEFINITION",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "definition_name": "somedefinition"
  //       }
  //     }
  ERROR_REASON_UNKNOWN_DEFINITION = 3;

  // The request referenced an unknown relation or permission under a definition in the schema.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_UNKNOWN_RELATION_OR_PERMISSION",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "definition_name": "somedefinition",
  //         "relation_or_permission_name": "somepermission"
  //       }
  //     }
  ERROR_REASON_UNKNOWN_RELATION_OR_PERMISSION = 4;

  // The WriteRelationships request contained more updates than the maximum configured.
  //
  // Example of an ErrorInfo:
  //
  //     { "reason": "ERROR_REASON_TOO_MANY_UPDATES_IN_REQUEST",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "update_count": "525",
  //         "maximum_updates_allowed": "500",
  //       }
  //     }
  ERROR_REASON_TOO_MANY_UPDATES_IN_REQUEST = 5;

  // The request contained more preconditions than the maximum configured.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_TOO_MANY_PRECONDITIONS_IN_REQUEST",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "precondition_count": "525",
  //         "maximum_preconditions_allowed": "500",
  //       }
  //     }
  ERROR_REASON_TOO_MANY_PRECONDITIONS_IN_REQUEST = 6;

  // The request contained a precondition that failed.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_WRITE_OR_DELETE_PRECONDITION_FAILURE",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "precondition_resource_type": "document",
  //         ... other fields for the filter ...
  //         "precondition_operation": "MUST_EXIST",
  //       }
  //     }
  ERROR_REASON_WRITE_OR_DELETE_PRECONDITION_FAILURE = 7;

  // A write or delete request was made to an instance that is deployed in read-only mode.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_SERVICE_READ_ONLY",
  //       "domain": "authzed.com"
  //     }
  ERROR_REASON_SERVICE_READ_ONLY = 8;

  // The request referenced an unknown caveat in the schema.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_UNKNOWN_CAVEAT",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "caveat_name": "somecaveat"
  //       }
  //     }
  ERROR_REASON_UNKNOWN_CAVEAT = 9;

  // The request tries to use a subject type that was not valid for a relation.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_INVALID_SUBJECT_TYPE",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "definition_name": "somedefinition",
  //         "relation_name": "somerelation",
  //         "subject_type": "user:*"
  //       }
  //     }
  ERROR_REASON_INVALID_SUBJECT_TYPE = 10;

  // The request tries to specify a caveat parameter value with the wrong type.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_CAVEAT_PARAMETER_TYPE_ERROR",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "definition_name": "somedefinition",
  //         "relation_name": "somerelation",
  //         "caveat_name": "somecaveat",
  //         "parameter_name": "someparameter",
  //         "expected_type": "int",
  //       }
  //     }
  ERROR_REASON_CAVEAT_PARAMETER_TYPE_ERROR = 11;

  // The request tries to perform two or more updates on the same relationship in the same WriteRelationships call.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_UPDATES_ON_SAME_RELATIONSHIP",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "definition_name": "somedefinition",
  //         "relationship": "somerelationship",
  //       }
  //     }
  ERROR_REASON_UPDATES_ON_SAME_RELATIONSHIP = 12;

  // The request tries to write a relationship on a permission instead of a relation.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_CANNOT_UPDATE_PERMISSION",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "definition_name": "somedefinition",
  //         "permission_name": "somerelation",
  //       }
  //     }
  ERROR_REASON_CANNOT_UPDATE_PERMISSION = 13;

  // The request failed to evaluate a caveat expression due to an error.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_CAVEAT_EVALUATION_ERROR",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "caveat_name": "somecaveat",
  //       }
  //     }
  ERROR_REASON_CAVEAT_EVALUATION_ERROR = 14;

  // The request failed because the provided cursor was invalid in some way.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_INVALID_CURSOR",
  //       "domain": "authzed.com",
  //       "metadata": {
  //          ... additional keys based on the kind of cursor error ...
  //       }
  //     }
  ERROR_REASON_INVALID_CURSOR = 15;

  // The request failed because there are too many matching relationships to be
  // deleted within a single transactional deletion call. To avoid, set
  // `optional_allow_partial_deletions` to true on the DeleteRelationships call.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_TOO_MANY_RELATIONSHIPS_FOR_TRANSACTIONAL_DELETE",
  //       "domain": "authzed.com",
  //       "metadata": {
  //          ... fields for the filter ...
  //       }
  //     }
  ERROR_REASON_TOO_MANY_RELATIONSHIPS_FOR_TRANSACTIONAL_DELETE = 16;

  // The request failed because the client attempted to write a relationship
  // with a context that exceeded the configured server limit.
  //
  // Example of an ErrorInfo:
  //
  //     {
  //       "reason": "ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "relationship":     "relationship_exceeding_the_limit",
  //         "max_allowed_size": "server_max_allowed_context_size",
  //         "context_size":     "actual_relationship_context_size" ,
  //       }
  //     }
  ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE = 17;

  // The request failed because a relationship marked to be CREATEd
  // was already present within the datastore.
  //
  // Example of an ErrorInfo:
  //
  //     {
  //       "reason": "ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "relationship":          "relationship_that_already_existed",
  //         "resource_type":         "resource type",
  //         "resource_object_id":    "resource object id",
  //         ... additional decomposed relationship fields ...
  //       }
  //     }
  ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP = 18;

  // The request failed because it caused the maximum depth allowed to be
  // exceeded. This typically indicates that there is a circular data traversal
  // somewhere in the schema, but can also be raised if the data traversal is simply
  // too deep.
  //
  // Example of an ErrorInfo:
  //
  //     {
  //       "reason": "ERROR_REASON_MAXIMUM_DEPTH_EXCEEDED",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "maximum_depth_allowed": "50",
  //         ... additional fields based on request type ...
  //       }
  //     }
  ERROR_REASON_MAXIMUM_DEPTH_EXCEEDED = 19;

  // The request failed due to a serialization error in the backend database.
  // This typically indicates that various in flight transactions conflicted with each other
  // and the database had to abort one or more of them. SpiceDB will retry a few times before returning
  // the error to the client.
  //
  // Example of an ErrorInfo:
  //
  //     {
  //       "reason": "ERROR_REASON_SERIALIZATION_FAILURE",
  //       "domain": "authzed.com",
  //       "metadata": {}
  //     }
  ERROR_REASON_SERIALIZATION_FAILURE = 20;

  // The request contained more check items than the maximum configured.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_TOO_MANY_CHECKS_IN_REQUEST",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "check_count": "525",
  //         "maximum_checks_allowed": "500",
  //       }
  //     }
  ERROR_REASON_TOO_MANY_CHECKS_IN_REQUEST = 21;

  // The request's specified limit is too large.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_EXCEEDS_MAXIMUM_ALLOWABLE_LIMIT",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "limit_provided": "525",
  //         "maximum_limit_allowed": "500",
  //       }
  //     }
  ERROR_REASON_EXCEEDS_MAXIMUM_ALLOWABLE_LIMIT = 22;

  // The request failed because the provided filter was invalid in some way.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_INVALID_FILTER",
  //       "domain": "authzed.com",
  //       "metadata": {
  //         "filter": "...",
  //       }
  //     }
  ERROR_REASON_INVALID_FILTER = 23;

  // The request failed because too many concurrent updates were attempted
  // against the in-memory datastore.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_INMEMORY_TOO_MANY_CONCURRENT_UPDATES",
  //       "domain": "authzed.com",
  //       "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;

  // The request failed because the counter was already registered.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_COUNTER_ALREADY_REGISTERED",
  //       "domain": "authzed.com",
  //       "metadata": { "counter_name": "name" }
  //     }
  ERROR_REASON_COUNTER_ALREADY_REGISTERED = 26;

  // The request failed because the counter was not registered.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_COUNTER_NOT_REGISTERED",
  //       "domain": "authzed.com",
  //       "metadata": { "counter_name": "name"  }
  //     }
  ERROR_REASON_COUNTER_NOT_REGISTERED = 27;

  // The request failed because a wildcard was not allowed. For CheckPermission,
  // this means that the subject or resource ID was a wildcard. For LookupResources,
  // this means that the subject ID was a wildcard.
  //
  // Example of an ErrorInfo:
  //
  //     {  
  //       "reason": "ERROR_REASON_WILDCARD_NOT_ALLOWED",
  //       "domain": "authzed.com",
  //       "metadata": { "disallowed_field": "subject_id" }
  //     }
  ERROR_REASON_WILDCARD_NOT_ALLOWED = 28;
}