Skip to content

Commit

Permalink
Merge pull request #39 from urbanplatform/v2-complete-redo
Browse files Browse the repository at this point in the history
2.0: App refactoring to use python-keycloak, adding CI and lazy loading, plus other improvements.
  • Loading branch information
uw-rvitorino authored Oct 28, 2022
2 parents 461353d + 882c463 commit c54a266
Show file tree
Hide file tree
Showing 63 changed files with 6,641 additions and 1,060 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Run CI tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
env:
KEYCLOAK_HOST: localhost
KEYCLOAK_PORT: 8080
KEYCLOAK_ADMIN_USER: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KEYCLOAK_REALM: test-realm
KEYCLOAK_CLIENT_ID: test-client
KEYCLOAK_CLIENT_SECRET_KEY: f6974574-c773-4554-826d-06946cd55e98
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
keycloak-tag:
[
"13.0.1",
"14.0.0",
"15.1.1",
"16.1.1",
"17.0.1-legacy",
"18.0.2-legacy",
"19.0.3-legacy",
]

services:
keycloak:
image: quay.io/keycloak/keycloak:${{ matrix.keycloak-tag }}
ports:
- 8080:8080
- 9990:9990
options: >-
-e "KEYCLOAK_USER=admin"
-e "KEYCLOAK_PASSWORD=admin"
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Set up the cache
uses: actions/cache@v3
env:
cache-name: cache-python-packages
with:
path: .venv
key: poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Set up the project
run: |
pip install poetry
poetry config virtualenvs.in-project true
poetry install
- name: Test with pytest
run: ./tests/start.sh
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ This package should only be used in projects starting from scratch, since it ove
'CLIENT_ADMIN_ROLE': '<CLIENT_ADMIN_ROLE>',
'REALM_ADMIN_ROLE': '<REALM_ADMIN_ROLE>',
'EXEMPT_URIS': [], # URIS to be ignored by the package
'GRAPHQL_ENDPOINT': 'graphql/' # Default graphQL endpoint
}
```

Expand All @@ -51,9 +50,7 @@ This package should only be used in projects starting from scratch, since it ove
AUTH_USER_MODEL = "django_keycloak.KeycloakUserAutoId"
```

7. If you are using Graphene, add the `GRAPHQL_ENDPOINT` to settings and `KeycloakGrapheneMiddleware` to the Graphene's `MIDDLEWARE`.
8. Configure Django-Rest-Framework authentication classes with `django_keycloak.authentication.KeycloakAuthentication`:
7. Configure Django-Rest-Framework authentication classes with `django_keycloak.authentication.KeycloakAuthentication`:

```python
REST_FRAMEWORK = {
Expand Down
27 changes: 0 additions & 27 deletions django_keycloak/api/serializers.py

This file was deleted.

64 changes: 0 additions & 64 deletions django_keycloak/authentication.py

This file was deleted.

46 changes: 0 additions & 46 deletions django_keycloak/backends.py

This file was deleted.

20 changes: 0 additions & 20 deletions django_keycloak/decorators.py

This file was deleted.

5 changes: 0 additions & 5 deletions django_keycloak/enums.py

This file was deleted.

8 changes: 0 additions & 8 deletions django_keycloak/errors.py

This file was deleted.

Loading

0 comments on commit c54a266

Please sign in to comment.