diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 472766b..262969c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,14 +20,14 @@ jobs: otp: 24.0 lint: lint steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.pair.otp}} elixir-version: ${{matrix.pair.elixir}} - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: | deps @@ -65,14 +65,14 @@ jobs: otp: 24.0 lint: lint steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.pair.otp}} elixir-version: ${{matrix.pair.elixir}} - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: | deps @@ -80,9 +80,9 @@ jobs: key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }} restore-keys: | ${{ runner.os }}-mix- - - uses: "arduino/setup-protoc@v1" + - uses: arduino/setup-protoc@v3 with: - version: "3.19.4" + version: "34.1" - name: "Install Homebrew & gRPC" run: | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" @@ -93,7 +93,7 @@ jobs: run: | mix escript.install hex protobuf --force echo "/home/runner/.mix/escripts" >> $GITHUB_PATH - - uses: "bufbuild/buf-action@v1" + - uses: bufbuild/buf-action@v1 with: setup_only: true - name: "Generate & Diff Protos" @@ -101,8 +101,6 @@ jobs: echo "/home/runner/.mix/escripts" >> $GITHUB_PATH ./buf.gen.yaml mix format authzed/**/*.ex - mix format google/rpc/**/*.ex bash -c '[[ $(diff -qr authzed/api lib/api | grep "Only in authzed") -eq 0 ]]' - bash -c '[[ $(diff -qr google/rpc lib/google/rpc | grep "Only in google") -eq 0 ]]' mix format - rm -rf authzed + rm -rf authzed google diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d24d706..6a6db4d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: lint: lint steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup elixir uses: erlef/setup-beam@v1 @@ -29,7 +29,7 @@ jobs: elixir-version: ${{matrix.pair.elixir}} - name: "Cache deps" - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: | deps diff --git a/Makefile b/Makefile index 7fdd74b..1e59de0 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,10 @@ generate: @echo "Generation successful" @echo "Copying files to authzed/api folder..." cp -r authzed/api/* lib/api/ - @echo "Copying files to google/rpc folder..." - @mkdir -p lib/google - cp -r google/rpc lib/google/ + @echo "Google RPC modules are provided by the googleapis Hex package (grpc dependency)." @echo "Files moved successfully" @echo "Removing generated files.." - rm -rf authzed + rm -rf authzed google @echo "File cleanup completed" @echo "Formating files.." mix format diff --git a/buf.gen.yaml b/buf.gen.yaml index a8e699e..12c77d7 100755 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -7,5 +7,4 @@ plugins: opt: - plugins=grpc inputs: - - module: "buf.build/authzed/api:v1.41.0 " - - module: "buf.build/googleapis/googleapis" + - module: "buf.build/authzed/api:v1.45.4 " diff --git a/docker-compose-test.yml b/docker-compose-test.yml index f8364e7..524b182 100644 --- a/docker-compose-test.yml +++ b/docker-compose-test.yml @@ -1,5 +1,3 @@ -version: '3' - services: spicedb: image: authzed/spicedb diff --git a/lib/api/materialize/v0/watchpermissions.pb.ex b/lib/api/materialize/v0/watchpermissions.pb.ex index 66f6336..3db93c0 100644 --- a/lib/api/materialize/v0/watchpermissions.pb.ex +++ b/lib/api/materialize/v0/watchpermissions.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.Materialize.V0.PermissionChange.Permissionship do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.materialize.v0.PermissionChange.Permissionship", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:PERMISSIONSHIP_UNSPECIFIED, 0) field(:PERMISSIONSHIP_NO_PERMISSION, 1) @@ -12,7 +16,10 @@ end defmodule Authzed.Api.Materialize.V0.WatchPermissionsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.WatchPermissionsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:permissions, 1, repeated: true, type: Authzed.Api.Materialize.V0.WatchedPermission) @@ -25,7 +32,10 @@ end defmodule Authzed.Api.Materialize.V0.WatchedPermission do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.WatchedPermission", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:resource_type, 1, type: :string, json_name: "resourceType") field(:permission, 2, type: :string) @@ -36,7 +46,10 @@ end defmodule Authzed.Api.Materialize.V0.WatchPermissionsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.WatchPermissionsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:response, 0) @@ -52,7 +65,10 @@ end defmodule Authzed.Api.Materialize.V0.PermissionChange do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.PermissionChange", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:revision, 1, type: Authzed.Api.V1.ZedToken) field(:resource, 2, type: Authzed.Api.V1.ObjectReference) @@ -70,7 +86,7 @@ defmodule Authzed.Api.Materialize.V0.WatchPermissionsService.Service do use GRPC.Service, name: "authzed.api.materialize.v0.WatchPermissionsService", - protoc_gen_elixir_version: "0.14.0" + protoc_gen_elixir_version: "0.16.0" rpc( :WatchPermissions, diff --git a/lib/api/materialize/v0/watchpermissionsets.pb.ex b/lib/api/materialize/v0/watchpermissionsets.pb.ex index 1fad34b..4e39083 100644 --- a/lib/api/materialize/v0/watchpermissionsets.pb.ex +++ b/lib/api/materialize/v0/watchpermissionsets.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.Materialize.V0.PermissionSetChange.SetOperation do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.materialize.v0.PermissionSetChange.SetOperation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:SET_OPERATION_UNSPECIFIED, 0) field(:SET_OPERATION_ADDED, 1) @@ -11,7 +15,10 @@ end defmodule Authzed.Api.Materialize.V0.WatchPermissionSetsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.WatchPermissionSetsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:optional_starting_after, 1, type: Authzed.Api.V1.ZedToken, @@ -22,7 +29,10 @@ end defmodule Authzed.Api.Materialize.V0.WatchPermissionSetsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.WatchPermissionSetsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:response, 0) @@ -50,7 +60,10 @@ end defmodule Authzed.Api.Materialize.V0.Cursor do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.Cursor", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:limit, 1, type: :uint32) field(:token, 4, type: Authzed.Api.V1.ZedToken) @@ -63,7 +76,10 @@ end defmodule Authzed.Api.Materialize.V0.LookupPermissionSetsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.LookupPermissionSetsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:limit, 1, type: :uint32) field(:optional_at_revision, 2, type: Authzed.Api.V1.ZedToken, json_name: "optionalAtRevision") @@ -77,7 +93,10 @@ end defmodule Authzed.Api.Materialize.V0.LookupPermissionSetsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.LookupPermissionSetsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:change, 1, type: Authzed.Api.Materialize.V0.PermissionSetChange) field(:cursor, 2, type: Authzed.Api.Materialize.V0.Cursor) @@ -86,7 +105,10 @@ end defmodule Authzed.Api.Materialize.V0.PermissionSetChange do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.PermissionSetChange", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:child, 0) @@ -115,7 +137,10 @@ end defmodule Authzed.Api.Materialize.V0.SetReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.SetReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object_type, 1, type: :string, json_name: "objectType") field(:object_id, 2, type: :string, json_name: "objectId") @@ -125,7 +150,10 @@ end defmodule Authzed.Api.Materialize.V0.MemberReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.MemberReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object_type, 1, type: :string, json_name: "objectType") field(:object_id, 2, type: :string, json_name: "objectId") @@ -139,7 +167,10 @@ end defmodule Authzed.Api.Materialize.V0.LookupPermissionSetsRequired do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.LookupPermissionSetsRequired", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:required_lookup_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "requiredLookupAt") end @@ -147,17 +178,54 @@ end defmodule Authzed.Api.Materialize.V0.BreakingSchemaChange do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.materialize.v0.BreakingSchemaChange", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:change_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "changeAt") end +defmodule Authzed.Api.Materialize.V0.DownloadPermissionSetsRequest do + @moduledoc false + + use Protobuf, + full_name: "authzed.api.materialize.v0.DownloadPermissionSetsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 + + field(:optional_at_revision, 1, type: Authzed.Api.V1.ZedToken, json_name: "optionalAtRevision") +end + +defmodule Authzed.Api.Materialize.V0.File do + @moduledoc false + + use Protobuf, + full_name: "authzed.api.materialize.v0.File", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 + + field(:name, 1, type: :string) + field(:url, 2, type: :string) +end + +defmodule Authzed.Api.Materialize.V0.DownloadPermissionSetsResponse do + @moduledoc false + + use Protobuf, + full_name: "authzed.api.materialize.v0.DownloadPermissionSetsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 + + field(:files, 1, repeated: true, type: Authzed.Api.Materialize.V0.File) +end + defmodule Authzed.Api.Materialize.V0.WatchPermissionSetsService.Service do @moduledoc false use GRPC.Service, name: "authzed.api.materialize.v0.WatchPermissionSetsService", - protoc_gen_elixir_version: "0.14.0" + protoc_gen_elixir_version: "0.16.0" rpc( :WatchPermissionSets, @@ -170,6 +238,12 @@ defmodule Authzed.Api.Materialize.V0.WatchPermissionSetsService.Service do Authzed.Api.Materialize.V0.LookupPermissionSetsRequest, stream(Authzed.Api.Materialize.V0.LookupPermissionSetsResponse) ) + + rpc( + :DownloadPermissionSets, + Authzed.Api.Materialize.V0.DownloadPermissionSetsRequest, + Authzed.Api.Materialize.V0.DownloadPermissionSetsResponse + ) end defmodule Authzed.Api.Materialize.V0.WatchPermissionSetsService.Stub do diff --git a/lib/api/v0/core.pb.ex b/lib/api/v0/core.pb.ex index a08bf5f..3d88379 100644 --- a/lib/api/v0/core.pb.ex +++ b/lib/api/v0/core.pb.ex @@ -1,7 +1,10 @@ defmodule Authzed.Api.V0.RelationTuple do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.RelationTuple", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object_and_relation, 1, type: Authzed.Api.V0.ObjectAndRelation, @@ -15,7 +18,10 @@ end defmodule Authzed.Api.V0.ObjectAndRelation do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.ObjectAndRelation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:namespace, 1, type: :string, deprecated: false) field(:object_id, 2, type: :string, json_name: "objectId", deprecated: false) @@ -25,7 +31,10 @@ end defmodule Authzed.Api.V0.RelationReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.RelationReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:namespace, 1, type: :string, deprecated: false) field(:relation, 3, type: :string, deprecated: false) @@ -34,7 +43,10 @@ end defmodule Authzed.Api.V0.User do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.User", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:user_oneof, 0) diff --git a/lib/api/v0/developer.pb.ex b/lib/api/v0/developer.pb.ex index d09ea63..65ece52 100644 --- a/lib/api/v0/developer.pb.ex +++ b/lib/api/v0/developer.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.V0.LookupShareResponse.LookupStatus do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v0.LookupShareResponse.LookupStatus", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:UNKNOWN_REFERENCE, 0) field(:FAILED_TO_LOOKUP, 1) @@ -12,7 +16,11 @@ end defmodule Authzed.Api.V0.DeveloperError.Source do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v0.DeveloperError.Source", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:UNKNOWN_SOURCE, 0) field(:SCHEMA, 1) @@ -25,7 +33,11 @@ end defmodule Authzed.Api.V0.DeveloperError.ErrorKind do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v0.DeveloperError.ErrorKind", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:UNKNOWN_KIND, 0) field(:PARSE_ERROR, 1) @@ -42,7 +54,10 @@ end defmodule Authzed.Api.V0.FormatSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.FormatSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:schema, 1, type: :string) end @@ -50,7 +65,10 @@ end defmodule Authzed.Api.V0.FormatSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.FormatSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:error, 1, type: Authzed.Api.V0.DeveloperError) field(:formatted_schema, 2, type: :string, json_name: "formattedSchema") @@ -59,7 +77,10 @@ end defmodule Authzed.Api.V0.UpgradeSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.UpgradeSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:namespace_configs, 1, repeated: true, type: :string, json_name: "namespaceConfigs") end @@ -67,7 +88,10 @@ end defmodule Authzed.Api.V0.UpgradeSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.UpgradeSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:error, 1, type: Authzed.Api.V0.DeveloperError) field(:upgraded_schema, 2, type: :string, json_name: "upgradedSchema") @@ -76,7 +100,10 @@ end defmodule Authzed.Api.V0.ShareRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.ShareRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:schema, 1, type: :string) field(:relationships_yaml, 2, type: :string, json_name: "relationshipsYaml") @@ -87,7 +114,10 @@ end defmodule Authzed.Api.V0.ShareResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.ShareResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:share_reference, 1, type: :string, json_name: "shareReference") end @@ -95,7 +125,10 @@ end defmodule Authzed.Api.V0.LookupShareRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.LookupShareRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:share_reference, 1, type: :string, json_name: "shareReference") end @@ -103,7 +136,10 @@ end defmodule Authzed.Api.V0.LookupShareResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.LookupShareResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:status, 1, type: Authzed.Api.V0.LookupShareResponse.LookupStatus, enum: true) field(:schema, 2, type: :string) @@ -115,7 +151,10 @@ end defmodule Authzed.Api.V0.RequestContext do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.RequestContext", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:schema, 1, type: :string) field(:relationships, 2, repeated: true, type: Authzed.Api.V0.RelationTuple) @@ -124,7 +163,10 @@ end defmodule Authzed.Api.V0.EditCheckRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.EditCheckRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:context, 1, type: Authzed.Api.V0.RequestContext) @@ -138,7 +180,10 @@ end defmodule Authzed.Api.V0.EditCheckResult do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.EditCheckResult", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relationship, 1, type: Authzed.Api.V0.RelationTuple) field(:is_member, 2, type: :bool, json_name: "isMember") @@ -148,7 +193,10 @@ end defmodule Authzed.Api.V0.EditCheckResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.EditCheckResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:request_errors, 1, repeated: true, @@ -166,7 +214,10 @@ end defmodule Authzed.Api.V0.ValidateRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.ValidateRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:context, 1, type: Authzed.Api.V0.RequestContext) field(:validation_yaml, 3, type: :string, json_name: "validationYaml") @@ -177,7 +228,10 @@ end defmodule Authzed.Api.V0.ValidateResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.ValidateResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:request_errors, 1, repeated: true, @@ -197,7 +251,10 @@ end defmodule Authzed.Api.V0.DeveloperError do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v0.DeveloperError", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:message, 1, type: :string) field(:line, 2, type: :uint32) @@ -211,7 +268,7 @@ end defmodule Authzed.Api.V0.DeveloperService.Service do @moduledoc false - use GRPC.Service, name: "authzed.api.v0.DeveloperService", protoc_gen_elixir_version: "0.14.0" + use GRPC.Service, name: "authzed.api.v0.DeveloperService", protoc_gen_elixir_version: "0.16.0" rpc(:EditCheck, Authzed.Api.V0.EditCheckRequest, Authzed.Api.V0.EditCheckResponse) diff --git a/lib/api/v1/client.ex b/lib/api/v1/client.ex index 7bc89f1..de0d3aa 100644 --- a/lib/api/v1/client.ex +++ b/lib/api/v1/client.ex @@ -14,33 +14,53 @@ defmodule Authzed.Api.V1.Client do @doc """ Establishes a gRPC connection with the Authzed service. - ## Options: + `endpoint` is a target string for [`GRPC.Stub.connect/2`](https://hexdocs.pm/grpc/GRPC.Stub.html#connect/2), + for example `"localhost:50051"`, `"grpc.example.com:443"`, or a typed address such as + `"ipv4:10.0.0.5:50051"`. + + `GRPC.Client.Supervisor` must be running — add `{GRPC.Client.Supervisor, []}` to your + application or see [`GRPC.Client.Supervisor`](https://hexdocs.pm/grpc/GRPC.Client.Supervisor.html). + + ## Options https://hexdocs.pm/grpc/GRPC.Stub.html#connect/2-options """ def new(endpoint, auth_header_or_ssl_cred, opts \\ []) - def new(endpoint, auth_header, opts) when is_list(auth_header) do + def new(endpoint, auth_header, opts) when is_binary(endpoint) and is_list(auth_header) do grpc_opts = Keyword.merge(opts, headers: auth_header) {:ok, channel} = GRPC.Stub.connect(endpoint, grpc_opts) %__MODULE__{channel: channel} end - def new(endpoint, ssl_cred, opts) do + def new(endpoint, ssl_cred, opts) when is_binary(endpoint) do grpc_opts = Keyword.merge(opts, cred: ssl_cred) {:ok, channel} = GRPC.Stub.connect(endpoint, grpc_opts) %__MODULE__{channel: channel} end - def new(host, port, auth_header, opts) when is_list(auth_header) do - grpc_opts = Keyword.merge(opts, headers: auth_header) - {:ok, channel} = GRPC.Stub.connect(host, port, grpc_opts) - %__MODULE__{channel: channel} + @deprecated "Use Client.new/3 with a single GRPC target string; see GRPC.Stub.connect/2 (e.g. \"host:port\" or ipv4:/ipv6: forms)." + def new(host, port, auth_header, opts) when is_binary(host) and is_list(auth_header) do + new(deprecated_host_port_endpoint(host, port), auth_header, opts) end - def new(host, port, ssl_cred, opts) do - grpc_opts = Keyword.merge(opts, cred: ssl_cred) - {:ok, channel} = GRPC.Stub.connect(host, port, grpc_opts) - %__MODULE__{channel: channel} + @deprecated "Use Client.new/3 with a single GRPC target string; see GRPC.Stub.connect/2." + def new(host, port, ssl_cred, opts) when is_binary(host) and not is_list(ssl_cred) do + new(deprecated_host_port_endpoint(host, port), ssl_cred, opts) + end + + # Deprecated host+port arity: map to the same targets users should pass to new/3, without + # GRPC.Stub.connect/3 (warnings-as-errors). + defp deprecated_host_port_endpoint(host, port) do + case :inet.parse_address(to_charlist(host)) do + {:ok, {_, _, _, _}} -> + "ipv4:#{host}:#{port}" + + {:ok, {_, _, _, _, _, _, _, _}} -> + "ipv6:[#{host}]:#{port}" + + {:error, _} -> + "#{host}:#{port}" + end end end diff --git a/lib/api/v1/core.pb.ex b/lib/api/v1/core.pb.ex index 5f04179..c937c26 100644 --- a/lib/api/v1/core.pb.ex +++ b/lib/api/v1/core.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.V1.RelationshipUpdate.Operation do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.RelationshipUpdate.Operation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:OPERATION_UNSPECIFIED, 0) field(:OPERATION_CREATE, 1) @@ -12,7 +16,11 @@ end defmodule Authzed.Api.V1.AlgebraicSubjectSet.Operation do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.AlgebraicSubjectSet.Operation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:OPERATION_UNSPECIFIED, 0) field(:OPERATION_UNION, 1) @@ -23,7 +31,10 @@ end defmodule Authzed.Api.V1.Relationship do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.Relationship", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:resource, 1, type: Authzed.Api.V1.ObjectReference, deprecated: false) field(:relation, 2, type: :string, deprecated: false) @@ -41,7 +52,10 @@ end defmodule Authzed.Api.V1.ContextualizedCaveat do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ContextualizedCaveat", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:caveat_name, 1, type: :string, json_name: "caveatName", deprecated: false) field(:context, 2, type: Google.Protobuf.Struct, deprecated: false) @@ -50,7 +64,10 @@ end defmodule Authzed.Api.V1.SubjectReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.SubjectReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object, 1, type: Authzed.Api.V1.ObjectReference, deprecated: false) field(:optional_relation, 2, type: :string, json_name: "optionalRelation", deprecated: false) @@ -59,7 +76,10 @@ end defmodule Authzed.Api.V1.ObjectReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ObjectReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object_type, 1, type: :string, json_name: "objectType", deprecated: false) field(:object_id, 2, type: :string, json_name: "objectId", deprecated: false) @@ -68,7 +88,10 @@ end defmodule Authzed.Api.V1.ZedToken do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ZedToken", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:token, 1, type: :string, deprecated: false) end @@ -76,7 +99,10 @@ end defmodule Authzed.Api.V1.Cursor do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.Cursor", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:token, 1, type: :string, deprecated: false) end @@ -84,7 +110,10 @@ end defmodule Authzed.Api.V1.RelationshipUpdate do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.RelationshipUpdate", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:operation, 1, type: Authzed.Api.V1.RelationshipUpdate.Operation, @@ -98,7 +127,10 @@ end defmodule Authzed.Api.V1.PermissionRelationshipTree do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.PermissionRelationshipTree", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:tree_type, 0) @@ -111,7 +143,10 @@ end defmodule Authzed.Api.V1.AlgebraicSubjectSet do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.AlgebraicSubjectSet", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:operation, 1, type: Authzed.Api.V1.AlgebraicSubjectSet.Operation, @@ -129,7 +164,10 @@ end defmodule Authzed.Api.V1.DirectSubjectSet do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DirectSubjectSet", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:subjects, 1, repeated: true, type: Authzed.Api.V1.SubjectReference) end @@ -137,7 +175,10 @@ end defmodule Authzed.Api.V1.PartialCaveatInfo do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.PartialCaveatInfo", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:missing_required_context, 1, repeated: true, diff --git a/lib/api/v1/debug.pb.ex b/lib/api/v1/debug.pb.ex index a77a384..0b2bc7a 100644 --- a/lib/api/v1/debug.pb.ex +++ b/lib/api/v1/debug.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.V1.CheckDebugTrace.PermissionType do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.CheckDebugTrace.PermissionType", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:PERMISSION_TYPE_UNSPECIFIED, 0) field(:PERMISSION_TYPE_RELATION, 1) @@ -11,7 +15,11 @@ end defmodule Authzed.Api.V1.CheckDebugTrace.Permissionship do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.CheckDebugTrace.Permissionship", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:PERMISSIONSHIP_UNSPECIFIED, 0) field(:PERMISSIONSHIP_NO_PERMISSION, 1) @@ -22,7 +30,11 @@ end defmodule Authzed.Api.V1.CaveatEvalInfo.Result do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.CaveatEvalInfo.Result", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:RESULT_UNSPECIFIED, 0) field(:RESULT_UNEVALUATED, 1) @@ -34,7 +46,10 @@ end defmodule Authzed.Api.V1.DebugInformation do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DebugInformation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:check, 1, type: Authzed.Api.V1.CheckDebugTrace) field(:schema_used, 2, type: :string, json_name: "schemaUsed") @@ -43,7 +58,10 @@ end defmodule Authzed.Api.V1.CheckDebugTrace.SubProblems do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckDebugTrace.SubProblems", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:traces, 1, repeated: true, type: Authzed.Api.V1.CheckDebugTrace) end @@ -51,7 +69,10 @@ end defmodule Authzed.Api.V1.CheckDebugTrace do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckDebugTrace", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:resolution, 0) @@ -95,7 +116,10 @@ end defmodule Authzed.Api.V1.CaveatEvalInfo do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CaveatEvalInfo", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:expression, 1, type: :string) field(:result, 2, type: Authzed.Api.V1.CaveatEvalInfo.Result, enum: true) diff --git a/lib/api/v1/error_reason.pb.ex b/lib/api/v1/error_reason.pb.ex index 2d1c049..4c721d5 100644 --- a/lib/api/v1/error_reason.pb.ex +++ b/lib/api/v1/error_reason.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.V1.ErrorReason do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.ErrorReason", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:ERROR_REASON_UNSPECIFIED, 0) field(:ERROR_REASON_SCHEMA_PARSE_ERROR, 1) diff --git a/lib/api/v1/experimental_service.pb.ex b/lib/api/v1/experimental_service.pb.ex index 93d8cf2..432efd2 100644 --- a/lib/api/v1/experimental_service.pb.ex +++ b/lib/api/v1/experimental_service.pb.ex @@ -1,7 +1,10 @@ defmodule Authzed.Api.V1.ExperimentalRegisterRelationshipCounterRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalRegisterRelationshipCounterRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string, deprecated: false) @@ -15,13 +18,19 @@ end defmodule Authzed.Api.V1.ExperimentalRegisterRelationshipCounterResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalRegisterRelationshipCounterResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 end defmodule Authzed.Api.V1.ExperimentalCountRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalCountRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string, deprecated: false) end @@ -29,7 +38,10 @@ end defmodule Authzed.Api.V1.ExperimentalCountRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalCountRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:counter_result, 0) @@ -49,7 +61,10 @@ end defmodule Authzed.Api.V1.ReadCounterValue do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReadCounterValue", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relationship_count, 1, type: :uint64, json_name: "relationshipCount") field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt", deprecated: false) @@ -58,7 +73,10 @@ end defmodule Authzed.Api.V1.ExperimentalUnregisterRelationshipCounterRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalUnregisterRelationshipCounterRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string, deprecated: false) end @@ -66,13 +84,19 @@ end defmodule Authzed.Api.V1.ExperimentalUnregisterRelationshipCounterResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalUnregisterRelationshipCounterResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 end defmodule Authzed.Api.V1.BulkCheckPermissionRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkCheckPermissionRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) @@ -86,7 +110,10 @@ end defmodule Authzed.Api.V1.BulkCheckPermissionRequestItem do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkCheckPermissionRequestItem", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:resource, 1, type: Authzed.Api.V1.ObjectReference, deprecated: false) field(:permission, 2, type: :string, deprecated: false) @@ -97,7 +124,10 @@ end defmodule Authzed.Api.V1.BulkCheckPermissionResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkCheckPermissionResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:checked_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "checkedAt", deprecated: false) @@ -111,7 +141,10 @@ end defmodule Authzed.Api.V1.BulkCheckPermissionPair do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkCheckPermissionPair", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:response, 0) @@ -123,7 +156,10 @@ end defmodule Authzed.Api.V1.BulkCheckPermissionResponseItem do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkCheckPermissionResponseItem", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:permissionship, 1, type: Authzed.Api.V1.CheckPermissionResponse.Permissionship, @@ -141,7 +177,10 @@ end defmodule Authzed.Api.V1.BulkImportRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkImportRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relationships, 1, repeated: true, type: Authzed.Api.V1.Relationship, deprecated: false) end @@ -149,7 +188,10 @@ end defmodule Authzed.Api.V1.BulkImportRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkImportRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:num_loaded, 1, type: :uint64, json_name: "numLoaded") end @@ -157,7 +199,10 @@ end defmodule Authzed.Api.V1.BulkExportRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkExportRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:optional_limit, 2, type: :uint32, json_name: "optionalLimit", deprecated: false) @@ -172,7 +217,10 @@ end defmodule Authzed.Api.V1.BulkExportRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.BulkExportRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:after_result_cursor, 1, type: Authzed.Api.V1.Cursor, json_name: "afterResultCursor") field(:relationships, 2, repeated: true, type: Authzed.Api.V1.Relationship) @@ -181,7 +229,10 @@ end defmodule Authzed.Api.V1.ExperimentalReflectSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalReflectSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) @@ -195,7 +246,10 @@ end defmodule Authzed.Api.V1.ExperimentalReflectSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalReflectSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:definitions, 1, repeated: true, type: Authzed.Api.V1.ExpDefinition) field(:caveats, 2, repeated: true, type: Authzed.Api.V1.ExpCaveat) @@ -205,7 +259,10 @@ end defmodule Authzed.Api.V1.ExpSchemaFilter do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpSchemaFilter", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:optional_definition_name_filter, 1, type: :string, @@ -224,7 +281,10 @@ end defmodule Authzed.Api.V1.ExpDefinition do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpDefinition", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -235,7 +295,10 @@ end defmodule Authzed.Api.V1.ExpCaveat do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpCaveat", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -246,7 +309,10 @@ end defmodule Authzed.Api.V1.ExpCaveatParameter do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpCaveatParameter", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:type, 2, type: :string) @@ -256,7 +322,10 @@ end defmodule Authzed.Api.V1.ExpRelation do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpRelation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -272,7 +341,10 @@ end defmodule Authzed.Api.V1.ExpTypeReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpTypeReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:typeref, 0) @@ -286,7 +358,10 @@ end defmodule Authzed.Api.V1.ExpPermission do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpPermission", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -296,7 +371,10 @@ end defmodule Authzed.Api.V1.ExperimentalComputablePermissionsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalComputablePermissionsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:definition_name, 2, type: :string, json_name: "definitionName") @@ -311,7 +389,10 @@ end defmodule Authzed.Api.V1.ExpRelationReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpRelationReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:definition_name, 1, type: :string, json_name: "definitionName") field(:relation_name, 2, type: :string, json_name: "relationName") @@ -321,7 +402,10 @@ end defmodule Authzed.Api.V1.ExperimentalComputablePermissionsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalComputablePermissionsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:permissions, 1, repeated: true, type: Authzed.Api.V1.ExpRelationReference) field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt") @@ -330,7 +414,10 @@ end defmodule Authzed.Api.V1.ExperimentalDependentRelationsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalDependentRelationsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:definition_name, 2, type: :string, json_name: "definitionName") @@ -340,7 +427,10 @@ end defmodule Authzed.Api.V1.ExperimentalDependentRelationsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalDependentRelationsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relations, 1, repeated: true, type: Authzed.Api.V1.ExpRelationReference) field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt") @@ -349,7 +439,10 @@ end defmodule Authzed.Api.V1.ExperimentalDiffSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalDiffSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:comparison_schema, 2, type: :string, json_name: "comparisonSchema") @@ -358,7 +451,10 @@ end defmodule Authzed.Api.V1.ExperimentalDiffSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExperimentalDiffSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:diffs, 1, repeated: true, type: Authzed.Api.V1.ExpSchemaDiff) field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt") @@ -367,7 +463,10 @@ end defmodule Authzed.Api.V1.ExpRelationSubjectTypeChange do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpRelationSubjectTypeChange", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relation, 1, type: Authzed.Api.V1.ExpRelation) @@ -380,7 +479,10 @@ end defmodule Authzed.Api.V1.ExpCaveatParameterTypeChange do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpCaveatParameterTypeChange", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:parameter, 1, type: Authzed.Api.V1.ExpCaveatParameter) field(:previous_type, 2, type: :string, json_name: "previousType") @@ -389,7 +491,10 @@ end defmodule Authzed.Api.V1.ExpSchemaDiff do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpSchemaDiff", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:diff, 0) @@ -504,7 +609,7 @@ defmodule Authzed.Api.V1.ExperimentalService.Service do use GRPC.Service, name: "authzed.api.v1.ExperimentalService", - protoc_gen_elixir_version: "0.14.0" + protoc_gen_elixir_version: "0.16.0" rpc( :BulkImportRelationships, diff --git a/lib/api/v1/permission_service.pb.ex b/lib/api/v1/permission_service.pb.ex index ebb2237..08b01e2 100644 --- a/lib/api/v1/permission_service.pb.ex +++ b/lib/api/v1/permission_service.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.V1.LookupPermissionship do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.LookupPermissionship", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:LOOKUP_PERMISSIONSHIP_UNSPECIFIED, 0) field(:LOOKUP_PERMISSIONSHIP_HAS_PERMISSION, 1) @@ -11,7 +15,11 @@ end defmodule Authzed.Api.V1.Precondition.Operation do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.Precondition.Operation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:OPERATION_UNSPECIFIED, 0) field(:OPERATION_MUST_NOT_MATCH, 1) @@ -21,7 +29,11 @@ end defmodule Authzed.Api.V1.DeleteRelationshipsResponse.DeletionProgress do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.DeleteRelationshipsResponse.DeletionProgress", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:DELETION_PROGRESS_UNSPECIFIED, 0) field(:DELETION_PROGRESS_COMPLETE, 1) @@ -31,7 +43,11 @@ end defmodule Authzed.Api.V1.CheckPermissionResponse.Permissionship do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.CheckPermissionResponse.Permissionship", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:PERMISSIONSHIP_UNSPECIFIED, 0) field(:PERMISSIONSHIP_NO_PERMISSION, 1) @@ -42,7 +58,11 @@ end defmodule Authzed.Api.V1.LookupSubjectsRequest.WildcardOption do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1.LookupSubjectsRequest.WildcardOption", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:WILDCARD_OPTION_UNSPECIFIED, 0) field(:WILDCARD_OPTION_INCLUDE_WILDCARDS, 1) @@ -52,7 +72,10 @@ end defmodule Authzed.Api.V1.Consistency do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.Consistency", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:requirement, 0) @@ -86,7 +109,10 @@ end defmodule Authzed.Api.V1.RelationshipFilter do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.RelationshipFilter", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:resource_type, 1, type: :string, json_name: "resourceType", deprecated: false) @@ -113,7 +139,10 @@ end defmodule Authzed.Api.V1.SubjectFilter.RelationFilter do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.SubjectFilter.RelationFilter", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relation, 1, type: :string, deprecated: false) end @@ -121,7 +150,10 @@ end defmodule Authzed.Api.V1.SubjectFilter do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.SubjectFilter", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:subject_type, 1, type: :string, json_name: "subjectType", deprecated: false) field(:optional_subject_id, 2, type: :string, json_name: "optionalSubjectId", deprecated: false) @@ -135,7 +167,10 @@ end defmodule Authzed.Api.V1.ReadRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReadRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) @@ -152,7 +187,10 @@ end defmodule Authzed.Api.V1.ReadRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReadRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:read_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "readAt", deprecated: false) field(:relationship, 2, type: Authzed.Api.V1.Relationship, deprecated: false) @@ -162,7 +200,10 @@ end defmodule Authzed.Api.V1.Precondition do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.Precondition", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:operation, 1, type: Authzed.Api.V1.Precondition.Operation, enum: true, deprecated: false) field(:filter, 2, type: Authzed.Api.V1.RelationshipFilter, deprecated: false) @@ -171,7 +212,10 @@ end defmodule Authzed.Api.V1.WriteRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.WriteRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:updates, 1, repeated: true, type: Authzed.Api.V1.RelationshipUpdate, deprecated: false) @@ -192,7 +236,10 @@ end defmodule Authzed.Api.V1.WriteRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.WriteRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:written_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "writtenAt") end @@ -200,7 +247,10 @@ end defmodule Authzed.Api.V1.DeleteRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DeleteRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relationship_filter, 1, type: Authzed.Api.V1.RelationshipFilter, @@ -232,7 +282,10 @@ end defmodule Authzed.Api.V1.DeleteRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DeleteRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:deleted_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "deletedAt") @@ -241,12 +294,17 @@ defmodule Authzed.Api.V1.DeleteRelationshipsResponse do json_name: "deletionProgress", enum: true ) + + field(:relationships_deleted_count, 3, type: :uint64, json_name: "relationshipsDeletedCount") end defmodule Authzed.Api.V1.CheckPermissionRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckPermissionRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:resource, 2, type: Authzed.Api.V1.ObjectReference, deprecated: false) @@ -259,7 +317,10 @@ end defmodule Authzed.Api.V1.CheckPermissionResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckPermissionResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:checked_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "checkedAt", deprecated: false) @@ -282,7 +343,10 @@ end defmodule Authzed.Api.V1.CheckBulkPermissionsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckBulkPermissionsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) @@ -298,7 +362,10 @@ end defmodule Authzed.Api.V1.CheckBulkPermissionsRequestItem do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckBulkPermissionsRequestItem", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:resource, 1, type: Authzed.Api.V1.ObjectReference, deprecated: false) field(:permission, 2, type: :string, deprecated: false) @@ -309,7 +376,10 @@ end defmodule Authzed.Api.V1.CheckBulkPermissionsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckBulkPermissionsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:checked_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "checkedAt", deprecated: false) @@ -323,7 +393,10 @@ end defmodule Authzed.Api.V1.CheckBulkPermissionsPair do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckBulkPermissionsPair", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:response, 0) @@ -335,7 +408,10 @@ end defmodule Authzed.Api.V1.CheckBulkPermissionsResponseItem do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.CheckBulkPermissionsResponseItem", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:permissionship, 1, type: Authzed.Api.V1.CheckPermissionResponse.Permissionship, @@ -355,7 +431,10 @@ end defmodule Authzed.Api.V1.ExpandPermissionTreeRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpandPermissionTreeRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:resource, 2, type: Authzed.Api.V1.ObjectReference, deprecated: false) @@ -365,7 +444,10 @@ end defmodule Authzed.Api.V1.ExpandPermissionTreeResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExpandPermissionTreeResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:expanded_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "expandedAt") field(:tree_root, 2, type: Authzed.Api.V1.PermissionRelationshipTree, json_name: "treeRoot") @@ -374,7 +456,10 @@ end defmodule Authzed.Api.V1.LookupResourcesRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.LookupResourcesRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) @@ -394,7 +479,10 @@ end defmodule Authzed.Api.V1.LookupResourcesResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.LookupResourcesResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:looked_up_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "lookedUpAt") field(:resource_object_id, 2, type: :string, json_name: "resourceObjectId") @@ -417,7 +505,10 @@ end defmodule Authzed.Api.V1.LookupSubjectsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.LookupSubjectsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:resource, 2, type: Authzed.Api.V1.ObjectReference, deprecated: false) @@ -450,7 +541,10 @@ end defmodule Authzed.Api.V1.LookupSubjectsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.LookupSubjectsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:looked_up_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "lookedUpAt") field(:subject_object_id, 2, type: :string, json_name: "subjectObjectId", deprecated: true) @@ -488,7 +582,10 @@ end defmodule Authzed.Api.V1.ResolvedSubject do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ResolvedSubject", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:subject_object_id, 1, type: :string, json_name: "subjectObjectId") @@ -508,7 +605,10 @@ end defmodule Authzed.Api.V1.ImportBulkRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ImportBulkRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relationships, 1, repeated: true, type: Authzed.Api.V1.Relationship, deprecated: false) end @@ -516,7 +616,10 @@ end defmodule Authzed.Api.V1.ImportBulkRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ImportBulkRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:num_loaded, 1, type: :uint64, json_name: "numLoaded") end @@ -524,7 +627,10 @@ end defmodule Authzed.Api.V1.ExportBulkRelationshipsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExportBulkRelationshipsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:optional_limit, 2, type: :uint32, json_name: "optionalLimit", deprecated: false) @@ -539,7 +645,10 @@ end defmodule Authzed.Api.V1.ExportBulkRelationshipsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ExportBulkRelationshipsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:after_result_cursor, 1, type: Authzed.Api.V1.Cursor, json_name: "afterResultCursor") field(:relationships, 2, repeated: true, type: Authzed.Api.V1.Relationship) @@ -548,7 +657,7 @@ end defmodule Authzed.Api.V1.PermissionsService.Service do @moduledoc false - use GRPC.Service, name: "authzed.api.v1.PermissionsService", protoc_gen_elixir_version: "0.14.0" + use GRPC.Service, name: "authzed.api.v1.PermissionsService", protoc_gen_elixir_version: "0.16.0" rpc( :ReadRelationships, diff --git a/lib/api/v1/schema_service.pb.ex b/lib/api/v1/schema_service.pb.ex index f3220a4..341f857 100644 --- a/lib/api/v1/schema_service.pb.ex +++ b/lib/api/v1/schema_service.pb.ex @@ -1,13 +1,19 @@ defmodule Authzed.Api.V1.ReadSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReadSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 end defmodule Authzed.Api.V1.ReadSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReadSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:schema_text, 1, type: :string, json_name: "schemaText") field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt", deprecated: false) @@ -16,7 +22,10 @@ end defmodule Authzed.Api.V1.WriteSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.WriteSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:schema, 1, type: :string, deprecated: false) end @@ -24,7 +33,10 @@ end defmodule Authzed.Api.V1.WriteSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.WriteSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:written_at, 1, type: Authzed.Api.V1.ZedToken, json_name: "writtenAt", deprecated: false) end @@ -32,7 +44,10 @@ end defmodule Authzed.Api.V1.ReflectSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) @@ -46,7 +61,10 @@ end defmodule Authzed.Api.V1.ReflectSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:definitions, 1, repeated: true, type: Authzed.Api.V1.ReflectionDefinition) field(:caveats, 2, repeated: true, type: Authzed.Api.V1.ReflectionCaveat) @@ -56,7 +74,10 @@ end defmodule Authzed.Api.V1.ReflectionSchemaFilter do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionSchemaFilter", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:optional_definition_name_filter, 1, type: :string, @@ -75,7 +96,10 @@ end defmodule Authzed.Api.V1.ReflectionDefinition do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionDefinition", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -86,7 +110,10 @@ end defmodule Authzed.Api.V1.ReflectionCaveat do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionCaveat", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -97,7 +124,10 @@ end defmodule Authzed.Api.V1.ReflectionCaveatParameter do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionCaveatParameter", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:type, 2, type: :string) @@ -107,7 +137,10 @@ end defmodule Authzed.Api.V1.ReflectionRelation do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionRelation", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -123,7 +156,10 @@ end defmodule Authzed.Api.V1.ReflectionTypeReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionTypeReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:typeref, 0) @@ -137,7 +173,10 @@ end defmodule Authzed.Api.V1.ReflectionPermission do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionPermission", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:name, 1, type: :string) field(:comment, 2, type: :string) @@ -147,7 +186,10 @@ end defmodule Authzed.Api.V1.ComputablePermissionsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ComputablePermissionsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:definition_name, 2, type: :string, json_name: "definitionName") @@ -162,7 +204,10 @@ end defmodule Authzed.Api.V1.ReflectionRelationReference do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionRelationReference", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:definition_name, 1, type: :string, json_name: "definitionName") field(:relation_name, 2, type: :string, json_name: "relationName") @@ -172,7 +217,10 @@ end defmodule Authzed.Api.V1.ComputablePermissionsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ComputablePermissionsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:permissions, 1, repeated: true, type: Authzed.Api.V1.ReflectionRelationReference) field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt") @@ -181,7 +229,10 @@ end defmodule Authzed.Api.V1.DependentRelationsRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DependentRelationsRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:definition_name, 2, type: :string, json_name: "definitionName") @@ -191,7 +242,10 @@ end defmodule Authzed.Api.V1.DependentRelationsResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DependentRelationsResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relations, 1, repeated: true, type: Authzed.Api.V1.ReflectionRelationReference) field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt") @@ -200,7 +254,10 @@ end defmodule Authzed.Api.V1.DiffSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DiffSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:consistency, 1, type: Authzed.Api.V1.Consistency) field(:comparison_schema, 2, type: :string, json_name: "comparisonSchema") @@ -209,7 +266,10 @@ end defmodule Authzed.Api.V1.DiffSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.DiffSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:diffs, 1, repeated: true, type: Authzed.Api.V1.ReflectionSchemaDiff) field(:read_at, 2, type: Authzed.Api.V1.ZedToken, json_name: "readAt") @@ -218,7 +278,10 @@ end defmodule Authzed.Api.V1.ReflectionRelationSubjectTypeChange do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionRelationSubjectTypeChange", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:relation, 1, type: Authzed.Api.V1.ReflectionRelation) @@ -231,7 +294,10 @@ end defmodule Authzed.Api.V1.ReflectionCaveatParameterTypeChange do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionCaveatParameterTypeChange", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:parameter, 1, type: Authzed.Api.V1.ReflectionCaveatParameter) field(:previous_type, 2, type: :string, json_name: "previousType") @@ -240,7 +306,10 @@ end defmodule Authzed.Api.V1.ReflectionSchemaDiff do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.ReflectionSchemaDiff", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 oneof(:diff, 0) @@ -362,7 +431,7 @@ end defmodule Authzed.Api.V1.SchemaService.Service do @moduledoc false - use GRPC.Service, name: "authzed.api.v1.SchemaService", protoc_gen_elixir_version: "0.14.0" + use GRPC.Service, name: "authzed.api.v1.SchemaService", protoc_gen_elixir_version: "0.16.0" rpc(:ReadSchema, Authzed.Api.V1.ReadSchemaRequest, Authzed.Api.V1.ReadSchemaResponse) diff --git a/lib/api/v1/watch_service.pb.ex b/lib/api/v1/watch_service.pb.ex index 49837f9..4558575 100644 --- a/lib/api/v1/watch_service.pb.ex +++ b/lib/api/v1/watch_service.pb.ex @@ -1,7 +1,25 @@ +defmodule Authzed.Api.V1.WatchKind do + @moduledoc false + + use Protobuf, + enum: true, + full_name: "authzed.api.v1.WatchKind", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 + + field(:WATCH_KIND_UNSPECIFIED, 0) + field(:WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES, 1) + field(:WATCH_KIND_INCLUDE_SCHEMA_UPDATES, 2) + field(:WATCH_KIND_INCLUDE_CHECKPOINTS, 3) +end + defmodule Authzed.Api.V1.WatchRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.WatchRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:optional_object_types, 1, repeated: true, @@ -20,12 +38,22 @@ defmodule Authzed.Api.V1.WatchRequest do type: Authzed.Api.V1.RelationshipFilter, json_name: "optionalRelationshipFilters" ) + + field(:optional_update_kinds, 4, + repeated: true, + type: Authzed.Api.V1.WatchKind, + json_name: "optionalUpdateKinds", + enum: true + ) end defmodule Authzed.Api.V1.WatchResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1.WatchResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:updates, 1, repeated: true, type: Authzed.Api.V1.RelationshipUpdate) field(:changes_through, 2, type: Authzed.Api.V1.ZedToken, json_name: "changesThrough") @@ -34,12 +62,21 @@ defmodule Authzed.Api.V1.WatchResponse do type: Google.Protobuf.Struct, json_name: "optionalTransactionMetadata" ) + + field(:schema_updated, 4, type: :bool, json_name: "schemaUpdated") + field(:is_checkpoint, 5, type: :bool, json_name: "isCheckpoint") + + field(:full_revision_metadata, 6, + repeated: true, + type: Google.Protobuf.Struct, + json_name: "fullRevisionMetadata" + ) end defmodule Authzed.Api.V1.WatchService.Service do @moduledoc false - use GRPC.Service, name: "authzed.api.v1.WatchService", protoc_gen_elixir_version: "0.14.0" + use GRPC.Service, name: "authzed.api.v1.WatchService", protoc_gen_elixir_version: "0.16.0" rpc(:Watch, Authzed.Api.V1.WatchRequest, stream(Authzed.Api.V1.WatchResponse)) end diff --git a/lib/api/v1alpha1/schema.pb.ex b/lib/api/v1alpha1/schema.pb.ex index 1586048..f3ffdfd 100644 --- a/lib/api/v1alpha1/schema.pb.ex +++ b/lib/api/v1alpha1/schema.pb.ex @@ -1,7 +1,10 @@ defmodule Authzed.Api.V1alpha1.ReadSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1alpha1.ReadSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object_definitions_names, 1, repeated: true, @@ -14,7 +17,10 @@ end defmodule Authzed.Api.V1alpha1.ReadSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1alpha1.ReadSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object_definitions, 1, repeated: true, type: :string, json_name: "objectDefinitions") @@ -27,7 +33,10 @@ end defmodule Authzed.Api.V1alpha1.WriteSchemaRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1alpha1.WriteSchemaRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:schema, 1, type: :string, deprecated: false) @@ -40,7 +49,10 @@ end defmodule Authzed.Api.V1alpha1.WriteSchemaResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1alpha1.WriteSchemaResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:object_definitions_names, 1, repeated: true, @@ -59,7 +71,7 @@ defmodule Authzed.Api.V1alpha1.SchemaService.Service do use GRPC.Service, name: "authzed.api.v1alpha1.SchemaService", - protoc_gen_elixir_version: "0.14.0" + protoc_gen_elixir_version: "0.16.0" rpc( :ReadSchema, diff --git a/lib/api/v1alpha1/watchresources_service.pb.ex b/lib/api/v1alpha1/watchresources_service.pb.ex index 9b168f6..1fda0ab 100644 --- a/lib/api/v1alpha1/watchresources_service.pb.ex +++ b/lib/api/v1alpha1/watchresources_service.pb.ex @@ -1,7 +1,11 @@ defmodule Authzed.Api.V1alpha1.PermissionUpdate.Permissionship do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + enum: true, + full_name: "authzed.api.v1alpha1.PermissionUpdate.Permissionship", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:PERMISSIONSHIP_UNSPECIFIED, 0) field(:PERMISSIONSHIP_NO_PERMISSION, 1) @@ -11,7 +15,10 @@ end defmodule Authzed.Api.V1alpha1.WatchResourcesRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1alpha1.WatchResourcesRequest", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:resource_object_type, 1, type: :string, @@ -32,7 +39,10 @@ end defmodule Authzed.Api.V1alpha1.PermissionUpdate do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1alpha1.PermissionUpdate", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:subject, 1, type: Authzed.Api.V1.SubjectReference) field(:resource, 2, type: Authzed.Api.V1.ObjectReference) @@ -48,7 +58,10 @@ end defmodule Authzed.Api.V1alpha1.WatchResourcesResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + use Protobuf, + full_name: "authzed.api.v1alpha1.WatchResourcesResponse", + protoc_gen_elixir_version: "0.16.0", + syntax: :proto3 field(:updates, 1, repeated: true, type: Authzed.Api.V1alpha1.PermissionUpdate) field(:changes_through, 2, type: Authzed.Api.V1.ZedToken, json_name: "changesThrough") @@ -59,7 +72,7 @@ defmodule Authzed.Api.V1alpha1.WatchResourcesService.Service do use GRPC.Service, name: "authzed.api.v1alpha1.WatchResourcesService", - protoc_gen_elixir_version: "0.14.0" + protoc_gen_elixir_version: "0.16.0" rpc( :WatchResources, diff --git a/lib/authzed.ex b/lib/authzed.ex index 748ea84..2bcf4b8 100644 --- a/lib/authzed.ex +++ b/lib/authzed.ex @@ -41,6 +41,9 @@ defmodule Authzed do end ``` + Add `{GRPC.Client.Supervisor, []}` to your application's supervision tree so the + gRPC client can open connections (see [`GRPC.Client.Supervisor`](https://hexdocs.pm/grpc/GRPC.Client.Supervisor.html)). + ### Initializing a client In order to successfully connect, you will have to provide a [Bearer Token] with your own API Token from the [Authzed dashboard] in place of `somerandomkeyhere` in the following example: diff --git a/lib/google/rpc/code.pb.ex b/lib/google/rpc/code.pb.ex deleted file mode 100644 index 5d9046e..0000000 --- a/lib/google/rpc/code.pb.ex +++ /dev/null @@ -1,23 +0,0 @@ -defmodule Google.Rpc.Code do - @moduledoc false - - use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:OK, 0) - field(:CANCELLED, 1) - field(:UNKNOWN, 2) - field(:INVALID_ARGUMENT, 3) - field(:DEADLINE_EXCEEDED, 4) - field(:NOT_FOUND, 5) - field(:ALREADY_EXISTS, 6) - field(:PERMISSION_DENIED, 7) - field(:UNAUTHENTICATED, 16) - field(:RESOURCE_EXHAUSTED, 8) - field(:FAILED_PRECONDITION, 9) - field(:ABORTED, 10) - field(:OUT_OF_RANGE, 11) - field(:UNIMPLEMENTED, 12) - field(:INTERNAL, 13) - field(:UNAVAILABLE, 14) - field(:DATA_LOSS, 15) -end diff --git a/lib/google/rpc/context/attribute_context.pb.ex b/lib/google/rpc/context/attribute_context.pb.ex deleted file mode 100644 index 14b1d72..0000000 --- a/lib/google/rpc/context/attribute_context.pb.ex +++ /dev/null @@ -1,174 +0,0 @@ -defmodule Google.Rpc.Context.AttributeContext.Peer.LabelsEntry do - @moduledoc false - - use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Google.Rpc.Context.AttributeContext.Peer do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:ip, 1, type: :string) - field(:port, 2, type: :int64) - - field(:labels, 6, - repeated: true, - type: Google.Rpc.Context.AttributeContext.Peer.LabelsEntry, - map: true - ) - - field(:principal, 7, type: :string) - field(:region_code, 8, type: :string, json_name: "regionCode") -end - -defmodule Google.Rpc.Context.AttributeContext.Api do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:service, 1, type: :string) - field(:operation, 2, type: :string) - field(:protocol, 3, type: :string) - field(:version, 4, type: :string) -end - -defmodule Google.Rpc.Context.AttributeContext.Auth do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:principal, 1, type: :string) - field(:audiences, 2, repeated: true, type: :string) - field(:presenter, 3, type: :string) - field(:claims, 4, type: Google.Protobuf.Struct) - field(:access_levels, 5, repeated: true, type: :string, json_name: "accessLevels") -end - -defmodule Google.Rpc.Context.AttributeContext.Request.HeadersEntry do - @moduledoc false - - use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Google.Rpc.Context.AttributeContext.Request do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:id, 1, type: :string) - field(:method, 2, type: :string) - - field(:headers, 3, - repeated: true, - type: Google.Rpc.Context.AttributeContext.Request.HeadersEntry, - map: true - ) - - field(:path, 4, type: :string) - field(:host, 5, type: :string) - field(:scheme, 6, type: :string) - field(:query, 7, type: :string) - field(:time, 9, type: Google.Protobuf.Timestamp) - field(:size, 10, type: :int64) - field(:protocol, 11, type: :string) - field(:reason, 12, type: :string) - field(:auth, 13, type: Google.Rpc.Context.AttributeContext.Auth) -end - -defmodule Google.Rpc.Context.AttributeContext.Response.HeadersEntry do - @moduledoc false - - use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Google.Rpc.Context.AttributeContext.Response do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:code, 1, type: :int64) - field(:size, 2, type: :int64) - - field(:headers, 3, - repeated: true, - type: Google.Rpc.Context.AttributeContext.Response.HeadersEntry, - map: true - ) - - field(:time, 4, type: Google.Protobuf.Timestamp) - field(:backend_latency, 5, type: Google.Protobuf.Duration, json_name: "backendLatency") -end - -defmodule Google.Rpc.Context.AttributeContext.Resource.LabelsEntry do - @moduledoc false - - use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Google.Rpc.Context.AttributeContext.Resource.AnnotationsEntry do - @moduledoc false - - use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Google.Rpc.Context.AttributeContext.Resource do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:service, 1, type: :string) - field(:name, 2, type: :string) - field(:type, 3, type: :string) - - field(:labels, 4, - repeated: true, - type: Google.Rpc.Context.AttributeContext.Resource.LabelsEntry, - map: true - ) - - field(:uid, 5, type: :string) - - field(:annotations, 6, - repeated: true, - type: Google.Rpc.Context.AttributeContext.Resource.AnnotationsEntry, - map: true - ) - - field(:display_name, 7, type: :string, json_name: "displayName") - field(:create_time, 8, type: Google.Protobuf.Timestamp, json_name: "createTime") - field(:update_time, 9, type: Google.Protobuf.Timestamp, json_name: "updateTime") - field(:delete_time, 10, type: Google.Protobuf.Timestamp, json_name: "deleteTime") - field(:etag, 11, type: :string) - field(:location, 12, type: :string) -end - -defmodule Google.Rpc.Context.AttributeContext do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:origin, 7, type: Google.Rpc.Context.AttributeContext.Peer) - field(:source, 1, type: Google.Rpc.Context.AttributeContext.Peer) - field(:destination, 2, type: Google.Rpc.Context.AttributeContext.Peer) - field(:request, 3, type: Google.Rpc.Context.AttributeContext.Request) - field(:response, 4, type: Google.Rpc.Context.AttributeContext.Response) - field(:resource, 5, type: Google.Rpc.Context.AttributeContext.Resource) - field(:api, 6, type: Google.Rpc.Context.AttributeContext.Api) - field(:extensions, 8, repeated: true, type: Google.Protobuf.Any) -end diff --git a/lib/google/rpc/error_details.pb.ex b/lib/google/rpc/error_details.pb.ex deleted file mode 100644 index 684a54a..0000000 --- a/lib/google/rpc/error_details.pb.ex +++ /dev/null @@ -1,166 +0,0 @@ -defmodule Google.Rpc.ErrorInfo.MetadataEntry do - @moduledoc false - - use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Google.Rpc.ErrorInfo do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:reason, 1, type: :string) - field(:domain, 2, type: :string) - field(:metadata, 3, repeated: true, type: Google.Rpc.ErrorInfo.MetadataEntry, map: true) -end - -defmodule Google.Rpc.RetryInfo do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:retry_delay, 1, type: Google.Protobuf.Duration, json_name: "retryDelay") -end - -defmodule Google.Rpc.DebugInfo do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:stack_entries, 1, repeated: true, type: :string, json_name: "stackEntries") - field(:detail, 2, type: :string) -end - -defmodule Google.Rpc.QuotaFailure.Violation.QuotaDimensionsEntry do - @moduledoc false - - use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Google.Rpc.QuotaFailure.Violation do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:subject, 1, type: :string) - field(:description, 2, type: :string) - field(:api_service, 3, type: :string, json_name: "apiService") - field(:quota_metric, 4, type: :string, json_name: "quotaMetric") - field(:quota_id, 5, type: :string, json_name: "quotaId") - - field(:quota_dimensions, 6, - repeated: true, - type: Google.Rpc.QuotaFailure.Violation.QuotaDimensionsEntry, - json_name: "quotaDimensions", - map: true - ) - - field(:quota_value, 7, type: :int64, json_name: "quotaValue") - - field(:future_quota_value, 8, - proto3_optional: true, - type: :int64, - json_name: "futureQuotaValue" - ) -end - -defmodule Google.Rpc.QuotaFailure do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:violations, 1, repeated: true, type: Google.Rpc.QuotaFailure.Violation) -end - -defmodule Google.Rpc.PreconditionFailure.Violation do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:type, 1, type: :string) - field(:subject, 2, type: :string) - field(:description, 3, type: :string) -end - -defmodule Google.Rpc.PreconditionFailure do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:violations, 1, repeated: true, type: Google.Rpc.PreconditionFailure.Violation) -end - -defmodule Google.Rpc.BadRequest.FieldViolation do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:field, 1, type: :string) - field(:description, 2, type: :string) - field(:reason, 3, type: :string) - field(:localized_message, 4, type: Google.Rpc.LocalizedMessage, json_name: "localizedMessage") -end - -defmodule Google.Rpc.BadRequest do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:field_violations, 1, - repeated: true, - type: Google.Rpc.BadRequest.FieldViolation, - json_name: "fieldViolations" - ) -end - -defmodule Google.Rpc.RequestInfo do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:request_id, 1, type: :string, json_name: "requestId") - field(:serving_data, 2, type: :string, json_name: "servingData") -end - -defmodule Google.Rpc.ResourceInfo do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:resource_type, 1, type: :string, json_name: "resourceType") - field(:resource_name, 2, type: :string, json_name: "resourceName") - field(:owner, 3, type: :string) - field(:description, 4, type: :string) -end - -defmodule Google.Rpc.Help.Link do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:description, 1, type: :string) - field(:url, 2, type: :string) -end - -defmodule Google.Rpc.Help do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:links, 1, repeated: true, type: Google.Rpc.Help.Link) -end - -defmodule Google.Rpc.LocalizedMessage do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:locale, 1, type: :string) - field(:message, 2, type: :string) -end diff --git a/lib/google/rpc/status.pb.ex b/lib/google/rpc/status.pb.ex deleted file mode 100644 index 1f898ff..0000000 --- a/lib/google/rpc/status.pb.ex +++ /dev/null @@ -1,9 +0,0 @@ -defmodule Google.Rpc.Status do - @moduledoc false - - use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 - - field(:code, 1, type: :int32) - field(:message, 2, type: :string) - field(:details, 3, repeated: true, type: Google.Protobuf.Any) -end diff --git a/mix.exs b/mix.exs index f50cfb1..4935d3a 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Authzed.MixProject do use Mix.Project - @version "1.6.0" + @version "1.7.0" @repo_url "https://github.com/goodhamgupta/authzed_ex/" def project do @@ -32,8 +32,8 @@ defmodule Authzed.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:grpc, "~> 0.10.0"}, - {:protobuf, "~> 0.15.0"}, + {:grpc, "~> 0.11.0"}, + {:protobuf, "~> 0.16.0"}, {:ex_doc, ">= 0.0.0", only: :dev, runtime: false} ] end diff --git a/mix.lock b/mix.lock index a221a00..2c7d8ca 100644 --- a/mix.lock +++ b/mix.lock @@ -1,19 +1,21 @@ %{ - "cowboy": {:hex, :cowboy, "2.13.0", "09d770dd5f6a22cc60c071f432cd7cb87776164527f205c5a6b0f24ff6b38990", [:make, :rebar3], [{:cowlib, ">= 2.14.0 and < 3.0.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, ">= 1.8.0 and < 3.0.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "e724d3a70995025d654c1992c7b11dbfea95205c047d86ff9bf1cda92ddc5614"}, - "cowlib": {:hex, :cowlib, "2.15.0", "3c97a318a933962d1c12b96ab7c1d728267d2c523c25a5b57b0f93392b6e9e25", [:make, :rebar3], [], "hexpm", "4f00c879a64b4fe7c8fcb42a4281925e9ffdb928820b03c3ad325a617e857532"}, + "cowboy": {:hex, :cowboy, "2.14.2", "4008be1df6ade45e4f2a4e9e2d22b36d0b5aba4e20b0a0d7049e28d124e34847", [:make, :rebar3], [{:cowlib, ">= 2.16.0 and < 3.0.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, ">= 1.8.0 and < 3.0.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "569081da046e7b41b5df36aa359be71a0c8874e5b9cff6f747073fc57baf1ab9"}, + "cowlib": {:hex, :cowlib, "2.16.0", "54592074ebbbb92ee4746c8a8846e5605052f29309d3a873468d76cdf932076f", [:make, :rebar3], [], "hexpm", "7f478d80d66b747344f0ea7708c187645cfcc08b11aa424632f78e25bf05db51"}, "earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"}, - "ex_doc": {:hex, :ex_doc, "0.38.3", "ddafe36b8e9fe101c093620879f6604f6254861a95133022101c08e75e6c759a", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "ecaa785456a67f63b4e7d7f200e8832fa108279e7eb73fd9928e7e66215a01f9"}, + "ex_doc": {:hex, :ex_doc, "0.40.1", "67542e4b6dde74811cfd580e2c0149b78010fd13001fda7cfeb2b2c2ffb1344d", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "bcef0e2d360d93ac19f01a85d58f91752d930c0a30e2681145feea6bd3516e00"}, "flow": {:hex, :flow, "1.2.4", "1dd58918287eb286656008777cb32714b5123d3855956f29aa141ebae456922d", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}], "hexpm", "874adde96368e71870f3510b91e35bc31652291858c86c0e75359cbdd35eb211"}, "gen_stage": {:hex, :gen_stage, "1.3.2", "7c77e5d1e97de2c6c2f78f306f463bca64bf2f4c3cdd606affc0100b89743b7b", [:mix], [], "hexpm", "0ffae547fa777b3ed889a6b9e1e64566217413d018cabd825f786e843ffe63e7"}, - "grpc": {:hex, :grpc, "0.10.2", "e67f965c720f05fe706e403ee980c6b4e0310cd4443cecd6361845102e2a16cb", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:flow, "~> 1.2", [hex: :flow, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.14", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f3f5c48a655633551a49df8f3f90e772e7a6e26765ebe109bcb5c22cd6b55dce"}, + "googleapis": {:hex, :googleapis, "0.1.0", "13770f3f75f5b863fb9acf41633c7bc71bad788f3f553b66481a096d083ee20e", [:mix], [{:protobuf, "~> 0.12", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "1989a7244fd17d3eb5f3de311a022b656c3736b39740db46506157c4604bd212"}, + "grpc": {:hex, :grpc, "0.11.5", "5dbde9420718b58712779ad98fff1ef50349ca0fa7cc0858ae0f826015068654", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:flow, "~> 1.2", [hex: :flow, repo: "hexpm", optional: false]}, {:googleapis, "~> 0.1.0", [hex: :googleapis, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.14", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0a5d8673ef16649bef0903bca01c161acfc148e4d269133b6834b2af1f07f45e"}, "gun": {:hex, :gun, "2.2.0", "b8f6b7d417e277d4c2b0dc3c07dfdf892447b087f1cc1caff9c0f556b884e33d", [:make, :rebar3], [{:cowlib, ">= 2.15.0 and < 3.0.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "76022700c64287feb4df93a1795cff6741b83fb37415c40c34c38d2a4645261a"}, "hpax": {:hex, :hpax, "1.0.3", "ed67ef51ad4df91e75cc6a1494f851850c0bd98ebc0be6e81b026e765ee535aa", [:mix], [], "hexpm", "8eab6e1cfa8d5918c2ce4ba43588e894af35dbd8e91e6e55c817bca5847df34a"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, - "makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.3", "4252d5d4098da7415c390e847c814bad3764c94a814a0b4245176215615e1035", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "953297c02582a33411ac6208f2c6e55f0e870df7f80da724ed613f10e6706afd"}, "mint": {:hex, :mint, "1.7.1", "113fdb2b2f3b59e47c7955971854641c61f378549d73e829e1768de90fc1abf1", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "fceba0a4d0f24301ddee3024ae116df1c3f4bb7a563a731f45fdfeb9d39a231b"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, - "protobuf": {:hex, :protobuf, "0.15.0", "c9fc1e9fc1682b05c601df536d5ff21877b55e2023e0466a3855cc1273b74dcb", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "5d7bb325319db1d668838d2691c31c7b793c34111aec87d5ee467a39dac6e051"}, + "protobuf": {:hex, :protobuf, "0.16.0", "d1878725105d49162977cf3408ccc3eac4f3532e26e5a9e250f2c624175d10f6", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "f0d0d3edd8768130f24cc2cfc41320637d32c80110e80d13f160fa699102c828"}, "ranch": {:hex, :ranch, "2.2.0", "25528f82bc8d7c6152c57666ca99ec716510fe0925cb188172f41ce93117b1b0", [:make, :rebar3], [], "hexpm", "fa0b99a1780c80218a4197a59ea8d3bdae32fbff7e88527d7d8a4787eff4f8e7"}, - "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "telemetry": {:hex, :telemetry, "1.4.1", "ab6de178e2b29b58e8256b92b382ea3f590a47152ca3651ea857a6cae05ac423", [:rebar3], [], "hexpm", "2172e05a27531d3d31dd9782841065c50dd5c3c7699d95266b2edd54c2dafa1c"}, } diff --git a/test/authzed_test.exs b/test/authzed_test.exs index 2cac80a..3e0ab16 100644 --- a/test/authzed_test.exs +++ b/test/authzed_test.exs @@ -18,6 +18,8 @@ defmodule AuthzedTest do alias Authzed.Api.V1.GRPCUtil setup_all do + {:ok, _} = GRPC.Client.Supervisor.start_link([]) + {:ok, client: Client.new("localhost:50051", GRPCUtil.insecure_bearer_auth_token("somerandomkeyhere"))}