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
28 changes: 15 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ on:

env:
VAULT_ADDR: https://vault.eng.aserto.com/

GO_VERSION: "1.22"

jobs:
test:
name: Run test
runs-on: ubuntu-latest
steps:
- name: Read Configuration
uses: hashicorp/vault-action@v2.7.3
uses: hashicorp/vault-action@v3
id: vault
with:
url: ${{ env.VAULT_ADDR }}
Expand All @@ -39,7 +39,7 @@ jobs:
git config --global url."[email protected]:".insteadOf https://github.com/

- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
Expand All @@ -48,20 +48,20 @@ jobs:
run: brew tap aserto-dev/tap && brew install aserto-dev/tap/topaz && topaz install

- name: Use python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.12'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.2.1
version: 1.8.3

- name: Run lint
run: |
poetry install
poetry run pyright .

- name: Run tests
run: |
poetry run pytest -vv
Expand All @@ -73,7 +73,7 @@ jobs:
name: Release to pypi
steps:
- name: Read Configuration
uses: hashicorp/vault-action@v2.4.1
uses: hashicorp/vault-action@v3
id: vault
with:
url: ${{ env.VAULT_ADDR }}
Expand All @@ -83,17 +83,17 @@ jobs:
kv/data/pypi "API_TOKEN" | POETRY_HTTP_BASIC_PYPI_PASSWORD;

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Setup caching
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
Expand All @@ -119,12 +119,14 @@ jobs:
go run mage.go deps

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3

- name: Build and push the python package
env:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/aserto-dev/python-authorizer

go 1.19
go 1.22

require github.com/magefile/mage v1.14.0
782 changes: 668 additions & 114 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ packages = [

[tool.poetry.dependencies]
python = "^3.8"
aiohttp = "^3.8.0"
grpcio = "^1.49.0"
protobuf = "^4.21.0"
aserto-authorizer = "^0.20.2"
aserto-directory = "^0.31.3"
aiohttp = "^3.9.5"
grpcio = "^1.64.1"
protobuf = "^5.27.2"
aserto-authorizer = "^0.20.3"
aserto-directory = "^0.31.4"

[tool.poetry.dev-dependencies]
black = "^23.0"
isort= "^5.9.0"
pytest-asyncio = "^0.15.0"
pytest-asyncio = "^0.23"
pyright = "^1.1.0"
requests = "^2.31.0"

Expand Down
9 changes: 5 additions & 4 deletions src/aserto/client/directory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from typing import Literal, Tuple

from aserto.client.directory.channels import Channels

__all__ = ["Channels"]


class NotFoundError(Exception):
pass


class ConfigError(Exception):
pass

Header = Literal["authorization", "aserto-tenant-id", "if-match", "if-none-match"]


def get_metadata(api_key, tenant_id) -> Tuple[Tuple[Header, str], ...]:
md: Tuple[Tuple[Header, str], ...] = ()
def get_metadata(api_key, tenant_id) -> Tuple[Tuple[str, str], ...]:
md: Tuple[Tuple[str, str], ...] = ()
if api_key:
md += (("authorization", f"basic {api_key}"),)
if tenant_id:
Expand Down
20 changes: 0 additions & 20 deletions test/assets/manifest.yaml

This file was deleted.

184 changes: 0 additions & 184 deletions test/assets/objects.json

This file was deleted.

Loading