Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC/Auth2 integration #526

Open
wants to merge 20 commits into
base: feature/keycloak-oidc
Choose a base branch
from
Open
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
37 changes: 0 additions & 37 deletions Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions Dockerfile.dev

This file was deleted.

34 changes: 0 additions & 34 deletions Dockerfile.test

This file was deleted.

62 changes: 3 additions & 59 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,61 +1,5 @@
build-prod:
docker build -t openslides-auth -f Dockerfile .

build-dev:
docker build -t openslides-auth-dev -f Dockerfile.dev .

build-test:
docker build -t openslides-auth-dev -f Dockerfile.test .

run-dev-standalone: | build-dev
docker compose -f docker-compose.dev.yml up
stop-dev

run-pre-test: | build-test
docker compose -f docker-compose.dev.yml up -d
docker compose -f docker-compose.dev.yml exec -T auth ./wait-for.sh auth:9004

run-bash run-dev: | run-pre-test
USER_ID=$$(id -u $${USER}) GROUP_ID=$$(id -g $${USER}) docker compose -f docker-compose.dev.yml exec auth sh

run-check-lint:
docker compose -f docker-compose.dev.yml exec -T auth npm run lint-check

run-check-prettify:
docker compose -f docker-compose.dev.yml exec -T auth npm run prettify-check

run-check-black:
docker compose -f docker-compose.dev.yml exec -w /app/libraries/pip-auth/ -T auth black --check --diff authlib/ tests/

run-check-isort:
docker compose -f docker-compose.dev.yml exec -w /app/libraries/pip-auth/ -T auth isort --check-only --diff authlib/ tests/

run-check-flake8:
docker compose -f docker-compose.dev.yml exec -w /app/libraries/pip-auth/ -T auth flake8 authlib/ tests/

run-check-mypy:
docker compose -f docker-compose.dev.yml exec -w /app/libraries/pip-auth/ -T auth mypy authlib/ tests/

run-test: | run-pre-test
@echo "########################################################################"
@echo "###################### Start full system tests #########################"
@echo "########################################################################"
docker compose -f docker-compose.dev.yml exec -T auth npm run test
docker compose -f docker-compose.dev.yml exec -T auth pytest

run-cleanup: | build-dev
docker compose -f docker-compose.dev.yml up -d
docker compose -f docker-compose.dev.yml exec auth ./wait-for.sh auth:9004
docker compose -f docker-compose.dev.yml exec auth npm run cleanup
docker compose -f docker-compose.dev.yml down

run-test-and-stop: | run-test
stop-dev

run-test-prod: | build-prod
docker compose -f .github/startup-test/docker-compose.yml up -d
docker compose -f .github/startup-test/docker-compose.yml exec -T auth ./wait-for.sh auth:9004
docker compose -f .github/startup-test/docker-compose.yml down
docker build -t openslides-keycloak-dev -f keycloak/Dockerfile.dev keycloak
docker build -t openslides-keycloak-init-dev -f keycloak/Dockerfile.dev --target init keycloak

stop-dev:
docker compose -f docker-compose.dev.yml down
build-dev-fullstack: | build-dev
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ To avoid a separate request to the auth-service, you can install a library for a

Currently, only a pip-library is available:

Local install using pip: `pip install -e "git+ssh://[email protected]/OpenSlides/openslides-auth-service#egg=authlib&subdirectory=auth/libraries/pip-auth"`
Local install using pip: `pip install -e "git+ssh://[email protected]/OpenSlides/openslides-auth-service#egg=authlib&subdirectory=libraries/pip-auth"`

The pip-library has the following API:

````python
# The class `AuthHandler` and the constants `AUTHENTICATION_HEADER`, `AUTHORIZATION_HEADER`, `COOKIE_NAME` are exported
from authlib import AuthHandler, AUTHENTICATION_HEADER, AUTHORIZATION_HEADER, COOKIE_NAME
from os_authlib import AuthHandler, AUTHENTICATION_HEADER, AUTHORIZATION_HEADER, COOKIE_NAME

authhandler = AuthHandler(debug_fn?) # Optional: a function to print debug information can be passed.
access_token = requests.headers.get(HEADER_NAME, NONE)
Expand Down
1 change: 0 additions & 1 deletion auth/.buildstatus

This file was deleted.

Loading
Loading