Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -65,24 +65,24 @@ 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
_build
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)"
Expand All @@ -93,16 +93,14 @@ 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"
run: |
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
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,7 +29,7 @@ jobs:
elixir-version: ${{matrix.pair.elixir}}

- name: "Cache deps"
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: |
deps
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Comment thread
goodhamgupta marked this conversation as resolved.
@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
Expand Down
3 changes: 1 addition & 2 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
2 changes: 0 additions & 2 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
spicedb:
image: authzed/spicedb
Expand Down
28 changes: 22 additions & 6 deletions lib/api/materialize/v0/watchpermissions.pb.ex
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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,
Expand Down
98 changes: 86 additions & 12 deletions lib/api/materialize/v0/watchpermissionsets.pb.ex
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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,
Expand All @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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")
Expand All @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -139,25 +167,65 @@ 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

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,
Expand All @@ -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
Expand Down
Loading
Loading