diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 50cf4bf..7ca0608 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ on: # yamllint disable-line rule:truthy types: - "checks_requested" env: - GO_VERSION: "~1.20.4" + GO_VERSION: "~1.20.5" jobs: test: name: "Run Integration Tests" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a4e6480..6692538 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -10,6 +10,8 @@ on: # yamllint disable-line rule:truthy merge_group: types: - "checks_requested" +env: + GO_VERSION: "~1.20.5" jobs: go-lint: name: "Lint Go" @@ -78,4 +80,4 @@ jobs: - name: "Upload Trivy scan results to GitHub Security tab" uses: "github/codeql-action/upload-sarif@v2" with: - sarif_file: 'trivy-results.sarif' + sarif_file: "trivy-results.sarif" diff --git a/magefiles/buf.gen.yaml b/magefiles/buf.gen.yaml index e17051f..29b76cb 100755 --- a/magefiles/buf.gen.yaml +++ b/magefiles/buf.gen.yaml @@ -1,4 +1,4 @@ -#!/usr/bin/env -S go run github.com/bufbuild/buf/cmd/buf generate buf.build/authzed/api:15dad37df4a6aa52f08da1d10874214ca6c815ef --template +#!/usr/bin/env -S go run github.com/bufbuild/buf/cmd/buf generate buf.build/authzed/api:ae69f452ff582006fc08a9743f87d38373ed65f5 --template --- version: "v1" plugins: diff --git a/proto/authzed/api/v1/error_reason.pb.go b/proto/authzed/api/v1/error_reason.pb.go index ac6a3d0..2a27096 100644 --- a/proto/authzed/api/v1/error_reason.pb.go +++ b/proto/authzed/api/v1/error_reason.pb.go @@ -252,6 +252,22 @@ const ( // } // } ErrorReason_ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE ErrorReason = 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 ... + // } + // } + ErrorReason_ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP ErrorReason = 18 ) // Enum value maps for ErrorReason. @@ -275,6 +291,7 @@ var ( 15: "ERROR_REASON_INVALID_CURSOR", 16: "ERROR_REASON_TOO_MANY_RELATIONSHIPS_FOR_TRANSACTIONAL_DELETE", 17: "ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE", + 18: "ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP", } ErrorReason_value = map[string]int32{ "ERROR_REASON_UNSPECIFIED": 0, @@ -295,6 +312,7 @@ var ( "ERROR_REASON_INVALID_CURSOR": 15, "ERROR_REASON_TOO_MANY_RELATIONSHIPS_FOR_TRANSACTIONAL_DELETE": 16, "ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE": 17, + "ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP": 18, } ) @@ -331,7 +349,7 @@ var file_authzed_api_v1_error_reason_proto_rawDesc = []byte{ 0x0a, 0x21, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2a, 0x94, 0x06, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, + 0x2e, 0x76, 0x31, 0x2a, 0xc7, 0x06, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, @@ -380,12 +398,15 @@ var file_authzed_api_v1_error_reason_proto_rawDesc = []byte{ 0x4c, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x10, 0x12, 0x2e, 0x0a, 0x2a, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x48, 0x49, 0x50, 0x5f, 0x43, 0x4f, 0x4e, 0x54, - 0x45, 0x58, 0x54, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x11, 0x42, 0x48, 0x0a, 0x12, 0x63, 0x6f, - 0x6d, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x58, 0x54, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x11, 0x12, 0x31, 0x0a, 0x2d, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x41, 0x54, 0x54, 0x45, 0x4d, + 0x50, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x52, + 0x45, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x48, 0x49, 0x50, 0x10, 0x12, 0x42, 0x48, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2d, + 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (