// Vendored from github.com/authzed/api@b550d757d703fd39ea28799b30daa4de78cd1987, annotations stripped by vendor.py. Apache-2.0. syntax = "proto3"; package authzed.api.v1; import "authzed/api/v1/core.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_multiple_files = true; option java_package = "com.authzed.api.v1"; // DebugInformation defines debug information returned by an API call in a footer when // requested with a specific debugging header. // // The specific debug information returned will depend on the type of the API call made. // // See the github.com/authzed/authzed-go project for the specific header and footer names. message DebugInformation { // check holds debug information about a check request. CheckDebugTrace check = 1; // schema_used holds the schema used for the request. string schema_used = 2; } // CheckDebugTrace is a recursive trace of the requests made for resolving a CheckPermission // API call. message CheckDebugTrace { enum PermissionType { PERMISSION_TYPE_UNSPECIFIED = 0; PERMISSION_TYPE_RELATION = 1; PERMISSION_TYPE_PERMISSION = 2; } enum Permissionship { PERMISSIONSHIP_UNSPECIFIED = 0; PERMISSIONSHIP_NO_PERMISSION = 1; PERMISSIONSHIP_HAS_PERMISSION = 2; PERMISSIONSHIP_CONDITIONAL_PERMISSION = 3; } message SubProblems { repeated CheckDebugTrace traces = 1; } // resource holds the resource on which the Check was performed. // for batched calls, the object_id field contains a comma-separated list of object IDs // for all the resources checked in the batch. ObjectReference resource = 1 ; // permission holds the name of the permission or relation on which the Check was performed. string permission = 2; // permission_type holds information indicating whether it was a permission or relation. PermissionType permission_type = 3 ; // subject holds the subject on which the Check was performed. This will be static across all calls within // the same Check tree. SubjectReference subject = 4 ; // result holds the result of the Check call. Permissionship result = 5 ; // caveat_evaluation_info holds information about the caveat evaluated for this step of the trace. CaveatEvalInfo caveat_evaluation_info = 8; // duration holds the time spent executing this Check operation. google.protobuf.Duration duration = 9; // resolution holds information about how the problem was resolved. oneof resolution { // was_cached_result, if true, indicates that the result was found in the cache and returned directly. bool was_cached_result = 6; // sub_problems holds the sub problems that were executed to resolve the answer to this Check. An empty list // 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; // trace_operation_id is a unique identifier for this trace's operation, that will // be shared for all traces created for the same check operation in SpiceDB. // // In cases where SpiceDB performs automatic batching of subproblems, this ID can be used // to correlate work that was shared across multiple traces. // // This identifier is generated by SpiceDB, is to be considered opaque to the caller // and only guaranteed to be unique within the same overall Check or CheckBulk operation. string trace_operation_id = 11; // source holds the source of the result. It is of the form: // `:`, where sourcetype can be, among others: // `spicedb`, `materialize`, etc. string source = 12; } // CaveatEvalInfo holds information about a caveat expression that was evaluated. message CaveatEvalInfo { enum Result { RESULT_UNSPECIFIED = 0; RESULT_UNEVALUATED = 1; RESULT_FALSE = 2; RESULT_TRUE = 3; RESULT_MISSING_SOME_CONTEXT = 4; } // expression is the expression that was evaluated. string expression = 1; // result is the result of the evaluation. Result result = 2; // context consists of any named values that were used for evaluating the caveat expression. google.protobuf.Struct context = 3; // partial_caveat_info holds information of a partially-evaluated caveated response, if applicable. PartialCaveatInfo partial_caveat_info = 4; // caveat_name is the name of the caveat that was executed, if applicable. string caveat_name = 5; }