diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2d2f683960..9756a3f688 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -27,7 +27,7 @@ values = [bumpversion:file:.github/workflows/release.yml] -[bumpversion:file:passbook/__init__.py] +[bumpversion:file:authentik/__init__.py] [bumpversion:file:proxy/pkg/version.go] diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 01241f2d7f..0000000000 --- a/.coveragerc +++ /dev/null @@ -1,33 +0,0 @@ -[run] -source = passbook -relative_files = true -omit = - */asgi.py - manage.py - */migrations/* - */apps.py - website/ - -[report] -sort = Cover -skip_covered = True -precision = 2 -exclude_lines = - pragma: no cover - - # Don't complain about missing debug-only code: - def __unicode__ - def __str__ - def __repr__ - if self\.debug - if TYPE_CHECKING - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: - -show_missing = True diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 21e7a1a8da..79b68b5495 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -27,7 +27,7 @@ If applicable, add screenshots to help explain your problem. Output of docker-compose logs or kubectl logs respectively **Version and Deployment (please complete the following information):** - - passbook version: [e.g. 0.10.0-stable] + - authentik version: [e.g. 0.10.0-stable] - Deployment: [e.g. docker-compose, helm] **Additional context** diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cdacf527f..cfc172e635 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: passbook-on-release +name: authentik-on-release on: release: @@ -18,13 +18,13 @@ jobs: - name: Building Docker Image run: docker build --no-cache - -t beryju/passbook:0.12.11-stable - -t beryju/passbook:latest + -t beryju/authentik:0.12.11-stable + -t beryju/authentik:latest -f Dockerfile . - name: Push Docker Container to Registry (versioned) - run: docker push beryju/passbook:0.12.11-stable + run: docker push beryju/authentik:0.12.11-stable - name: Push Docker Container to Registry (latest) - run: docker push beryju/passbook:latest + run: docker push beryju/authentik:latest build-proxy: runs-on: ubuntu-latest steps: @@ -36,7 +36,7 @@ jobs: run: | cd proxy go get -u github.com/go-swagger/go-swagger/cmd/swagger - swagger generate client -f ../swagger.yaml -A passbook -t pkg/ + swagger generate client -f ../swagger.yaml -A authentik -t pkg/ go build -v . - name: Docker Login Registry env: @@ -48,13 +48,13 @@ jobs: cd proxy/ docker build \ --no-cache \ - -t beryju/passbook-proxy:0.12.11-stable \ - -t beryju/passbook-proxy:latest \ + -t beryju/authentik-proxy:0.12.11-stable \ + -t beryju/authentik-proxy:latest \ -f Dockerfile . - name: Push Docker Container to Registry (versioned) - run: docker push beryju/passbook-proxy:0.12.11-stable + run: docker push beryju/authentik-proxy:0.12.11-stable - name: Push Docker Container to Registry (latest) - run: docker push beryju/passbook-proxy:latest + run: docker push beryju/authentik-proxy:latest build-static: runs-on: ubuntu-latest steps: @@ -69,13 +69,13 @@ jobs: cd web/ docker build \ --no-cache \ - -t beryju/passbook-static:0.12.11-stable \ - -t beryju/passbook-static:latest \ + -t beryju/authentik-static:0.12.11-stable \ + -t beryju/authentik-static:latest \ -f Dockerfile . - name: Push Docker Container to Registry (versioned) - run: docker push beryju/passbook-static:0.12.11-stable + run: docker push beryju/authentik-static:0.12.11-stable - name: Push Docker Container to Registry (latest) - run: docker push beryju/passbook-static:latest + run: docker push beryju/authentik-static:latest test-release: needs: - build-server @@ -87,11 +87,11 @@ jobs: run: | sudo apt-get install -y pwgen echo "PG_PASS=$(pwgen 40 1)" >> .env - echo "PASSBOOK_SECRET_KEY=$(pwgen 50 1)" >> .env + echo "AUTHENTIK_SECRET_KEY=$(pwgen 50 1)" >> .env docker-compose pull -q docker-compose up --no-start docker-compose start postgresql redis - docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test passbook" + docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test authentik" sentry-release: needs: - test-release @@ -103,7 +103,7 @@ jobs: env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_ORG: beryjuorg - SENTRY_PROJECT: passbook + SENTRY_PROJECT: authentik SENTRY_URL: https://sentry.beryju.org with: tagName: 0.12.11-stable diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 49b31670b7..58e94afaa2 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -1,4 +1,4 @@ -name: passbook-on-tag +name: authentik-on-tag on: push: @@ -14,17 +14,17 @@ jobs: - name: Pre-release test run: | sudo apt-get install -y pwgen - echo "PASSBOOK_TAG=latest" >> .env + echo "AUTHENTIK_TAG=latest" >> .env echo "PG_PASS=$(pwgen 40 1)" >> .env - echo "PASSBOOK_SECRET_KEY=$(pwgen 50 1)" >> .env + echo "AUTHENTIK_SECRET_KEY=$(pwgen 50 1)" >> .env docker-compose pull -q docker build \ --no-cache \ - -t beryju/passbook:latest \ + -t beryju/authentik:latest \ -f Dockerfile . docker-compose up --no-start docker-compose start postgresql redis - docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test passbook" + docker-compose run -u root --entrypoint /bin/bash server -c "pip install --no-cache -r requirements-dev.txt && ./manage.py test authentik" - name: Install Helm run: | apt update && apt install -y curl @@ -33,7 +33,7 @@ jobs: run: | helm dependency update helm/ helm package helm/ - mv passbook-*.tgz passbook-chart.tgz + mv authentik-*.tgz authentik-chart.tgz - name: Extract version number id: get_version uses: actions/github-script@0.2.0 @@ -58,6 +58,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./passbook-chart.tgz - asset_name: passbook-chart.tgz + asset_path: ./authentik-chart.tgz + asset_name: authentik-chart.tgz asset_content_type: application/gzip diff --git a/Dockerfile b/Dockerfile index 1ab59048db..d2d001c49e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,18 +30,18 @@ RUN apt-get update && \ # but then we have to drop permmissions later groupadd -g 998 docker_998 && \ groupadd -g 999 docker_999 && \ - adduser --system --no-create-home --uid 1000 --group --home /passbook passbook && \ - usermod -a -G docker_998 passbook && \ - usermod -a -G docker_999 passbook && \ + adduser --system --no-create-home --uid 1000 --group --home /authentik authentik && \ + usermod -a -G docker_998 authentik && \ + usermod -a -G docker_999 authentik && \ mkdir /backups && \ - chown passbook:passbook /backups + chown authentik:authentik /backups -COPY ./passbook/ /passbook +COPY ./authentik/ /authentik COPY ./pytest.ini / COPY ./manage.py / COPY ./lifecycle/ /lifecycle -USER passbook +USER authentik STOPSIGNAL SIGINT ENV TMPDIR /dev/shm/ ENTRYPOINT [ "/lifecycle/bootstrap.sh" ] diff --git a/Makefile b/Makefile index 3356d25e22..0d5abc4a54 100644 --- a/Makefile +++ b/Makefile @@ -9,30 +9,30 @@ test-e2e: coverage run manage.py test --failfast -v 3 tests/e2e coverage: - coverage run manage.py test --failfast -v 3 passbook + coverage run manage.py test --failfast -v 3 authentik coverage html coverage report lint-fix: - isort -rc . - black passbook tests lifecycle + isort -rc authentik tests lifecycle + black authentik tests lifecycle lint: - pyright passbook tests lifecycle - bandit -r passbook tests lifecycle -x node_modules - pylint passbook tests lifecycle + pyright authentik tests lifecycle + bandit -r authentik tests lifecycle -x node_modules + pylint authentik tests lifecycle prospector gen: coverage ./manage.py generate_swagger -o swagger.yaml -f yaml local-stack: - export PASSBOOK_TAG=testing - docker build -t beryju/passbook:testng . + export AUTHENTIK_TAG=testing + docker build -t beryju/authentik:testng . docker-compose up -d docker-compose run --rm server migrate build-static: docker-compose -f scripts/ci.docker-compose.yml up -d - docker build -t beryju/passbook-static -f static.Dockerfile --network=scripts_default . + docker build -t beryju/authentik-static -f static.Dockerfile --network=scripts_default . docker-compose -f scripts/ci.docker-compose.yml down -v diff --git a/README.md b/README.md index 483d0e3709..7842cf896e 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,23 @@ -passbook logopassbook +authentik logo -[![CI Build status](https://img.shields.io/azure-devops/build/beryjuorg/passbook/1?style=flat-square)](https://dev.azure.com/beryjuorg/passbook/_build?definitionId=1) -![Tests](https://img.shields.io/azure-devops/tests/beryjuorg/passbook/1?compact_message&style=flat-square) -[![Code Coverage](https://img.shields.io/codecov/c/gh/beryju/passbook?style=flat-square)](https://codecov.io/gh/BeryJu/passbook) -![Docker pulls](https://img.shields.io/docker/pulls/beryju/passbook.svg?style=flat-square) -![Latest version](https://img.shields.io/docker/v/beryju/passbook?sort=semver&style=flat-square) -![LGTM Grade](https://img.shields.io/lgtm/grade/python/github/BeryJu/passbook?style=flat-square) +--- -## What is passbook? +[![CI Build status](https://img.shields.io/azure-devops/build/beryjuorg/authentik/1?style=flat-square)](https://dev.azure.com/beryjuorg/authentik/_build?definitionId=1) +[![Tests](https://img.shields.io/azure-devops/tests/beryjuorg/authentik/1?compact_message&style=flat-square)](https://dev.azure.com/beryjuorg/authentik/_build?definitionId=1) +[![Code Coverage](https://img.shields.io/codecov/c/gh/beryju/authentik?style=flat-square)](https://codecov.io/gh/BeryJu/authentik) +![Docker pulls](https://img.shields.io/docker/pulls/beryju/authentik.svg?style=flat-square) +![Latest version](https://img.shields.io/docker/v/beryju/authentik?sort=semver&style=flat-square) +![LGTM Grade](https://img.shields.io/lgtm/grade/python/github/BeryJu/authentik?style=flat-square) -passbook is an open-source Identity Provider focused on flexibility and versatility. You can use passbook in an existing environment to add support for new protocols. passbook is also a great solution for implementing signup/recovery/etc in your application, so you don't have to deal with it. +## What is authentik? + +authentik is an open-source Identity Provider focused on flexibility and versatility. You can use authentik in an existing environment to add support for new protocols. authentik is also a great solution for implementing signup/recovery/etc in your application, so you don't have to deal with it. ## Installation -For small/test setups it is recommended to use docker-compose, see the [documentation](https://passbook.beryju.org/docs/installation/docker-compose/) +For small/test setups it is recommended to use docker-compose, see the [documentation](https://goauthentik.io/docs/installation/docker-compose/) -For bigger setups, there is a Helm Chart in the `helm/` directory. This is documented [here](https://passbook.beryju.org/docs/installation/kubernetes/) +For bigger setups, there is a Helm Chart in the `helm/` directory. This is documented [here](https://goauthentik.io/docs/installation/kubernetes/) ## Screenshots @@ -24,7 +26,7 @@ For bigger setups, there is a Helm Chart in the `helm/` directory. This is docum ## Development -See [Development Documentation](https://passbook.beryju.org/docs/development/local-dev-environment) +See [Development Documentation](https://goauthentik.io/docs/development/local-dev-environment) ## Security diff --git a/SECURITY.md b/SECURITY.md index 03e7185665..b88f63f361 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Supported Versions -As passbook is currently in a pre-stable, only the latest "stable" version is supported. After passbook 1.0, this will change. +As authentik is currently in a pre-stable, only the latest "stable" version is supported. After authentik 1.0, this will change. | Version | Supported | | -------- | ------------------ | diff --git a/passbook/__init__.py b/authentik/__init__.py similarity index 65% rename from passbook/__init__.py rename to authentik/__init__.py index 8ddafcd44e..3570122fae 100644 --- a/passbook/__init__.py +++ b/authentik/__init__.py @@ -1,2 +1,2 @@ -"""passbook""" +"""authentik""" __version__ = "0.12.11-stable" diff --git a/passbook/admin/__init__.py b/authentik/admin/__init__.py similarity index 100% rename from passbook/admin/__init__.py rename to authentik/admin/__init__.py diff --git a/passbook/admin/api/__init__.py b/authentik/admin/api/__init__.py similarity index 100% rename from passbook/admin/api/__init__.py rename to authentik/admin/api/__init__.py diff --git a/passbook/admin/api/overview.py b/authentik/admin/api/overview.py similarity index 90% rename from passbook/admin/api/overview.py rename to authentik/admin/api/overview.py index 801ad84264..e61068abc5 100644 --- a/passbook/admin/api/overview.py +++ b/authentik/admin/api/overview.py @@ -1,4 +1,4 @@ -"""passbook administration overview""" +"""authentik administration overview""" from django.core.cache import cache from drf_yasg2.utils import swagger_auto_schema from rest_framework.fields import SerializerMethodField @@ -8,11 +8,11 @@ from rest_framework.response import Response from rest_framework.serializers import Serializer from rest_framework.viewsets import ViewSet -from passbook import __version__ -from passbook.admin.tasks import VERSION_CACHE_KEY, update_latest_version -from passbook.core.models import Provider -from passbook.policies.models import Policy -from passbook.root.celery import CELERY_APP +from authentik import __version__ +from authentik.admin.tasks import VERSION_CACHE_KEY, update_latest_version +from authentik.core.models import Provider +from authentik.policies.models import Policy +from authentik.root.celery import CELERY_APP class AdministrationOverviewSerializer(Serializer): diff --git a/passbook/admin/api/overview_metrics.py b/authentik/admin/api/overview_metrics.py similarity index 96% rename from passbook/admin/api/overview_metrics.py rename to authentik/admin/api/overview_metrics.py index f5c91e7c87..e1c29e54f8 100644 --- a/passbook/admin/api/overview_metrics.py +++ b/authentik/admin/api/overview_metrics.py @@ -1,4 +1,4 @@ -"""passbook administration overview""" +"""authentik administration overview""" import time from collections import Counter from datetime import timedelta @@ -17,7 +17,7 @@ from rest_framework.response import Response from rest_framework.serializers import Serializer from rest_framework.viewsets import ViewSet -from passbook.audit.models import Event, EventAction +from authentik.audit.models import Event, EventAction def get_events_per_1h(**filter_kwargs) -> List[Dict[str, int]]: diff --git a/passbook/admin/api/tasks.py b/authentik/admin/api/tasks.py similarity index 98% rename from passbook/admin/api/tasks.py rename to authentik/admin/api/tasks.py index 3ba020d96a..dbaf5d5e12 100644 --- a/passbook/admin/api/tasks.py +++ b/authentik/admin/api/tasks.py @@ -13,7 +13,7 @@ from rest_framework.response import Response from rest_framework.serializers import Serializer from rest_framework.viewsets import ViewSet -from passbook.lib.tasks import TaskInfo +from authentik.lib.tasks import TaskInfo class TaskSerializer(Serializer): diff --git a/authentik/admin/apps.py b/authentik/admin/apps.py new file mode 100644 index 0000000000..db05f4daa7 --- /dev/null +++ b/authentik/admin/apps.py @@ -0,0 +1,11 @@ +"""authentik admin app config""" +from django.apps import AppConfig + + +class AuthentikAdminConfig(AppConfig): + """authentik admin app config""" + + name = "authentik.admin" + label = "authentik_admin" + mountpoint = "administration/" + verbose_name = "authentik Admin" diff --git a/passbook/admin/fields.py b/authentik/admin/fields.py similarity index 100% rename from passbook/admin/fields.py rename to authentik/admin/fields.py diff --git a/passbook/admin/forms/__init__.py b/authentik/admin/forms/__init__.py similarity index 100% rename from passbook/admin/forms/__init__.py rename to authentik/admin/forms/__init__.py diff --git a/passbook/admin/forms/overview.py b/authentik/admin/forms/overview.py similarity index 100% rename from passbook/admin/forms/overview.py rename to authentik/admin/forms/overview.py diff --git a/passbook/admin/forms/policies.py b/authentik/admin/forms/policies.py similarity index 64% rename from passbook/admin/forms/policies.py rename to authentik/admin/forms/policies.py index 9751260d0f..17112b5885 100644 --- a/passbook/admin/forms/policies.py +++ b/authentik/admin/forms/policies.py @@ -1,8 +1,8 @@ -"""passbook administration forms""" +"""authentik administration forms""" from django import forms -from passbook.admin.fields import CodeMirrorWidget, YAMLField -from passbook.core.models import User +from authentik.admin.fields import CodeMirrorWidget, YAMLField +from authentik.core.models import User class PolicyTestForm(forms.Form): diff --git a/passbook/admin/forms/source.py b/authentik/admin/forms/source.py similarity index 85% rename from passbook/admin/forms/source.py rename to authentik/admin/forms/source.py index 2207dec1c0..5e5d04393f 100644 --- a/passbook/admin/forms/source.py +++ b/authentik/admin/forms/source.py @@ -1,4 +1,4 @@ -"""passbook core source form fields""" +"""authentik core source form fields""" SOURCE_FORM_FIELDS = [ "name", diff --git a/passbook/admin/forms/users.py b/authentik/admin/forms/users.py similarity index 72% rename from passbook/admin/forms/users.py rename to authentik/admin/forms/users.py index 2e9f51eb2f..b7c3cc8d72 100644 --- a/passbook/admin/forms/users.py +++ b/authentik/admin/forms/users.py @@ -1,9 +1,9 @@ -"""passbook administrative user forms""" +"""authentik administrative user forms""" from django import forms -from passbook.admin.fields import CodeMirrorWidget, YAMLField -from passbook.core.models import User +from authentik.admin.fields import CodeMirrorWidget, YAMLField +from authentik.core.models import User class UserForm(forms.ModelForm): diff --git a/passbook/admin/mixins.py b/authentik/admin/mixins.py similarity index 88% rename from passbook/admin/mixins.py rename to authentik/admin/mixins.py index 1ac2fa8217..97ee3c53a9 100644 --- a/passbook/admin/mixins.py +++ b/authentik/admin/mixins.py @@ -1,4 +1,4 @@ -"""passbook admin mixins""" +"""authentik admin mixins""" from django.contrib.auth.mixins import UserPassesTestMixin diff --git a/passbook/admin/settings.py b/authentik/admin/settings.py similarity index 51% rename from passbook/admin/settings.py rename to authentik/admin/settings.py index d6690770a1..57e0de6e6b 100644 --- a/passbook/admin/settings.py +++ b/authentik/admin/settings.py @@ -1,10 +1,10 @@ -"""passbook admin settings""" +"""authentik admin settings""" from celery.schedules import crontab CELERY_BEAT_SCHEDULE = { "admin_latest_version": { - "task": "passbook.admin.tasks.update_latest_version", + "task": "authentik.admin.tasks.update_latest_version", "schedule": crontab(minute=0), # Run every hour - "options": {"queue": "passbook_scheduled"}, + "options": {"queue": "authentik_scheduled"}, } } diff --git a/passbook/admin/tasks.py b/authentik/admin/tasks.py similarity index 69% rename from passbook/admin/tasks.py rename to authentik/admin/tasks.py index 4c9532a4c9..2bff1ecba9 100644 --- a/passbook/admin/tasks.py +++ b/authentik/admin/tasks.py @@ -1,13 +1,13 @@ -"""passbook admin tasks""" +"""authentik admin tasks""" from django.core.cache import cache from requests import RequestException, get from structlog import get_logger -from passbook.lib.tasks import MonitoredTask, TaskResult, TaskResultStatus -from passbook.root.celery import CELERY_APP +from authentik.lib.tasks import MonitoredTask, TaskResult, TaskResultStatus +from authentik.root.celery import CELERY_APP LOGGER = get_logger() -VERSION_CACHE_KEY = "passbook_latest_version" +VERSION_CACHE_KEY = "authentik_latest_version" VERSION_CACHE_TIMEOUT = 2 * 60 * 60 # 2 hours @@ -15,9 +15,9 @@ VERSION_CACHE_TIMEOUT = 2 * 60 * 60 # 2 hours def update_latest_version(self: MonitoredTask): """Update latest version info""" try: - data = get( - "https://api.github.com/repos/beryju/passbook/releases/latest" - ).json() + response = get("https://api.github.com/repos/beryju/authentik/releases/latest") + response.raise_for_status() + data = response.json() tag_name = data.get("tag_name") cache.set(VERSION_CACHE_KEY, tag_name.split("/")[1], VERSION_CACHE_TIMEOUT) self.set_status( diff --git a/passbook/admin/templates/administration/application/list.html b/authentik/admin/templates/administration/application/list.html similarity index 76% rename from passbook/admin/templates/administration/application/list.html rename to authentik/admin/templates/administration/application/list.html index 4948925241..843fa6c15f 100644 --- a/passbook/admin/templates/administration/application/list.html +++ b/authentik/admin/templates/administration/application/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -10,7 +10,7 @@ {% trans 'Applications' %} -

{% trans "External Applications which use passbook as Identity-Provider, utilizing protocols like OAuth2 and SAML." %}

+

{% trans "External Applications which use authentik as Identity-Provider, utilizing protocols like OAuth2 and SAML." %}

@@ -20,13 +20,13 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
-
@@ -68,18 +68,18 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -107,12 +107,12 @@ {% trans 'Currently no applications exist. Click the button below to create one.' %} {% endif %}
- - + + {% trans 'Create' %} - +
-
+ {% endif %} diff --git a/passbook/admin/templates/administration/base.html b/authentik/admin/templates/administration/base.html similarity index 100% rename from passbook/admin/templates/administration/base.html rename to authentik/admin/templates/administration/base.html diff --git a/passbook/admin/templates/administration/certificatekeypair/list.html b/authentik/admin/templates/administration/certificatekeypair/list.html similarity index 77% rename from passbook/admin/templates/administration/certificatekeypair/list.html rename to authentik/admin/templates/administration/certificatekeypair/list.html index 251551682f..8acfcb016f 100644 --- a/passbook/admin/templates/administration/certificatekeypair/list.html +++ b/authentik/admin/templates/administration/certificatekeypair/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -20,13 +20,13 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
-
@@ -63,18 +63,18 @@ {{ kp.fingerprint }} - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -102,12 +102,12 @@ {% trans 'Currently no certificates exist. Click the button below to create one.' %} {% endif %}
- - + + {% trans 'Create' %} - +
-
+ {% endif %} diff --git a/passbook/admin/templates/administration/flow/import.html b/authentik/admin/templates/administration/flow/import.html similarity index 100% rename from passbook/admin/templates/administration/flow/import.html rename to authentik/admin/templates/administration/flow/import.html diff --git a/passbook/admin/templates/administration/flow/list.html b/authentik/admin/templates/administration/flow/list.html similarity index 69% rename from passbook/admin/templates/administration/flow/list.html rename to authentik/admin/templates/administration/flow/list.html index 9102643e52..f1a27a0d3a 100644 --- a/passbook/admin/templates/administration/flow/list.html +++ b/authentik/admin/templates/administration/flow/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -20,19 +20,19 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
- - + + + {% trans 'Import' %} - +
-
-
@@ -74,20 +74,20 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
- {% trans 'Execute' %} - {% trans 'Export' %} + + {% trans 'Execute' %} + {% trans 'Export' %} {% endfor %} @@ -115,18 +115,18 @@ {% trans 'Currently no flows exist. Click the button below to create one.' %} {% endif %}
- - + + {% trans 'Create' %} - +
-
- - + + + {% trans 'Import' %} - +
-
+ {% endif %} diff --git a/passbook/admin/templates/administration/group/list.html b/authentik/admin/templates/administration/group/list.html similarity index 78% rename from passbook/admin/templates/administration/group/list.html rename to authentik/admin/templates/administration/group/list.html index 0f452766bc..3d1b8eb0fb 100644 --- a/passbook/admin/templates/administration/group/list.html +++ b/authentik/admin/templates/administration/group/list.html @@ -20,13 +20,13 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
-
@@ -61,18 +61,18 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -100,12 +100,12 @@ {% trans 'Currently no group exist. Click the button below to create one.' %} {% endif %}
- - + + {% trans 'Create' %} - +
-
+ {% endif %} diff --git a/passbook/admin/templates/administration/outpost/list.html b/authentik/admin/templates/administration/outpost/list.html similarity index 81% rename from passbook/admin/templates/administration/outpost/list.html rename to authentik/admin/templates/administration/outpost/list.html index 693b269cbc..2af8493955 100644 --- a/passbook/admin/templates/administration/outpost/list.html +++ b/authentik/admin/templates/administration/outpost/list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load humanize %} -{% load passbook_utils %} +{% load authentik_utils %} {% load admin_reflection %} {% block content %} @@ -12,7 +12,7 @@ {% trans 'Outposts' %} -

{% trans "Outposts are deployments of passbook components to support different environments and protocols, like reverse proxies." %}

+

{% trans "Outposts are deployments of authentik components to support different environments and protocols, like reverse proxies." %}

@@ -22,13 +22,13 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
-
@@ -92,18 +92,18 @@ {% endif %} {% endwith %} - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% get_htmls outpost as htmls %} {% for html in htmls %} {{ html|safe }} @@ -135,12 +135,12 @@ {% trans 'Currently no outposts exist. Click the button below to create one.' %} {% endif %}
- - + + {% trans 'Create' %} - +
-
+ {% endif %} diff --git a/passbook/admin/templates/administration/outpost_service_connection/list.html b/authentik/admin/templates/administration/outpost_service_connection/list.html similarity index 81% rename from passbook/admin/templates/administration/outpost_service_connection/list.html rename to authentik/admin/templates/administration/outpost_service_connection/list.html index 0dcbc429e3..79cee25d0c 100644 --- a/passbook/admin/templates/administration/outpost_service_connection/list.html +++ b/authentik/admin/templates/administration/outpost_service_connection/list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load humanize %} -{% load passbook_utils %} +{% load authentik_utils %} {% load admin_reflection %} {% block content %} @@ -12,7 +12,7 @@ {% trans 'Outpost Service-Connections' %} -

{% trans "Outpost Service-Connections define how passbook connects to external platforms to manage and deploy Outposts." %}

+

{% trans "Outpost Service-Connections define how authentik connects to external platforms to manage and deploy Outposts." %}

@@ -22,7 +22,7 @@
{% include 'partials/toolbar_search.html' %}
- +
- + {% endfor %} -
-
@@ -86,18 +86,18 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -125,7 +125,7 @@ {% trans 'Currently no service connections exist. Click the button below to create one.' %} {% endif %}
- +
- + {% endfor %} -
+ {% endif %} diff --git a/passbook/admin/templates/administration/overview.html b/authentik/admin/templates/administration/overview.html similarity index 87% rename from passbook/admin/templates/administration/overview.html rename to authentik/admin/templates/administration/overview.html index d504096dab..ee38a95757 100644 --- a/passbook/admin/templates/administration/overview.html +++ b/authentik/admin/templates/administration/overview.html @@ -18,7 +18,7 @@
- +
{% if providers_without_application.exists %} -

+

{{ provider_count }}

{% trans 'Warning: At least one Provider has no application assigned.' %}

{% else %} -

+

{{ provider_count }}

{% endif %} @@ -83,18 +83,18 @@
{% trans 'Policies' %}
- +
{% if policies_without_binding %} -

+

{{ policy_count }}

{% trans 'Policies without binding exist.' %}

{% else %} -

+

{{ policy_count }}

{% endif %} @@ -106,12 +106,12 @@
{% trans 'Users' %}
- +
-

+

{{ user_count }}

@@ -122,12 +122,12 @@
{% trans 'Version' %}
- +
-

+

{% if version >= version_latest %} {{ version }} {% else %} @@ -152,15 +152,15 @@ {% trans 'Workers' %}

- +
-

+

{% trans 'No workers connected.' %}

-

+

@@ -179,21 +179,21 @@
{% trans 'Cached Policies' %}
- +
-
+
{% if cached_policies < 1 %} -

+

{{ cached_policies }}

{% trans 'No policies cached. Users may experience slow response times.' %}

{% else %} -

+

{{ cached_policies }}

{% endif %} @@ -205,21 +205,21 @@
{% trans 'Cached Flows' %}
- +
-
+
{% if cached_flows < 1 %} -

+

{{ cached_flows }}

{% trans 'No flows cached.' %}

{% else %} -

+

{{ cached_flows }}

{% endif %} diff --git a/passbook/admin/templates/administration/policy/list.html b/authentik/admin/templates/administration/policy/list.html similarity index 81% rename from passbook/admin/templates/administration/policy/list.html rename to authentik/admin/templates/administration/policy/list.html index d985ab4d96..618013c5f0 100644 --- a/passbook/admin/templates/administration/policy/list.html +++ b/authentik/admin/templates/administration/policy/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -20,7 +20,7 @@
{% include 'partials/toolbar_search.html' %}
- +
- + {% endfor %} -
+
{% include 'partials/pagination.html' %}
@@ -74,24 +74,24 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Test' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -119,7 +119,7 @@ {% trans 'Currently no policies exist. Click the button below to create one.' %} {% endif %}
- +
- + {% endfor %} -
+ {% endif %} diff --git a/passbook/admin/templates/administration/policy/test.html b/authentik/admin/templates/administration/policy/test.html similarity index 100% rename from passbook/admin/templates/administration/policy/test.html rename to authentik/admin/templates/administration/policy/test.html diff --git a/passbook/admin/templates/administration/policy_binding/list.html b/authentik/admin/templates/administration/policy_binding/list.html similarity index 78% rename from passbook/admin/templates/administration/policy_binding/list.html rename to authentik/admin/templates/administration/policy_binding/list.html index f4e7d9fd66..ee581d6c8e 100644 --- a/passbook/admin/templates/administration/policy_binding/list.html +++ b/authentik/admin/templates/administration/policy_binding/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -19,13 +19,13 @@
- - + + {% trans 'Create' %} - +
-
-
@@ -74,18 +74,18 @@
{{ binding.timeout }}
- - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -105,12 +105,12 @@
{% trans 'Currently no policy bindings exist. Click the button below to create one.' %}
- - + + {% trans 'Create' %} - +
-
+
{% endif %} diff --git a/passbook/admin/templates/administration/property_mapping/list.html b/authentik/admin/templates/administration/property_mapping/list.html similarity index 80% rename from passbook/admin/templates/administration/property_mapping/list.html rename to authentik/admin/templates/administration/property_mapping/list.html index 011154bc70..6b1f72ec4c 100644 --- a/passbook/admin/templates/administration/property_mapping/list.html +++ b/authentik/admin/templates/administration/property_mapping/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -10,7 +10,7 @@ {% trans 'Property Mappings' %} -

{% trans "Control how passbook exposes and interprets information." %} +

{% trans "Control how authentik exposes and interprets information." %}

@@ -21,7 +21,7 @@
{% include 'partials/toolbar_search.html' %}
- +
- + {% endfor %} -
-
@@ -71,18 +71,18 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -110,7 +110,7 @@ {% trans 'Currently no property mappings exist. Click the button below to create one.' %} {% endif %}
- +
- + {% endfor %} - +
{% endif %} diff --git a/passbook/admin/templates/administration/provider/list.html b/authentik/admin/templates/administration/provider/list.html similarity index 84% rename from passbook/admin/templates/administration/provider/list.html rename to authentik/admin/templates/administration/provider/list.html index 1bdbe68b12..572dc7caf2 100644 --- a/passbook/admin/templates/administration/provider/list.html +++ b/authentik/admin/templates/administration/provider/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% load admin_reflection %} {% block content %} @@ -22,7 +22,7 @@
{% include 'partials/toolbar_search.html' %}
- +
- + {% endfor %} -
-
@@ -83,21 +83,21 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% get_links provider as links %} {% for name, href in links.items %} - {% trans name %} + {% trans name %} {% endfor %} {% get_htmls provider as htmls %} {% for html in htmls %} @@ -130,7 +130,7 @@ {% trans 'Currently no providers exist. Click the button below to create one.' %} {% endif %}
- +
- + {% endfor %} -
+ {% endif %} diff --git a/passbook/admin/templates/administration/source/list.html b/authentik/admin/templates/administration/source/list.html similarity index 81% rename from passbook/admin/templates/administration/source/list.html rename to authentik/admin/templates/administration/source/list.html index aa63ca60aa..a4a01442e2 100644 --- a/passbook/admin/templates/administration/source/list.html +++ b/authentik/admin/templates/administration/source/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% load admin_reflection %} {% block content %} @@ -11,7 +11,7 @@ {% trans 'Source' %} -

{% trans "External Sources which can be used to get Identities into passbook, for example Social Providers like Twiter and GitHub or Enterprise Providers like ADFS and LDAP." %} +

{% trans "External Sources which can be used to get Identities into authentik, for example Social Providers like Twiter and GitHub or Enterprise Providers like ADFS and LDAP." %}

@@ -22,7 +22,7 @@
{% include 'partials/toolbar_search.html' %}
- +
- + {% endfor %} -
-
@@ -81,21 +81,21 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% get_links source as links %} {% for name, href in links %} - {% trans name %} + {% trans name %} {% endfor %} @@ -124,7 +124,7 @@ {% trans 'Currently no sources exist. Click the button below to create one.' %} {% endif %}
- +
- + {% endfor %} -
+ {% endif %} diff --git a/passbook/admin/templates/administration/stage/list.html b/authentik/admin/templates/administration/stage/list.html similarity index 82% rename from passbook/admin/templates/administration/stage/list.html rename to authentik/admin/templates/administration/stage/list.html index bb32294d5a..4fe3d48ffd 100644 --- a/passbook/admin/templates/administration/stage/list.html +++ b/authentik/admin/templates/administration/stage/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% load admin_reflection %} {% block content %} @@ -21,7 +21,7 @@
{% include 'partials/toolbar_search.html' %}
- +
- + {% endfor %} -
-
@@ -76,21 +76,21 @@ - - + + {% trans 'Edit' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% get_links stage as links %} {% for name, href in links.items %} - {% trans name %} + {% trans name %} {% endfor %} @@ -119,7 +119,7 @@ {% trans 'Currently no stages exist. Click the button below to create one.' %} {% endif %}
- +
- + {% endfor %} -
+ {% endif %} diff --git a/passbook/admin/templates/administration/stage_binding/list.html b/authentik/admin/templates/administration/stage_binding/list.html similarity index 79% rename from passbook/admin/templates/administration/stage_binding/list.html rename to authentik/admin/templates/administration/stage_binding/list.html index 6fce1b5060..c4a772a621 100644 --- a/passbook/admin/templates/administration/stage_binding/list.html +++ b/authentik/admin/templates/administration/stage_binding/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -19,13 +19,13 @@
- - + + {% trans 'Create' %} - +
-
-
@@ -80,18 +80,18 @@
- - + + {% trans 'Update' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -111,12 +111,12 @@
{% trans 'Currently no flow-stage bindings exist. Click the button below to create one.' %}
- - + + {% trans 'Create' %} - +
-
+
{% endif %} diff --git a/passbook/admin/templates/administration/stage_invitation/list.html b/authentik/admin/templates/administration/stage_invitation/list.html similarity index 80% rename from passbook/admin/templates/administration/stage_invitation/list.html rename to authentik/admin/templates/administration/stage_invitation/list.html index e1052d7892..109c755d4c 100644 --- a/passbook/admin/templates/administration/stage_invitation/list.html +++ b/authentik/admin/templates/administration/stage_invitation/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -21,13 +21,13 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
-
@@ -56,12 +56,12 @@ - - + + {% trans 'Delete' %} - +
-
+ {% endfor %} @@ -89,12 +89,12 @@ {% trans 'Currently no invitations exist. Click the button below to create one.' %} {% endif %}
- - + + {% trans 'Create' %} - +
-
+ {% endif %} diff --git a/passbook/admin/templates/administration/stage_prompt/list.html b/authentik/admin/templates/administration/stage_prompt/list.html similarity index 80% rename from passbook/admin/templates/administration/stage_prompt/list.html rename to authentik/admin/templates/administration/stage_prompt/list.html index 13b8a45585..45ca2e5bcd 100644 --- a/passbook/admin/templates/administration/stage_prompt/list.html +++ b/authentik/admin/templates/administration/stage_prompt/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% load admin_reflection %} {% block content %} @@ -21,13 +21,13 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
-
@@ -78,21 +78,21 @@ - - + + {% trans 'Update' %} - +
-
- - + + + {% trans 'Delete' %} - +
-
+ {% get_links prompt as links %} {% for name, href in links.items %} - {% trans name %} + {% trans name %} {% endfor %} @@ -121,7 +121,7 @@ {% trans 'Currently no stage prompts exist. Click the button below to create one.' %} {% endif %}
- {% trans 'Create' %} + {% trans 'Create' %} {% endif %} diff --git a/passbook/admin/templates/administration/task/list.html b/authentik/admin/templates/administration/task/list.html similarity index 90% rename from passbook/admin/templates/administration/task/list.html rename to authentik/admin/templates/administration/task/list.html index 9f897afb95..7f0ef9ea51 100644 --- a/passbook/admin/templates/administration/task/list.html +++ b/authentik/admin/templates/administration/task/list.html @@ -2,7 +2,7 @@ {% load i18n %} {% load humanize %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -11,14 +11,14 @@ {% trans 'System Tasks' %} -

{% trans "Long-running operations which passbook executes in the background." %}

+

{% trans "Long-running operations which authentik executes in the background." %}

-
@@ -71,9 +71,9 @@ {% endfor %} - + {% trans 'Retry Task' %} - + {% endfor %} diff --git a/passbook/admin/templates/administration/token/list.html b/authentik/admin/templates/administration/token/list.html similarity index 87% rename from passbook/admin/templates/administration/token/list.html rename to authentik/admin/templates/administration/token/list.html index cca46124e4..9eb7667a4c 100644 --- a/passbook/admin/templates/administration/token/list.html +++ b/authentik/admin/templates/administration/token/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -10,7 +10,7 @@ {% trans 'Tokens' %} -

{% trans "Tokens are used throughout passbook for Email validation stages, Recovery keys and API access." %}

+

{% trans "Tokens are used throughout authentik for Email validation stages, Recovery keys and API access." %}

@@ -58,15 +58,15 @@ - - + + {% trans 'Delete' %} - +
-
- + + {% trans 'Copy token' %} - + {% endfor %} diff --git a/passbook/admin/templates/administration/user/disable.html b/authentik/admin/templates/administration/user/disable.html similarity index 98% rename from passbook/admin/templates/administration/user/disable.html rename to authentik/admin/templates/administration/user/disable.html index 0a3113330a..3069d88091 100644 --- a/passbook/admin/templates/administration/user/disable.html +++ b/authentik/admin/templates/administration/user/disable.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/user/list.html b/authentik/admin/templates/administration/user/list.html similarity index 69% rename from passbook/admin/templates/administration/user/list.html rename to authentik/admin/templates/administration/user/list.html index b3b2710910..fe291cb513 100644 --- a/passbook/admin/templates/administration/user/list.html +++ b/authentik/admin/templates/administration/user/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
@@ -19,13 +19,13 @@
{% include 'partials/toolbar_search.html' %}
- - + + {% trans 'Create' %} - +
-
-
@@ -61,29 +61,29 @@ - - + + {% trans 'Edit' %} - +
-
+ {% if user.is_active %} - - + + {% trans 'Disable' %} - +
-
+ {% else %} - - + + {% trans 'Enable' %} - +
-
+ {% endif %} - {% trans 'Reset Password' %} - {% trans 'Impersonate' %} + {% trans 'Reset Password' %} + {% trans 'Impersonate' %} {% endfor %} @@ -111,12 +111,12 @@ {% trans 'Currently no users exist. How did you even get here.' %} {% endif %}
- - + + {% trans 'Create' %} - +
-
+ {% endif %} diff --git a/authentik/admin/templates/fields/codemirror.html b/authentik/admin/templates/fields/codemirror.html new file mode 100644 index 0000000000..19040059d9 --- /dev/null +++ b/authentik/admin/templates/fields/codemirror.html @@ -0,0 +1 @@ + diff --git a/passbook/admin/templates/generic/create.html b/authentik/admin/templates/generic/create.html similarity index 92% rename from passbook/admin/templates/generic/create.html rename to authentik/admin/templates/generic/create.html index 640ab39165..c1cbe91f16 100644 --- a/passbook/admin/templates/generic/create.html +++ b/authentik/admin/templates/generic/create.html @@ -1,6 +1,6 @@ {% extends base_template|default:"generic/form.html" %} -{% load passbook_utils %} +{% load authentik_utils %} {% load i18n %} {% block above_form %} diff --git a/passbook/admin/templates/generic/form.html b/authentik/admin/templates/generic/form.html similarity index 97% rename from passbook/admin/templates/generic/form.html rename to authentik/admin/templates/generic/form.html index 73c28442ca..d7208c69f7 100644 --- a/passbook/admin/templates/generic/form.html +++ b/authentik/admin/templates/generic/form.html @@ -1,7 +1,7 @@ {% extends container_template|default:"administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% load static %} {% block content %} diff --git a/passbook/admin/templates/generic/form_non_model.html b/authentik/admin/templates/generic/form_non_model.html similarity index 91% rename from passbook/admin/templates/generic/form_non_model.html rename to authentik/admin/templates/generic/form_non_model.html index 032e5abd47..6223e33c76 100644 --- a/passbook/admin/templates/generic/form_non_model.html +++ b/authentik/admin/templates/generic/form_non_model.html @@ -1,6 +1,6 @@ {% extends base_template|default:"generic/form.html" %} -{% load passbook_utils %} +{% load authentik_utils %} {% load i18n %} {% block above_form %} diff --git a/passbook/admin/templates/generic/update.html b/authentik/admin/templates/generic/update.html similarity index 93% rename from passbook/admin/templates/generic/update.html rename to authentik/admin/templates/generic/update.html index 30d929ff70..7b46d40f99 100644 --- a/passbook/admin/templates/generic/update.html +++ b/authentik/admin/templates/generic/update.html @@ -1,6 +1,6 @@ {% extends base_template|default:"generic/form.html" %} -{% load passbook_utils %} +{% load authentik_utils %} {% load i18n %} {% block above_form %} diff --git a/passbook/admin/templatetags/__init__.py b/authentik/admin/templatetags/__init__.py similarity index 100% rename from passbook/admin/templatetags/__init__.py rename to authentik/admin/templatetags/__init__.py diff --git a/passbook/admin/templatetags/admin_reflection.py b/authentik/admin/templatetags/admin_reflection.py similarity index 98% rename from passbook/admin/templatetags/admin_reflection.py rename to authentik/admin/templatetags/admin_reflection.py index 9faeaa3935..33c334dc9e 100644 --- a/passbook/admin/templatetags/admin_reflection.py +++ b/authentik/admin/templatetags/admin_reflection.py @@ -1,4 +1,4 @@ -"""passbook admin templatetags""" +"""authentik admin templatetags""" from django import template from django.db.models import Model from django.utils.html import mark_safe diff --git a/passbook/admin/tests.py b/authentik/admin/tests.py similarity index 85% rename from passbook/admin/tests.py rename to authentik/admin/tests.py index 13ced0c9c5..5f9399a071 100644 --- a/passbook/admin/tests.py +++ b/authentik/admin/tests.py @@ -7,9 +7,9 @@ from django.shortcuts import reverse from django.test import Client, TestCase from django.urls.exceptions import NoReverseMatch -from passbook.admin.urls import urlpatterns -from passbook.core.models import Group, User -from passbook.lib.utils.reflection import get_apps +from authentik.admin.urls import urlpatterns +from authentik.core.models import Group, User +from authentik.lib.utils.reflection import get_apps class TestAdmin(TestCase): @@ -17,7 +17,7 @@ class TestAdmin(TestCase): def setUp(self): self.user = User.objects.create_user(username="test") - self.user.pb_groups.add(Group.objects.filter(is_superuser=True).first()) + self.user.ak_groups.add(Group.objects.filter(is_superuser=True).first()) self.user.save() self.client = Client() self.client.force_login(self.user) @@ -28,7 +28,7 @@ def generic_view_tester(view_name: str) -> Callable: def tester(self: TestAdmin): try: - full_url = reverse(f"passbook_admin:{view_name}") + full_url = reverse(f"authentik_admin:{view_name}") response = self.client.get(full_url) self.assertTrue(response.status_code < 500) except NoReverseMatch: diff --git a/passbook/admin/urls.py b/authentik/admin/urls.py similarity index 99% rename from passbook/admin/urls.py rename to authentik/admin/urls.py index 5c556d3047..ecd81d8d64 100644 --- a/passbook/admin/urls.py +++ b/authentik/admin/urls.py @@ -1,7 +1,7 @@ -"""passbook URL Configuration""" +"""authentik URL Configuration""" from django.urls import path -from passbook.admin.views import ( +from authentik.admin.views import ( applications, certificate_key_pair, flows, diff --git a/passbook/admin/views/__init__.py b/authentik/admin/views/__init__.py similarity index 100% rename from passbook/admin/views/__init__.py rename to authentik/admin/views/__init__.py diff --git a/passbook/admin/views/applications.py b/authentik/admin/views/applications.py similarity index 74% rename from passbook/admin/views/applications.py rename to authentik/admin/views/applications.py index 2b53b2159b..4d440227bb 100644 --- a/passbook/admin/views/applications.py +++ b/authentik/admin/views/applications.py @@ -1,4 +1,4 @@ -"""passbook Application administration""" +"""authentik Application administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -9,15 +9,15 @@ from django.utils.translation import gettext as _ from django.views.generic import ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.core.forms.applications import ApplicationForm -from passbook.core.models import Application -from passbook.lib.views import CreateAssignPermView +from authentik.core.forms.applications import ApplicationForm +from authentik.core.models import Application +from authentik.lib.views import CreateAssignPermView class ApplicationListView( @@ -30,7 +30,7 @@ class ApplicationListView( """Show list of all applications""" model = Application - permission_required = "passbook_core.view_application" + permission_required = "authentik_core.view_application" ordering = "name" template_name = "administration/application/list.html" @@ -55,10 +55,10 @@ class ApplicationCreateView( model = Application form_class = ApplicationForm - permission_required = "passbook_core.add_application" + permission_required = "authentik_core.add_application" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:applications") + success_url = reverse_lazy("authentik_admin:applications") success_message = _("Successfully created Application") @@ -73,10 +73,10 @@ class ApplicationUpdateView( model = Application form_class = ApplicationForm - permission_required = "passbook_core.change_application" + permission_required = "authentik_core.change_application" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:applications") + success_url = reverse_lazy("authentik_admin:applications") success_message = _("Successfully updated Application") @@ -86,8 +86,8 @@ class ApplicationDeleteView( """Delete application""" model = Application - permission_required = "passbook_core.delete_application" + permission_required = "authentik_core.delete_application" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:applications") + success_url = reverse_lazy("authentik_admin:applications") success_message = _("Successfully deleted Application") diff --git a/passbook/admin/views/certificate_key_pair.py b/authentik/admin/views/certificate_key_pair.py similarity index 72% rename from passbook/admin/views/certificate_key_pair.py rename to authentik/admin/views/certificate_key_pair.py index a221cd8ebe..09e154cf42 100644 --- a/passbook/admin/views/certificate_key_pair.py +++ b/authentik/admin/views/certificate_key_pair.py @@ -1,4 +1,4 @@ -"""passbook CertificateKeyPair administration""" +"""authentik CertificateKeyPair administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -9,15 +9,15 @@ from django.utils.translation import gettext as _ from django.views.generic import ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.crypto.forms import CertificateKeyPairForm -from passbook.crypto.models import CertificateKeyPair -from passbook.lib.views import CreateAssignPermView +from authentik.crypto.forms import CertificateKeyPairForm +from authentik.crypto.models import CertificateKeyPair +from authentik.lib.views import CreateAssignPermView class CertificateKeyPairListView( @@ -30,7 +30,7 @@ class CertificateKeyPairListView( """Show list of all keypairs""" model = CertificateKeyPair - permission_required = "passbook_crypto.view_certificatekeypair" + permission_required = "authentik_crypto.view_certificatekeypair" ordering = "name" template_name = "administration/certificatekeypair/list.html" @@ -48,10 +48,10 @@ class CertificateKeyPairCreateView( model = CertificateKeyPair form_class = CertificateKeyPairForm - permission_required = "passbook_crypto.add_certificatekeypair" + permission_required = "authentik_crypto.add_certificatekeypair" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:certificate_key_pair") + success_url = reverse_lazy("authentik_admin:certificate_key_pair") success_message = _("Successfully created CertificateKeyPair") @@ -66,10 +66,10 @@ class CertificateKeyPairUpdateView( model = CertificateKeyPair form_class = CertificateKeyPairForm - permission_required = "passbook_crypto.change_certificatekeypair" + permission_required = "authentik_crypto.change_certificatekeypair" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:certificate_key_pair") + success_url = reverse_lazy("authentik_admin:certificate_key_pair") success_message = _("Successfully updated Certificate-Key Pair") @@ -79,8 +79,8 @@ class CertificateKeyPairDeleteView( """Delete certificatekeypair""" model = CertificateKeyPair - permission_required = "passbook_crypto.delete_certificatekeypair" + permission_required = "authentik_crypto.delete_certificatekeypair" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:certificate_key_pair") + success_url = reverse_lazy("authentik_admin:certificate_key_pair") success_message = _("Successfully deleted Certificate-Key Pair") diff --git a/passbook/admin/views/flows.py b/authentik/admin/views/flows.py similarity index 76% rename from passbook/admin/views/flows.py rename to authentik/admin/views/flows.py index c45dbaf1be..1578615fba 100644 --- a/passbook/admin/views/flows.py +++ b/authentik/admin/views/flows.py @@ -1,4 +1,4 @@ -"""passbook Flow administration""" +"""authentik Flow administration""" from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( @@ -11,21 +11,21 @@ from django.utils.translation import gettext as _ from django.views.generic import DetailView, FormView, ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.flows.forms import FlowForm, FlowImportForm -from passbook.flows.models import Flow -from passbook.flows.planner import PLAN_CONTEXT_PENDING_USER -from passbook.flows.transfer.common import DataclassEncoder -from passbook.flows.transfer.exporter import FlowExporter -from passbook.flows.transfer.importer import FlowImporter -from passbook.flows.views import SESSION_KEY_PLAN, FlowPlanner -from passbook.lib.utils.urls import redirect_with_qs -from passbook.lib.views import CreateAssignPermView +from authentik.flows.forms import FlowForm, FlowImportForm +from authentik.flows.models import Flow +from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER +from authentik.flows.transfer.common import DataclassEncoder +from authentik.flows.transfer.exporter import FlowExporter +from authentik.flows.transfer.importer import FlowImporter +from authentik.flows.views import SESSION_KEY_PLAN, FlowPlanner +from authentik.lib.utils.urls import redirect_with_qs +from authentik.lib.views import CreateAssignPermView class FlowListView( @@ -38,7 +38,7 @@ class FlowListView( """Show list of all flows""" model = Flow - permission_required = "passbook_flows.view_flow" + permission_required = "authentik_flows.view_flow" ordering = "name" template_name = "administration/flow/list.html" search_fields = ["name", "slug", "designation", "title"] @@ -55,10 +55,10 @@ class FlowCreateView( model = Flow form_class = FlowForm - permission_required = "passbook_flows.add_flow" + permission_required = "authentik_flows.add_flow" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:flows") + success_url = reverse_lazy("authentik_admin:flows") success_message = _("Successfully created Flow") @@ -73,10 +73,10 @@ class FlowUpdateView( model = Flow form_class = FlowForm - permission_required = "passbook_flows.change_flow" + permission_required = "authentik_flows.change_flow" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:flows") + success_url = reverse_lazy("authentik_admin:flows") success_message = _("Successfully updated Flow") @@ -84,10 +84,10 @@ class FlowDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageV """Delete flow""" model = Flow - permission_required = "passbook_flows.delete_flow" + permission_required = "authentik_flows.delete_flow" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:flows") + success_url = reverse_lazy("authentik_admin:flows") success_message = _("Successfully deleted Flow") @@ -95,7 +95,7 @@ class FlowDebugExecuteView(LoginRequiredMixin, PermissionRequiredMixin, DetailVi """Debug exectue flow, setting the current user as pending user""" model = Flow - permission_required = "passbook_flows.view_flow" + permission_required = "authentik_flows.view_flow" # pylint: disable=unused-argument def get(self, request: HttpRequest, pk: str) -> HttpResponse: @@ -106,7 +106,7 @@ class FlowDebugExecuteView(LoginRequiredMixin, PermissionRequiredMixin, DetailVi plan = planner.plan(self.request, {PLAN_CONTEXT_PENDING_USER: request.user}) self.request.session[SESSION_KEY_PLAN] = plan return redirect_with_qs( - "passbook_flows:flow-executor-shell", + "authentik_flows:flow-executor-shell", self.request.GET, flow_slug=flow.slug, ) @@ -118,7 +118,7 @@ class FlowImportView(LoginRequiredMixin, FormView): form_class = FlowImportForm template_name = "administration/flow/import.html" - success_url = reverse_lazy("passbook_admin:flows") + success_url = reverse_lazy("authentik_admin:flows") def dispatch(self, request, *args, **kwargs): if not request.user.is_superuser: @@ -139,7 +139,7 @@ class FlowExportView(LoginRequiredMixin, PermissionRequiredMixin, DetailView): """Export Flow""" model = Flow - permission_required = "passbook_flows.export_flow" + permission_required = "authentik_flows.export_flow" # pylint: disable=unused-argument def get(self, request: HttpRequest, pk: str) -> HttpResponse: @@ -147,5 +147,5 @@ class FlowExportView(LoginRequiredMixin, PermissionRequiredMixin, DetailView): flow: Flow = self.get_object() exporter = FlowExporter(flow) response = JsonResponse(exporter.export(), encoder=DataclassEncoder, safe=False) - response["Content-Disposition"] = f'attachment; filename="{flow.slug}.pbflow"' + response["Content-Disposition"] = f'attachment; filename="{flow.slug}.akflow"' return response diff --git a/passbook/admin/views/groups.py b/authentik/admin/views/groups.py similarity index 73% rename from passbook/admin/views/groups.py rename to authentik/admin/views/groups.py index 64609d7e27..bebd3bdb19 100644 --- a/passbook/admin/views/groups.py +++ b/authentik/admin/views/groups.py @@ -1,4 +1,4 @@ -"""passbook Group administration""" +"""authentik Group administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -9,15 +9,15 @@ from django.utils.translation import gettext as _ from django.views.generic import ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.core.forms.groups import GroupForm -from passbook.core.models import Group -from passbook.lib.views import CreateAssignPermView +from authentik.core.forms.groups import GroupForm +from authentik.core.models import Group +from authentik.lib.views import CreateAssignPermView class GroupListView( @@ -30,7 +30,7 @@ class GroupListView( """Show list of all groups""" model = Group - permission_required = "passbook_core.view_group" + permission_required = "authentik_core.view_group" ordering = "name" template_name = "administration/group/list.html" search_fields = ["name", "attributes"] @@ -47,10 +47,10 @@ class GroupCreateView( model = Group form_class = GroupForm - permission_required = "passbook_core.add_group" + permission_required = "authentik_core.add_group" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:groups") + success_url = reverse_lazy("authentik_admin:groups") success_message = _("Successfully created Group") @@ -65,10 +65,10 @@ class GroupUpdateView( model = Group form_class = GroupForm - permission_required = "passbook_core.change_group" + permission_required = "authentik_core.change_group" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:groups") + success_url = reverse_lazy("authentik_admin:groups") success_message = _("Successfully updated Group") @@ -76,8 +76,8 @@ class GroupDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessage """Delete group""" model = Group - permission_required = "passbook_flows.delete_group" + permission_required = "authentik_flows.delete_group" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:groups") + success_url = reverse_lazy("authentik_admin:groups") success_message = _("Successfully deleted Group") diff --git a/passbook/admin/views/outposts.py b/authentik/admin/views/outposts.py similarity index 72% rename from passbook/admin/views/outposts.py rename to authentik/admin/views/outposts.py index 43a6b88c2a..1e54ca5e8e 100644 --- a/passbook/admin/views/outposts.py +++ b/authentik/admin/views/outposts.py @@ -1,4 +1,4 @@ -"""passbook Outpost administration""" +"""authentik Outpost administration""" from dataclasses import asdict from typing import Any, Dict @@ -12,15 +12,15 @@ from django.utils.translation import gettext as _ from django.views.generic import ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.lib.views import CreateAssignPermView -from passbook.outposts.forms import OutpostForm -from passbook.outposts.models import Outpost, OutpostConfig +from authentik.lib.views import CreateAssignPermView +from authentik.outposts.forms import OutpostForm +from authentik.outposts.models import Outpost, OutpostConfig class OutpostListView( @@ -33,7 +33,7 @@ class OutpostListView( """Show list of all outposts""" model = Outpost - permission_required = "passbook_outposts.view_outpost" + permission_required = "authentik_outposts.view_outpost" ordering = "name" template_name = "administration/outpost/list.html" search_fields = ["name", "_config"] @@ -50,16 +50,16 @@ class OutpostCreateView( model = Outpost form_class = OutpostForm - permission_required = "passbook_outposts.add_outpost" + permission_required = "authentik_outposts.add_outpost" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:outposts") + success_url = reverse_lazy("authentik_admin:outposts") success_message = _("Successfully created Outpost") def get_initial(self) -> Dict[str, Any]: return { "_config": asdict( - OutpostConfig(passbook_host=self.request.build_absolute_uri("/")) + OutpostConfig(authentik_host=self.request.build_absolute_uri("/")) ) } @@ -75,10 +75,10 @@ class OutpostUpdateView( model = Outpost form_class = OutpostForm - permission_required = "passbook_outposts.change_outpost" + permission_required = "authentik_outposts.change_outpost" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:outposts") + success_url = reverse_lazy("authentik_admin:outposts") success_message = _("Successfully updated Outpost") @@ -86,8 +86,8 @@ class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessa """Delete outpost""" model = Outpost - permission_required = "passbook_outposts.delete_outpost" + permission_required = "authentik_outposts.delete_outpost" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:outposts") + success_url = reverse_lazy("authentik_admin:outposts") success_message = _("Successfully deleted Outpost") diff --git a/passbook/admin/views/outposts_service_connections.py b/authentik/admin/views/outposts_service_connections.py similarity index 74% rename from passbook/admin/views/outposts_service_connections.py rename to authentik/admin/views/outposts_service_connections.py index 93fc6c5191..a1aded022a 100644 --- a/passbook/admin/views/outposts_service_connections.py +++ b/authentik/admin/views/outposts_service_connections.py @@ -1,4 +1,4 @@ -"""passbook OutpostServiceConnection administration""" +"""authentik OutpostServiceConnection administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -8,7 +8,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, InheritanceCreateView, @@ -17,7 +17,7 @@ from passbook.admin.views.utils import ( SearchListMixin, UserPaginateListMixin, ) -from passbook.outposts.models import OutpostServiceConnection +from authentik.outposts.models import OutpostServiceConnection class OutpostServiceConnectionListView( @@ -30,7 +30,7 @@ class OutpostServiceConnectionListView( """Show list of all outpost-service-connections""" model = OutpostServiceConnection - permission_required = "passbook_outposts.add_outpostserviceconnection" + permission_required = "authentik_outposts.add_outpostserviceconnection" template_name = "administration/outpost_service_connection/list.html" ordering = "pk" search_fields = ["pk", "name"] @@ -46,10 +46,10 @@ class OutpostServiceConnectionCreateView( """Create new OutpostServiceConnection""" model = OutpostServiceConnection - permission_required = "passbook_outposts.add_outpostserviceconnection" + permission_required = "authentik_outposts.add_outpostserviceconnection" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:outpost-service-connections") + success_url = reverse_lazy("authentik_admin:outpost-service-connections") success_message = _("Successfully created OutpostServiceConnection") @@ -63,10 +63,10 @@ class OutpostServiceConnectionUpdateView( """Update outpostserviceconnection""" model = OutpostServiceConnection - permission_required = "passbook_outposts.change_outpostserviceconnection" + permission_required = "authentik_outposts.change_outpostserviceconnection" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:outpost-service-connections") + success_url = reverse_lazy("authentik_admin:outpost-service-connections") success_message = _("Successfully updated OutpostServiceConnection") @@ -76,8 +76,8 @@ class OutpostServiceConnectionDeleteView( """Delete outpostserviceconnection""" model = OutpostServiceConnection - permission_required = "passbook_outposts.delete_outpostserviceconnection" + permission_required = "authentik_outposts.delete_outpostserviceconnection" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:outpost-service-connections") + success_url = reverse_lazy("authentik_admin:outpost-service-connections") success_message = _("Successfully deleted OutpostServiceConnection") diff --git a/passbook/admin/views/overview.py b/authentik/admin/views/overview.py similarity index 85% rename from passbook/admin/views/overview.py rename to authentik/admin/views/overview.py index c8874b3b28..bded396d8b 100644 --- a/passbook/admin/views/overview.py +++ b/authentik/admin/views/overview.py @@ -1,4 +1,4 @@ -"""passbook administration overview""" +"""authentik administration overview""" from typing import Union from django.conf import settings @@ -12,12 +12,12 @@ from django.views.generic import FormView, TemplateView from packaging.version import LegacyVersion, Version, parse from structlog import get_logger -from passbook import __version__ -from passbook.admin.forms.overview import FlowCacheClearForm, PolicyCacheClearForm -from passbook.admin.mixins import AdminRequiredMixin -from passbook.admin.tasks import VERSION_CACHE_KEY, update_latest_version -from passbook.core.models import Provider, User -from passbook.policies.models import Policy +from authentik import __version__ +from authentik.admin.forms.overview import FlowCacheClearForm, PolicyCacheClearForm +from authentik.admin.mixins import AdminRequiredMixin +from authentik.admin.tasks import VERSION_CACHE_KEY, update_latest_version +from authentik.core.models import Provider, User +from authentik.policies.models import Policy LOGGER = get_logger() @@ -59,7 +59,7 @@ class PolicyCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView): form_class = PolicyCacheClearForm template_name = "generic/form_non_model.html" - success_url = reverse_lazy("passbook_admin:overview") + success_url = reverse_lazy("authentik_admin:overview") success_message = _("Successfully cleared Policy cache") def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: @@ -75,7 +75,7 @@ class FlowCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView): form_class = FlowCacheClearForm template_name = "generic/form_non_model.html" - success_url = reverse_lazy("passbook_admin:overview") + success_url = reverse_lazy("authentik_admin:overview") success_message = _("Successfully cleared Flow cache") def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: diff --git a/passbook/admin/views/policies.py b/authentik/admin/views/policies.py similarity index 81% rename from passbook/admin/views/policies.py rename to authentik/admin/views/policies.py index 1de8f1bc94..43499991d4 100644 --- a/passbook/admin/views/policies.py +++ b/authentik/admin/views/policies.py @@ -1,4 +1,4 @@ -"""passbook Policy administration""" +"""authentik Policy administration""" from typing import Any, Dict from django.contrib import messages @@ -15,8 +15,8 @@ from django.views.generic import FormView from django.views.generic.detail import DetailView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.forms.policies import PolicyTestForm -from passbook.admin.views.utils import ( +from authentik.admin.forms.policies import PolicyTestForm +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, InheritanceCreateView, @@ -25,8 +25,8 @@ from passbook.admin.views.utils import ( SearchListMixin, UserPaginateListMixin, ) -from passbook.policies.models import Policy, PolicyBinding -from passbook.policies.process import PolicyProcess, PolicyRequest +from authentik.policies.models import Policy, PolicyBinding +from authentik.policies.process import PolicyProcess, PolicyRequest class PolicyListView( @@ -39,7 +39,7 @@ class PolicyListView( """Show list of all policies""" model = Policy - permission_required = "passbook_policies.view_policy" + permission_required = "authentik_policies.view_policy" ordering = "name" template_name = "administration/policy/list.html" search_fields = ["name"] @@ -55,10 +55,10 @@ class PolicyCreateView( """Create new Policy""" model = Policy - permission_required = "passbook_policies.add_policy" + permission_required = "authentik_policies.add_policy" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:policies") + success_url = reverse_lazy("authentik_admin:policies") success_message = _("Successfully created Policy") @@ -72,10 +72,10 @@ class PolicyUpdateView( """Update policy""" model = Policy - permission_required = "passbook_policies.change_policy" + permission_required = "authentik_policies.change_policy" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:policies") + success_url = reverse_lazy("authentik_admin:policies") success_message = _("Successfully updated Policy") @@ -83,10 +83,10 @@ class PolicyDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag """Delete policy""" model = Policy - permission_required = "passbook_policies.delete_policy" + permission_required = "authentik_policies.delete_policy" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:policies") + success_url = reverse_lazy("authentik_admin:policies") success_message = _("Successfully deleted Policy") @@ -95,7 +95,7 @@ class PolicyTestView(LoginRequiredMixin, DetailView, PermissionRequiredMixin, Fo model = Policy form_class = PolicyTestForm - permission_required = "passbook_policies.view_policy" + permission_required = "authentik_policies.view_policy" template_name = "administration/policy/test.html" object = None diff --git a/passbook/admin/views/policies_bindings.py b/authentik/admin/views/policies_bindings.py similarity index 75% rename from passbook/admin/views/policies_bindings.py rename to authentik/admin/views/policies_bindings.py index c082d0d05b..9f7a8f97ab 100644 --- a/passbook/admin/views/policies_bindings.py +++ b/authentik/admin/views/policies_bindings.py @@ -1,4 +1,4 @@ -"""passbook PolicyBinding administration""" +"""authentik PolicyBinding administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -11,14 +11,14 @@ from django.views.generic import ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin from guardian.shortcuts import get_objects_for_user -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, UserPaginateListMixin, ) -from passbook.lib.views import CreateAssignPermView -from passbook.policies.forms import PolicyBindingForm -from passbook.policies.models import PolicyBinding +from authentik.lib.views import CreateAssignPermView +from authentik.policies.forms import PolicyBindingForm +from authentik.policies.models import PolicyBinding class PolicyBindingListView( @@ -27,7 +27,7 @@ class PolicyBindingListView( """Show list of all policies""" model = PolicyBinding - permission_required = "passbook_policies.view_policybinding" + permission_required = "authentik_policies.view_policybinding" ordering = ["order", "target"] template_name = "administration/policy_binding/list.html" @@ -36,7 +36,7 @@ class PolicyBindingListView( # First, get all pbm objects that have bindings attached objects = ( get_objects_for_user( - self.request.user, "passbook_policies.view_policybindingmodel" + self.request.user, "authentik_policies.view_policybindingmodel" ) .filter(policies__isnull=False) .select_subclasses() @@ -60,11 +60,11 @@ class PolicyBindingCreateView( """Create new PolicyBinding""" model = PolicyBinding - permission_required = "passbook_policies.add_policybinding" + permission_required = "authentik_policies.add_policybinding" form_class = PolicyBindingForm template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:policies-bindings") + success_url = reverse_lazy("authentik_admin:policies-bindings") success_message = _("Successfully created PolicyBinding") @@ -78,11 +78,11 @@ class PolicyBindingUpdateView( """Update policybinding""" model = PolicyBinding - permission_required = "passbook_policies.change_policybinding" + permission_required = "authentik_policies.change_policybinding" form_class = PolicyBindingForm template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:policies-bindings") + success_url = reverse_lazy("authentik_admin:policies-bindings") success_message = _("Successfully updated PolicyBinding") @@ -92,8 +92,8 @@ class PolicyBindingDeleteView( """Delete policybinding""" model = PolicyBinding - permission_required = "passbook_policies.delete_policybinding" + permission_required = "authentik_policies.delete_policybinding" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:policies-bindings") + success_url = reverse_lazy("authentik_admin:policies-bindings") success_message = _("Successfully deleted PolicyBinding") diff --git a/passbook/admin/views/property_mappings.py b/authentik/admin/views/property_mappings.py similarity index 75% rename from passbook/admin/views/property_mappings.py rename to authentik/admin/views/property_mappings.py index 9324badfb7..522b26622c 100644 --- a/passbook/admin/views/property_mappings.py +++ b/authentik/admin/views/property_mappings.py @@ -1,4 +1,4 @@ -"""passbook PropertyMapping administration""" +"""authentik PropertyMapping administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -8,7 +8,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, InheritanceCreateView, @@ -17,7 +17,7 @@ from passbook.admin.views.utils import ( SearchListMixin, UserPaginateListMixin, ) -from passbook.core.models import PropertyMapping +from authentik.core.models import PropertyMapping class PropertyMappingListView( @@ -30,7 +30,7 @@ class PropertyMappingListView( """Show list of all property_mappings""" model = PropertyMapping - permission_required = "passbook_core.view_propertymapping" + permission_required = "authentik_core.view_propertymapping" template_name = "administration/property_mapping/list.html" ordering = "name" search_fields = ["name", "expression"] @@ -46,10 +46,10 @@ class PropertyMappingCreateView( """Create new PropertyMapping""" model = PropertyMapping - permission_required = "passbook_core.add_propertymapping" + permission_required = "authentik_core.add_propertymapping" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:property-mappings") + success_url = reverse_lazy("authentik_admin:property-mappings") success_message = _("Successfully created Property Mapping") @@ -63,10 +63,10 @@ class PropertyMappingUpdateView( """Update property_mapping""" model = PropertyMapping - permission_required = "passbook_core.change_propertymapping" + permission_required = "authentik_core.change_propertymapping" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:property-mappings") + success_url = reverse_lazy("authentik_admin:property-mappings") success_message = _("Successfully updated Property Mapping") @@ -76,8 +76,8 @@ class PropertyMappingDeleteView( """Delete property_mapping""" model = PropertyMapping - permission_required = "passbook_core.delete_propertymapping" + permission_required = "authentik_core.delete_propertymapping" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:property-mappings") + success_url = reverse_lazy("authentik_admin:property-mappings") success_message = _("Successfully deleted Property Mapping") diff --git a/passbook/admin/views/providers.py b/authentik/admin/views/providers.py similarity index 76% rename from passbook/admin/views/providers.py rename to authentik/admin/views/providers.py index 19584ad44e..ed4accf413 100644 --- a/passbook/admin/views/providers.py +++ b/authentik/admin/views/providers.py @@ -1,4 +1,4 @@ -"""passbook Provider administration""" +"""authentik Provider administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -8,7 +8,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, InheritanceCreateView, @@ -17,7 +17,7 @@ from passbook.admin.views.utils import ( SearchListMixin, UserPaginateListMixin, ) -from passbook.core.models import Provider +from authentik.core.models import Provider class ProviderListView( @@ -30,7 +30,7 @@ class ProviderListView( """Show list of all providers""" model = Provider - permission_required = "passbook_core.add_provider" + permission_required = "authentik_core.add_provider" template_name = "administration/provider/list.html" ordering = "pk" search_fields = ["pk", "name"] @@ -46,10 +46,10 @@ class ProviderCreateView( """Create new Provider""" model = Provider - permission_required = "passbook_core.add_provider" + permission_required = "authentik_core.add_provider" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:providers") + success_url = reverse_lazy("authentik_admin:providers") success_message = _("Successfully created Provider") @@ -63,10 +63,10 @@ class ProviderUpdateView( """Update provider""" model = Provider - permission_required = "passbook_core.change_provider" + permission_required = "authentik_core.change_provider" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:providers") + success_url = reverse_lazy("authentik_admin:providers") success_message = _("Successfully updated Provider") @@ -76,8 +76,8 @@ class ProviderDeleteView( """Delete provider""" model = Provider - permission_required = "passbook_core.delete_provider" + permission_required = "authentik_core.delete_provider" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:providers") + success_url = reverse_lazy("authentik_admin:providers") success_message = _("Successfully deleted Provider") diff --git a/passbook/admin/views/sources.py b/authentik/admin/views/sources.py similarity index 76% rename from passbook/admin/views/sources.py rename to authentik/admin/views/sources.py index 8d84fd9f8b..23fc5d0b95 100644 --- a/passbook/admin/views/sources.py +++ b/authentik/admin/views/sources.py @@ -1,4 +1,4 @@ -"""passbook Source administration""" +"""authentik Source administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -8,7 +8,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, InheritanceCreateView, @@ -17,7 +17,7 @@ from passbook.admin.views.utils import ( SearchListMixin, UserPaginateListMixin, ) -from passbook.core.models import Source +from authentik.core.models import Source class SourceListView( @@ -30,7 +30,7 @@ class SourceListView( """Show list of all sources""" model = Source - permission_required = "passbook_core.view_source" + permission_required = "authentik_core.view_source" ordering = "name" template_name = "administration/source/list.html" search_fields = ["name", "slug"] @@ -46,10 +46,10 @@ class SourceCreateView( """Create new Source""" model = Source - permission_required = "passbook_core.add_source" + permission_required = "authentik_core.add_source" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:sources") + success_url = reverse_lazy("authentik_admin:sources") success_message = _("Successfully created Source") @@ -63,10 +63,10 @@ class SourceUpdateView( """Update source""" model = Source - permission_required = "passbook_core.change_source" + permission_required = "authentik_core.change_source" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:sources") + success_url = reverse_lazy("authentik_admin:sources") success_message = _("Successfully updated Source") @@ -74,8 +74,8 @@ class SourceDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag """Delete source""" model = Source - permission_required = "passbook_core.delete_source" + permission_required = "authentik_core.delete_source" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:sources") + success_url = reverse_lazy("authentik_admin:sources") success_message = _("Successfully deleted Source") diff --git a/passbook/admin/views/stages.py b/authentik/admin/views/stages.py similarity index 76% rename from passbook/admin/views/stages.py rename to authentik/admin/views/stages.py index 72619b39ad..55e7623dd0 100644 --- a/passbook/admin/views/stages.py +++ b/authentik/admin/views/stages.py @@ -1,4 +1,4 @@ -"""passbook Stage administration""" +"""authentik Stage administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -8,7 +8,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, InheritanceCreateView, @@ -17,7 +17,7 @@ from passbook.admin.views.utils import ( SearchListMixin, UserPaginateListMixin, ) -from passbook.flows.models import Stage +from authentik.flows.models import Stage class StageListView( @@ -31,7 +31,7 @@ class StageListView( model = Stage template_name = "administration/stage/list.html" - permission_required = "passbook_flows.view_stage" + permission_required = "authentik_flows.view_stage" ordering = "name" search_fields = ["name"] @@ -47,9 +47,9 @@ class StageCreateView( model = Stage template_name = "generic/create.html" - permission_required = "passbook_flows.add_stage" + permission_required = "authentik_flows.add_stage" - success_url = reverse_lazy("passbook_admin:stages") + success_url = reverse_lazy("authentik_admin:stages") success_message = _("Successfully created Stage") @@ -63,9 +63,9 @@ class StageUpdateView( """Update stage""" model = Stage - permission_required = "passbook_flows.update_application" + permission_required = "authentik_flows.update_application" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:stages") + success_url = reverse_lazy("authentik_admin:stages") success_message = _("Successfully updated Stage") @@ -74,6 +74,6 @@ class StageDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessage model = Stage template_name = "generic/delete.html" - permission_required = "passbook_flows.delete_stage" - success_url = reverse_lazy("passbook_admin:stages") + permission_required = "authentik_flows.delete_stage" + success_url = reverse_lazy("authentik_admin:stages") success_message = _("Successfully deleted Stage") diff --git a/passbook/admin/views/stages_bindings.py b/authentik/admin/views/stages_bindings.py similarity index 71% rename from passbook/admin/views/stages_bindings.py rename to authentik/admin/views/stages_bindings.py index dfac12cc8d..d048764e87 100644 --- a/passbook/admin/views/stages_bindings.py +++ b/authentik/admin/views/stages_bindings.py @@ -1,4 +1,4 @@ -"""passbook StageBinding administration""" +"""authentik StageBinding administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -9,14 +9,14 @@ from django.utils.translation import gettext as _ from django.views.generic import ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, UserPaginateListMixin, ) -from passbook.flows.forms import FlowStageBindingForm -from passbook.flows.models import FlowStageBinding -from passbook.lib.views import CreateAssignPermView +from authentik.flows.forms import FlowStageBindingForm +from authentik.flows.models import FlowStageBinding +from authentik.lib.views import CreateAssignPermView class StageBindingListView( @@ -25,7 +25,7 @@ class StageBindingListView( """Show list of all flows""" model = FlowStageBinding - permission_required = "passbook_flows.view_flowstagebinding" + permission_required = "authentik_flows.view_flowstagebinding" ordering = ["target", "order"] template_name = "administration/stage_binding/list.html" @@ -40,11 +40,11 @@ class StageBindingCreateView( """Create new StageBinding""" model = FlowStageBinding - permission_required = "passbook_flows.add_flowstagebinding" + permission_required = "authentik_flows.add_flowstagebinding" form_class = FlowStageBindingForm template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:stage-bindings") + success_url = reverse_lazy("authentik_admin:stage-bindings") success_message = _("Successfully created StageBinding") @@ -58,11 +58,11 @@ class StageBindingUpdateView( """Update FlowStageBinding""" model = FlowStageBinding - permission_required = "passbook_flows.change_flowstagebinding" + permission_required = "authentik_flows.change_flowstagebinding" form_class = FlowStageBindingForm template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:stage-bindings") + success_url = reverse_lazy("authentik_admin:stage-bindings") success_message = _("Successfully updated StageBinding") @@ -72,8 +72,8 @@ class StageBindingDeleteView( """Delete FlowStageBinding""" model = FlowStageBinding - permission_required = "passbook_flows.delete_flowstagebinding" + permission_required = "authentik_flows.delete_flowstagebinding" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:stage-bindings") + success_url = reverse_lazy("authentik_admin:stage-bindings") success_message = _("Successfully deleted FlowStageBinding") diff --git a/passbook/admin/views/stages_invitations.py b/authentik/admin/views/stages_invitations.py similarity index 73% rename from passbook/admin/views/stages_invitations.py rename to authentik/admin/views/stages_invitations.py index 9765cf5c9a..b914c16d70 100644 --- a/passbook/admin/views/stages_invitations.py +++ b/authentik/admin/views/stages_invitations.py @@ -1,4 +1,4 @@ -"""passbook Invitation administration""" +"""authentik Invitation administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -10,16 +10,16 @@ from django.utils.translation import gettext as _ from django.views.generic import ListView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.lib.views import CreateAssignPermView -from passbook.stages.invitation.forms import InvitationForm -from passbook.stages.invitation.models import Invitation -from passbook.stages.invitation.signals import invitation_created +from authentik.lib.views import CreateAssignPermView +from authentik.stages.invitation.forms import InvitationForm +from authentik.stages.invitation.models import Invitation +from authentik.stages.invitation.signals import invitation_created class InvitationListView( @@ -32,7 +32,7 @@ class InvitationListView( """Show list of all invitations""" model = Invitation - permission_required = "passbook_stages_invitation.view_invitation" + permission_required = "authentik_stages_invitation.view_invitation" template_name = "administration/stage_invitation/list.html" ordering = "-expires" search_fields = ["created_by__username", "expires", "fixed_data"] @@ -49,10 +49,10 @@ class InvitationCreateView( model = Invitation form_class = InvitationForm - permission_required = "passbook_stages_invitation.add_invitation" + permission_required = "authentik_stages_invitation.add_invitation" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:stage-invitations") + success_url = reverse_lazy("authentik_admin:stage-invitations") success_message = _("Successfully created Invitation") def form_valid(self, form): @@ -69,8 +69,8 @@ class InvitationDeleteView( """Delete invitation""" model = Invitation - permission_required = "passbook_stages_invitation.delete_invitation" + permission_required = "authentik_stages_invitation.delete_invitation" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:stage-invitations") + success_url = reverse_lazy("authentik_admin:stage-invitations") success_message = _("Successfully deleted Invitation") diff --git a/passbook/admin/views/stages_prompts.py b/authentik/admin/views/stages_prompts.py similarity index 72% rename from passbook/admin/views/stages_prompts.py rename to authentik/admin/views/stages_prompts.py index fb72e147d0..cc59a2ba50 100644 --- a/passbook/admin/views/stages_prompts.py +++ b/authentik/admin/views/stages_prompts.py @@ -1,4 +1,4 @@ -"""passbook Prompt administration""" +"""authentik Prompt administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, @@ -9,15 +9,15 @@ from django.utils.translation import gettext as _ from django.views.generic import ListView, UpdateView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.lib.views import CreateAssignPermView -from passbook.stages.prompt.forms import PromptAdminForm -from passbook.stages.prompt.models import Prompt +from authentik.lib.views import CreateAssignPermView +from authentik.stages.prompt.forms import PromptAdminForm +from authentik.stages.prompt.models import Prompt class PromptListView( @@ -30,7 +30,7 @@ class PromptListView( """Show list of all prompts""" model = Prompt - permission_required = "passbook_stages_prompt.view_prompt" + permission_required = "authentik_stages_prompt.view_prompt" ordering = "order" template_name = "administration/stage_prompt/list.html" search_fields = [ @@ -52,10 +52,10 @@ class PromptCreateView( model = Prompt form_class = PromptAdminForm - permission_required = "passbook_stages_prompt.add_prompt" + permission_required = "authentik_stages_prompt.add_prompt" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:stage-prompts") + success_url = reverse_lazy("authentik_admin:stage-prompts") success_message = _("Successfully created Prompt") @@ -70,10 +70,10 @@ class PromptUpdateView( model = Prompt form_class = PromptAdminForm - permission_required = "passbook_stages_prompt.change_prompt" + permission_required = "authentik_stages_prompt.change_prompt" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:stage-prompts") + success_url = reverse_lazy("authentik_admin:stage-prompts") success_message = _("Successfully updated Prompt") @@ -81,8 +81,8 @@ class PromptDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag """Delete prompt""" model = Prompt - permission_required = "passbook_stages_prompt.delete_prompt" + permission_required = "authentik_stages_prompt.delete_prompt" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:stage-prompts") + success_url = reverse_lazy("authentik_admin:stage-prompts") success_message = _("Successfully deleted Prompt") diff --git a/passbook/admin/views/tasks.py b/authentik/admin/views/tasks.py similarity index 82% rename from passbook/admin/views/tasks.py rename to authentik/admin/views/tasks.py index 7d0be779d7..44b96c8e90 100644 --- a/passbook/admin/views/tasks.py +++ b/authentik/admin/views/tasks.py @@ -1,10 +1,10 @@ -"""passbook Tasks List""" +"""authentik Tasks List""" from typing import Any, Dict from django.views.generic.base import TemplateView -from passbook.admin.mixins import AdminRequiredMixin -from passbook.lib.tasks import TaskInfo, TaskResultStatus +from authentik.admin.mixins import AdminRequiredMixin +from authentik.lib.tasks import TaskInfo, TaskResultStatus class TaskListView(AdminRequiredMixin, TemplateView): diff --git a/passbook/admin/views/tokens.py b/authentik/admin/views/tokens.py similarity index 76% rename from passbook/admin/views/tokens.py rename to authentik/admin/views/tokens.py index 86e26df3a7..126dac0644 100644 --- a/passbook/admin/views/tokens.py +++ b/authentik/admin/views/tokens.py @@ -1,16 +1,16 @@ -"""passbook Token administration""" +"""authentik Token administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import ListView from guardian.mixins import PermissionListMixin, PermissionRequiredMixin -from passbook.admin.views.utils import ( +from authentik.admin.views.utils import ( DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.core.models import Token +from authentik.core.models import Token class TokenListView( @@ -23,7 +23,7 @@ class TokenListView( """Show list of all tokens""" model = Token - permission_required = "passbook_core.view_token" + permission_required = "authentik_core.view_token" ordering = "expires" template_name = "administration/token/list.html" search_fields = [ @@ -38,8 +38,8 @@ class TokenDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessage """Delete token""" model = Token - permission_required = "passbook_core.delete_token" + permission_required = "authentik_core.delete_token" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:tokens") + success_url = reverse_lazy("authentik_admin:tokens") success_message = _("Successfully deleted Token") diff --git a/passbook/admin/views/users.py b/authentik/admin/views/users.py similarity index 80% rename from passbook/admin/views/users.py rename to authentik/admin/views/users.py index 215e13f366..434a8c0c25 100644 --- a/passbook/admin/views/users.py +++ b/authentik/admin/views/users.py @@ -1,4 +1,4 @@ -"""passbook User administration""" +"""authentik User administration""" from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import ( @@ -18,15 +18,15 @@ from guardian.mixins import ( get_anonymous_user, ) -from passbook.admin.forms.users import UserForm -from passbook.admin.views.utils import ( +from authentik.admin.forms.users import UserForm +from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, SearchListMixin, UserPaginateListMixin, ) -from passbook.core.models import Token, User -from passbook.lib.views import CreateAssignPermView +from authentik.core.models import Token, User +from authentik.lib.views import CreateAssignPermView class UserListView( @@ -39,7 +39,7 @@ class UserListView( """Show list of all users""" model = User - permission_required = "passbook_core.view_user" + permission_required = "authentik_core.view_user" ordering = "username" template_name = "administration/user/list.html" search_fields = ["username", "name", "attributes"] @@ -59,10 +59,10 @@ class UserCreateView( model = User form_class = UserForm - permission_required = "passbook_core.add_user" + permission_required = "authentik_core.add_user" template_name = "generic/create.html" - success_url = reverse_lazy("passbook_admin:users") + success_url = reverse_lazy("authentik_admin:users") success_message = _("Successfully created User") @@ -77,12 +77,12 @@ class UserUpdateView( model = User form_class = UserForm - permission_required = "passbook_core.change_user" + permission_required = "authentik_core.change_user" # By default the object's name is user which is used by other checks context_object_name = "object" template_name = "generic/update.html" - success_url = reverse_lazy("passbook_admin:users") + success_url = reverse_lazy("authentik_admin:users") success_message = _("Successfully updated User") @@ -90,12 +90,12 @@ class UserDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageV """Delete user""" model = User - permission_required = "passbook_core.delete_user" + permission_required = "authentik_core.delete_user" # By default the object's name is user which is used by other checks context_object_name = "object" template_name = "generic/delete.html" - success_url = reverse_lazy("passbook_admin:users") + success_url = reverse_lazy("authentik_admin:users") success_message = _("Successfully deleted User") @@ -107,12 +107,12 @@ class UserDisableView( object: User model = User - permission_required = "passbook_core.update_user" + permission_required = "authentik_core.update_user" # By default the object's name is user which is used by other checks context_object_name = "object" template_name = "administration/user/disable.html" - success_url = reverse_lazy("passbook_admin:users") + success_url = reverse_lazy("authentik_admin:users") success_message = _("Successfully disabled User") def delete(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: @@ -131,11 +131,11 @@ class UserEnableView( object: User model = User - permission_required = "passbook_core.update_user" + permission_required = "authentik_core.update_user" # By default the object's name is user which is used by other checks context_object_name = "object" - success_url = reverse_lazy("passbook_admin:users") + success_url = reverse_lazy("authentik_admin:users") success_message = _("Successfully enabled User") def get(self, request: HttpRequest, *args, **kwargs): @@ -150,7 +150,7 @@ class UserPasswordResetView(LoginRequiredMixin, PermissionRequiredMixin, DetailV """Get Password reset link for user""" model = User - permission_required = "passbook_core.reset_user_password" + permission_required = "authentik_core.reset_user_password" def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: """Create token for user and return link""" @@ -160,9 +160,9 @@ class UserPasswordResetView(LoginRequiredMixin, PermissionRequiredMixin, DetailV ) querystring = urlencode({"token": token.key}) link = request.build_absolute_uri( - reverse("passbook_flows:default-recovery") + f"?{querystring}" + reverse("authentik_flows:default-recovery") + f"?{querystring}" ) messages.success( request, _("Password reset link:
%(link)s
" % {"link": link}) ) - return redirect("passbook_admin:users") + return redirect("authentik_admin:users") diff --git a/passbook/admin/views/utils.py b/authentik/admin/views/utils.py similarity index 96% rename from passbook/admin/views/utils.py rename to authentik/admin/views/utils.py index f9be495551..bec33e4c31 100644 --- a/passbook/admin/views/utils.py +++ b/authentik/admin/views/utils.py @@ -1,4 +1,4 @@ -"""passbook admin util views""" +"""authentik admin util views""" from typing import Any, Dict, List, Optional from urllib.parse import urlparse @@ -11,8 +11,8 @@ from django.http.request import HttpRequest from django.views.generic import DeleteView, ListView, UpdateView from django.views.generic.list import MultipleObjectMixin -from passbook.lib.utils.reflection import all_subclasses -from passbook.lib.views import CreateAssignPermView +from authentik.lib.utils.reflection import all_subclasses +from authentik.lib.views import CreateAssignPermView class DeleteMessageView(SuccessMessageMixin, DeleteView): diff --git a/passbook/api/__init__.py b/authentik/api/__init__.py similarity index 100% rename from passbook/api/__init__.py rename to authentik/api/__init__.py diff --git a/authentik/api/apps.py b/authentik/api/apps.py new file mode 100644 index 0000000000..8ae859a54d --- /dev/null +++ b/authentik/api/apps.py @@ -0,0 +1,12 @@ +"""authentik API AppConfig""" + +from django.apps import AppConfig + + +class AuthentikAPIConfig(AppConfig): + """authentik API Config""" + + name = "authentik.api" + label = "authentik_api" + mountpoint = "api/" + verbose_name = "authentik API" diff --git a/passbook/api/auth.py b/authentik/api/auth.py similarity index 91% rename from passbook/api/auth.py rename to authentik/api/auth.py index e1e1007f9b..c3a6bb3ae5 100644 --- a/passbook/api/auth.py +++ b/authentik/api/auth.py @@ -6,7 +6,7 @@ from rest_framework.authentication import BaseAuthentication, get_authorization_ from rest_framework.request import Request from structlog import get_logger -from passbook.core.models import Token, TokenIntents, User +from authentik.core.models import Token, TokenIntents, User LOGGER = get_logger() @@ -40,7 +40,7 @@ def token_from_header(raw_header: bytes) -> Optional[Token]: return tokens.first() -class PassbookTokenAuthentication(BaseAuthentication): +class AuthentikTokenAuthentication(BaseAuthentication): """Token-based authentication using HTTP Basic authentication""" def authenticate(self, request: Request) -> Union[Tuple[User, Any], None]: @@ -54,4 +54,4 @@ class PassbookTokenAuthentication(BaseAuthentication): return (token.user, None) def authenticate_header(self, request: Request) -> str: - return 'Basic realm="passbook"' + return 'Basic realm="authentik"' diff --git a/passbook/api/pagination.py b/authentik/api/pagination.py similarity index 100% rename from passbook/api/pagination.py rename to authentik/api/pagination.py diff --git a/passbook/api/templates/rest_framework/api.html b/authentik/api/templates/rest_framework/api.html similarity index 89% rename from passbook/api/templates/rest_framework/api.html rename to authentik/api/templates/rest_framework/api.html index 604490afc1..aa3e2c319d 100644 --- a/passbook/api/templates/rest_framework/api.html +++ b/authentik/api/templates/rest_framework/api.html @@ -2,6 +2,6 @@ {% block branding %} - passbook + authentik {% endblock %} diff --git a/passbook/api/urls.py b/authentik/api/urls.py similarity index 54% rename from passbook/api/urls.py rename to authentik/api/urls.py index 615334c52e..b4c7791b96 100644 --- a/passbook/api/urls.py +++ b/authentik/api/urls.py @@ -1,7 +1,7 @@ -"""passbook api urls""" +"""authentik api urls""" from django.urls import include, path -from passbook.api.v2.urls import urlpatterns as v2_urls +from authentik.api.v2.urls import urlpatterns as v2_urls urlpatterns = [ path("v2beta/", include(v2_urls)), diff --git a/passbook/api/v2/__init__.py b/authentik/api/v2/__init__.py similarity index 100% rename from passbook/api/v2/__init__.py rename to authentik/api/v2/__init__.py diff --git a/passbook/api/v2/config.py b/authentik/api/v2/config.py similarity index 85% rename from passbook/api/v2/config.py rename to authentik/api/v2/config.py index a528ed4149..89ec46b1f2 100644 --- a/passbook/api/v2/config.py +++ b/authentik/api/v2/config.py @@ -6,11 +6,11 @@ from rest_framework.response import Response from rest_framework.serializers import ReadOnlyField, Serializer from rest_framework.viewsets import ViewSet -from passbook.lib.config import CONFIG +from authentik.lib.config import CONFIG class ConfigSerializer(Serializer): - """Serialize passbook Config into DRF Object""" + """Serialize authentik Config into DRF Object""" branding_logo = ReadOnlyField() branding_title = ReadOnlyField() @@ -36,8 +36,8 @@ class ConfigsViewSet(ViewSet): """Retrive public configuration options""" config = ConfigSerializer( { - "branding_logo": CONFIG.y("passbook.branding.logo"), - "branding_title": CONFIG.y("passbook.branding.title"), + "branding_logo": CONFIG.y("authentik.branding.logo"), + "branding_title": CONFIG.y("authentik.branding.title"), "error_reporting_enabled": CONFIG.y("error_reporting.enabled"), "error_reporting_environment": CONFIG.y("error_reporting.environment"), "error_reporting_send_pii": CONFIG.y("error_reporting.send_pii"), diff --git a/passbook/api/v2/messages.py b/authentik/api/v2/messages.py similarity index 100% rename from passbook/api/v2/messages.py rename to authentik/api/v2/messages.py diff --git a/passbook/api/v2/urls.py b/authentik/api/v2/urls.py similarity index 59% rename from passbook/api/v2/urls.py rename to authentik/api/v2/urls.py index 0aba5a79b3..bfbbc92ac2 100644 --- a/passbook/api/v2/urls.py +++ b/authentik/api/v2/urls.py @@ -5,55 +5,58 @@ from drf_yasg2.views import get_schema_view from rest_framework import routers from rest_framework.permissions import AllowAny -from passbook.admin.api.overview import AdministrationOverviewViewSet -from passbook.admin.api.overview_metrics import AdministrationMetricsViewSet -from passbook.admin.api.tasks import TaskViewSet -from passbook.api.v2.config import ConfigsViewSet -from passbook.api.v2.messages import MessagesViewSet -from passbook.audit.api import EventViewSet -from passbook.core.api.applications import ApplicationViewSet -from passbook.core.api.groups import GroupViewSet -from passbook.core.api.propertymappings import PropertyMappingViewSet -from passbook.core.api.providers import ProviderViewSet -from passbook.core.api.sources import SourceViewSet -from passbook.core.api.tokens import TokenViewSet -from passbook.core.api.users import UserViewSet -from passbook.crypto.api import CertificateKeyPairViewSet -from passbook.flows.api import FlowStageBindingViewSet, FlowViewSet, StageViewSet -from passbook.outposts.api import ( +from authentik.admin.api.overview import AdministrationOverviewViewSet +from authentik.admin.api.overview_metrics import AdministrationMetricsViewSet +from authentik.admin.api.tasks import TaskViewSet +from authentik.api.v2.config import ConfigsViewSet +from authentik.api.v2.messages import MessagesViewSet +from authentik.audit.api import EventViewSet +from authentik.core.api.applications import ApplicationViewSet +from authentik.core.api.groups import GroupViewSet +from authentik.core.api.propertymappings import PropertyMappingViewSet +from authentik.core.api.providers import ProviderViewSet +from authentik.core.api.sources import SourceViewSet +from authentik.core.api.tokens import TokenViewSet +from authentik.core.api.users import UserViewSet +from authentik.crypto.api import CertificateKeyPairViewSet +from authentik.flows.api import FlowStageBindingViewSet, FlowViewSet, StageViewSet +from authentik.outposts.api import ( DockerServiceConnectionViewSet, KubernetesServiceConnectionViewSet, OutpostViewSet, ) -from passbook.policies.api import PolicyBindingViewSet, PolicyViewSet -from passbook.policies.dummy.api import DummyPolicyViewSet -from passbook.policies.expiry.api import PasswordExpiryPolicyViewSet -from passbook.policies.expression.api import ExpressionPolicyViewSet -from passbook.policies.group_membership.api import GroupMembershipPolicyViewSet -from passbook.policies.hibp.api import HaveIBeenPwendPolicyViewSet -from passbook.policies.password.api import PasswordPolicyViewSet -from passbook.policies.reputation.api import ReputationPolicyViewSet -from passbook.providers.oauth2.api import OAuth2ProviderViewSet, ScopeMappingViewSet -from passbook.providers.proxy.api import ProxyOutpostConfigViewSet, ProxyProviderViewSet -from passbook.providers.saml.api import SAMLPropertyMappingViewSet, SAMLProviderViewSet -from passbook.sources.ldap.api import LDAPPropertyMappingViewSet, LDAPSourceViewSet -from passbook.sources.oauth.api import OAuthSourceViewSet -from passbook.sources.saml.api import SAMLSourceViewSet -from passbook.stages.captcha.api import CaptchaStageViewSet -from passbook.stages.consent.api import ConsentStageViewSet -from passbook.stages.dummy.api import DummyStageViewSet -from passbook.stages.email.api import EmailStageViewSet -from passbook.stages.identification.api import IdentificationStageViewSet -from passbook.stages.invitation.api import InvitationStageViewSet, InvitationViewSet -from passbook.stages.otp_static.api import OTPStaticStageViewSet -from passbook.stages.otp_time.api import OTPTimeStageViewSet -from passbook.stages.otp_validate.api import OTPValidateStageViewSet -from passbook.stages.password.api import PasswordStageViewSet -from passbook.stages.prompt.api import PromptStageViewSet, PromptViewSet -from passbook.stages.user_delete.api import UserDeleteStageViewSet -from passbook.stages.user_login.api import UserLoginStageViewSet -from passbook.stages.user_logout.api import UserLogoutStageViewSet -from passbook.stages.user_write.api import UserWriteStageViewSet +from authentik.policies.api import PolicyBindingViewSet, PolicyViewSet +from authentik.policies.dummy.api import DummyPolicyViewSet +from authentik.policies.expiry.api import PasswordExpiryPolicyViewSet +from authentik.policies.expression.api import ExpressionPolicyViewSet +from authentik.policies.group_membership.api import GroupMembershipPolicyViewSet +from authentik.policies.hibp.api import HaveIBeenPwendPolicyViewSet +from authentik.policies.password.api import PasswordPolicyViewSet +from authentik.policies.reputation.api import ReputationPolicyViewSet +from authentik.providers.oauth2.api import OAuth2ProviderViewSet, ScopeMappingViewSet +from authentik.providers.proxy.api import ( + ProxyOutpostConfigViewSet, + ProxyProviderViewSet, +) +from authentik.providers.saml.api import SAMLPropertyMappingViewSet, SAMLProviderViewSet +from authentik.sources.ldap.api import LDAPPropertyMappingViewSet, LDAPSourceViewSet +from authentik.sources.oauth.api import OAuthSourceViewSet +from authentik.sources.saml.api import SAMLSourceViewSet +from authentik.stages.captcha.api import CaptchaStageViewSet +from authentik.stages.consent.api import ConsentStageViewSet +from authentik.stages.dummy.api import DummyStageViewSet +from authentik.stages.email.api import EmailStageViewSet +from authentik.stages.identification.api import IdentificationStageViewSet +from authentik.stages.invitation.api import InvitationStageViewSet, InvitationViewSet +from authentik.stages.otp_static.api import OTPStaticStageViewSet +from authentik.stages.otp_time.api import OTPTimeStageViewSet +from authentik.stages.otp_validate.api import OTPValidateStageViewSet +from authentik.stages.password.api import PasswordStageViewSet +from authentik.stages.prompt.api import PromptStageViewSet, PromptViewSet +from authentik.stages.user_delete.api import UserDeleteStageViewSet +from authentik.stages.user_login.api import UserLoginStageViewSet +from authentik.stages.user_logout.api import UserLogoutStageViewSet +from authentik.stages.user_write.api import UserWriteStageViewSet router = routers.DefaultRouter() @@ -131,7 +134,7 @@ router.register("stages/dummy", DummyStageViewSet) router.register("policies/dummy", DummyPolicyViewSet) info = openapi.Info( - title="passbook API", + title="authentik API", default_version="v2", contact=openapi.Contact(email="hello@beryju.org"), license=openapi.License(name="MIT License"), diff --git a/passbook/audit/__init__.py b/authentik/audit/__init__.py similarity index 100% rename from passbook/audit/__init__.py rename to authentik/audit/__init__.py diff --git a/passbook/audit/api.py b/authentik/audit/api.py similarity index 97% rename from passbook/audit/api.py rename to authentik/audit/api.py index e19b5ecf1e..c2c1657733 100644 --- a/passbook/audit/api.py +++ b/authentik/audit/api.py @@ -9,7 +9,7 @@ from rest_framework.response import Response from rest_framework.serializers import ModelSerializer, Serializer from rest_framework.viewsets import ReadOnlyModelViewSet -from passbook.audit.models import Event, EventAction +from authentik.audit.models import Event, EventAction class EventSerializer(ModelSerializer): diff --git a/authentik/audit/apps.py b/authentik/audit/apps.py new file mode 100644 index 0000000000..a88e89640b --- /dev/null +++ b/authentik/audit/apps.py @@ -0,0 +1,16 @@ +"""authentik audit app""" +from importlib import import_module + +from django.apps import AppConfig + + +class AuthentikAuditConfig(AppConfig): + """authentik audit app""" + + name = "authentik.audit" + label = "authentik_audit" + verbose_name = "authentik Audit" + mountpoint = "audit/" + + def ready(self): + import_module("authentik.audit.signals") diff --git a/passbook/audit/middleware.py b/authentik/audit/middleware.py similarity index 81% rename from passbook/audit/middleware.py rename to authentik/audit/middleware.py index 769591267a..7c192a5687 100644 --- a/passbook/audit/middleware.py +++ b/authentik/audit/middleware.py @@ -7,9 +7,9 @@ from django.db.models import Model from django.db.models.signals import post_save, pre_delete from django.http import HttpRequest, HttpResponse -from passbook.audit.models import Event, EventAction, model_to_dict -from passbook.audit.signals import EventNewThread -from passbook.core.middleware import LOCAL +from authentik.audit.models import Event, EventAction, model_to_dict +from authentik.audit.signals import EventNewThread +from authentik.core.middleware import LOCAL class AuditMiddleware: @@ -34,27 +34,27 @@ class AuditMiddleware: ) post_save.connect( post_save_handler, - dispatch_uid=LOCAL.passbook["request_id"], + dispatch_uid=LOCAL.authentik["request_id"], weak=False, ) pre_delete.connect( pre_delete_handler, - dispatch_uid=LOCAL.passbook["request_id"], + dispatch_uid=LOCAL.authentik["request_id"], weak=False, ) response = self.get_response(request) - post_save.disconnect(dispatch_uid=LOCAL.passbook["request_id"]) - pre_delete.disconnect(dispatch_uid=LOCAL.passbook["request_id"]) + post_save.disconnect(dispatch_uid=LOCAL.authentik["request_id"]) + pre_delete.disconnect(dispatch_uid=LOCAL.authentik["request_id"]) return response # pylint: disable=unused-argument def process_exception(self, request: HttpRequest, exception: Exception): """Unregister handlers in case of exception""" - post_save.disconnect(dispatch_uid=LOCAL.passbook["request_id"]) - pre_delete.disconnect(dispatch_uid=LOCAL.passbook["request_id"]) + post_save.disconnect(dispatch_uid=LOCAL.authentik["request_id"]) + pre_delete.disconnect(dispatch_uid=LOCAL.authentik["request_id"]) @staticmethod # pylint: disable=unused-argument diff --git a/passbook/audit/migrations/0001_initial.py b/authentik/audit/migrations/0001_initial.py similarity index 100% rename from passbook/audit/migrations/0001_initial.py rename to authentik/audit/migrations/0001_initial.py diff --git a/passbook/audit/migrations/0002_auto_20200918_2116.py b/authentik/audit/migrations/0002_auto_20200918_2116.py similarity index 95% rename from passbook/audit/migrations/0002_auto_20200918_2116.py rename to authentik/audit/migrations/0002_auto_20200918_2116.py index d645c11c00..a6fcabf066 100644 --- a/passbook/audit/migrations/0002_auto_20200918_2116.py +++ b/authentik/audit/migrations/0002_auto_20200918_2116.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_audit", "0001_initial"), + ("authentik_audit", "0001_initial"), ] operations = [ diff --git a/passbook/audit/migrations/0003_auto_20200917_1155.py b/authentik/audit/migrations/0003_auto_20200917_1155.py similarity index 89% rename from passbook/audit/migrations/0003_auto_20200917_1155.py rename to authentik/audit/migrations/0003_auto_20200917_1155.py index d36cee5975..6163fe305a 100644 --- a/passbook/audit/migrations/0003_auto_20200917_1155.py +++ b/authentik/audit/migrations/0003_auto_20200917_1155.py @@ -3,11 +3,11 @@ from django.apps.registry import Apps from django.db import migrations, models from django.db.backends.base.schema import BaseDatabaseSchemaEditor -import passbook.audit.models +import authentik.audit.models def convert_user_to_json(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - Event = apps.get_model("passbook_audit", "Event") + Event = apps.get_model("authentik_audit", "Event") db_alias = schema_editor.connection.alias for event in Event.objects.all(): @@ -15,7 +15,7 @@ def convert_user_to_json(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): # Because event objects cannot be updated, we have to re-create them event.pk = None event.user_json = ( - passbook.audit.models.get_user(event.user) if event.user else {} + authentik.audit.models.get_user(event.user) if event.user else {} ) event._state.adding = True event.save() @@ -24,7 +24,7 @@ def convert_user_to_json(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): class Migration(migrations.Migration): dependencies = [ - ("passbook_audit", "0002_auto_20200918_2116"), + ("authentik_audit", "0002_auto_20200918_2116"), ] operations = [ diff --git a/passbook/audit/migrations/0004_auto_20200921_1829.py b/authentik/audit/migrations/0004_auto_20200921_1829.py similarity index 95% rename from passbook/audit/migrations/0004_auto_20200921_1829.py rename to authentik/audit/migrations/0004_auto_20200921_1829.py index ee5ec816e6..df4f64ab2a 100644 --- a/passbook/audit/migrations/0004_auto_20200921_1829.py +++ b/authentik/audit/migrations/0004_auto_20200921_1829.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_audit", "0003_auto_20200917_1155"), + ("authentik_audit", "0003_auto_20200917_1155"), ] operations = [ diff --git a/passbook/audit/migrations/0005_auto_20201005_2139.py b/authentik/audit/migrations/0005_auto_20201005_2139.py similarity index 95% rename from passbook/audit/migrations/0005_auto_20201005_2139.py rename to authentik/audit/migrations/0005_auto_20201005_2139.py index 558c58ab62..3a28811722 100644 --- a/passbook/audit/migrations/0005_auto_20201005_2139.py +++ b/authentik/audit/migrations/0005_auto_20201005_2139.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_audit", "0004_auto_20200921_1829"), + ("authentik_audit", "0004_auto_20200921_1829"), ] operations = [ diff --git a/passbook/audit/migrations/0006_auto_20201017_2024.py b/authentik/audit/migrations/0006_auto_20201017_2024.py similarity index 96% rename from passbook/audit/migrations/0006_auto_20201017_2024.py rename to authentik/audit/migrations/0006_auto_20201017_2024.py index 89a0fdc5ba..ec242f6bde 100644 --- a/passbook/audit/migrations/0006_auto_20201017_2024.py +++ b/authentik/audit/migrations/0006_auto_20201017_2024.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_audit", "0005_auto_20201005_2139"), + ("authentik_audit", "0005_auto_20201005_2139"), ] operations = [ diff --git a/passbook/audit/migrations/__init__.py b/authentik/audit/migrations/__init__.py similarity index 100% rename from passbook/audit/migrations/__init__.py rename to authentik/audit/migrations/__init__.py diff --git a/passbook/audit/models.py b/authentik/audit/models.py similarity index 97% rename from passbook/audit/models.py rename to authentik/audit/models.py index c589a53490..e07a6b7660 100644 --- a/passbook/audit/models.py +++ b/authentik/audit/models.py @@ -1,4 +1,4 @@ -"""passbook audit models""" +"""authentik audit models""" from inspect import getmodule, stack from typing import Any, Dict, Optional, Union from uuid import UUID, uuid4 @@ -14,14 +14,14 @@ from django.views.debug import SafeExceptionReporterFilter from guardian.utils import get_anonymous_user from structlog import get_logger -from passbook.core.middleware import ( +from authentik.core.middleware import ( SESSION_IMPERSONATE_ORIGINAL_USER, SESSION_IMPERSONATE_USER, ) -from passbook.core.models import User -from passbook.lib.utils.http import get_client_ip +from authentik.core.models import User +from authentik.lib.utils.http import get_client_ip -LOGGER = get_logger("passbook.audit") +LOGGER = get_logger("authentik.audit") def cleanse_dict(source: Dict[Any, Any]) -> Dict[Any, Any]: diff --git a/passbook/audit/signals.py b/authentik/audit/signals.py similarity index 88% rename from passbook/audit/signals.py rename to authentik/audit/signals.py index 3930519165..88d769a8b0 100644 --- a/passbook/audit/signals.py +++ b/authentik/audit/signals.py @@ -1,4 +1,4 @@ -"""passbook audit signal listener""" +"""authentik audit signal listener""" from threading import Thread from typing import Any, Dict, Optional @@ -10,12 +10,12 @@ from django.contrib.auth.signals import ( from django.dispatch import receiver from django.http import HttpRequest -from passbook.audit.models import Event, EventAction -from passbook.core.models import User -from passbook.core.signals import password_changed -from passbook.stages.invitation.models import Invitation -from passbook.stages.invitation.signals import invitation_created, invitation_used -from passbook.stages.user_write.signals import user_write +from authentik.audit.models import Event, EventAction +from authentik.core.models import User +from authentik.core.signals import password_changed +from authentik.stages.invitation.models import Invitation +from authentik.stages.invitation.signals import invitation_created, invitation_used +from authentik.stages.user_write.signals import user_write class EventNewThread(Thread): diff --git a/passbook/audit/templates/audit/list.html b/authentik/audit/templates/audit/list.html similarity index 97% rename from passbook/audit/templates/audit/list.html rename to authentik/audit/templates/audit/list.html index 6777b2102c..470f9f0f38 100644 --- a/passbook/audit/templates/audit/list.html +++ b/authentik/audit/templates/audit/list.html @@ -1,7 +1,7 @@ {% extends "base/page.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block page_content %}
@@ -18,7 +18,7 @@
{% include 'partials/toolbar_search.html' %} - {% include 'partials/pagination.html' %} diff --git a/passbook/audit/tests/__init__.py b/authentik/audit/tests/__init__.py similarity index 100% rename from passbook/audit/tests/__init__.py rename to authentik/audit/tests/__init__.py diff --git a/passbook/audit/tests/test_event.py b/authentik/audit/tests/test_event.py similarity index 92% rename from passbook/audit/tests/test_event.py rename to authentik/audit/tests/test_event.py index af2970254f..bf7a6b5948 100644 --- a/passbook/audit/tests/test_event.py +++ b/authentik/audit/tests/test_event.py @@ -4,8 +4,8 @@ from django.contrib.contenttypes.models import ContentType from django.test import TestCase from guardian.shortcuts import get_anonymous_user -from passbook.audit.models import Event -from passbook.policies.dummy.models import DummyPolicy +from authentik.audit.models import Event +from authentik.policies.dummy.models import DummyPolicy class TestAuditEvent(TestCase): diff --git a/passbook/audit/urls.py b/authentik/audit/urls.py similarity index 61% rename from passbook/audit/urls.py rename to authentik/audit/urls.py index 83be4fe290..13fd64dfe9 100644 --- a/passbook/audit/urls.py +++ b/authentik/audit/urls.py @@ -1,7 +1,7 @@ -"""passbook audit urls""" +"""authentik audit urls""" from django.urls import path -from passbook.audit.views import EventListView +from authentik.audit.views import EventListView urlpatterns = [ # Audit Log diff --git a/passbook/audit/views.py b/authentik/audit/views.py similarity index 71% rename from passbook/audit/views.py rename to authentik/audit/views.py index e08d5c2f71..c87d2fd675 100644 --- a/passbook/audit/views.py +++ b/authentik/audit/views.py @@ -1,10 +1,10 @@ -"""passbook Event administration""" +"""authentik Event administration""" from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import ListView from guardian.mixins import PermissionListMixin -from passbook.admin.views.utils import SearchListMixin, UserPaginateListMixin -from passbook.audit.models import Event +from authentik.admin.views.utils import SearchListMixin, UserPaginateListMixin +from authentik.audit.models import Event class EventListView( @@ -18,7 +18,7 @@ class EventListView( model = Event template_name = "audit/list.html" - permission_required = "passbook_audit.view_event" + permission_required = "authentik_audit.view_event" ordering = "-created" search_fields = [ diff --git a/passbook/core/__init__.py b/authentik/core/__init__.py similarity index 100% rename from passbook/core/__init__.py rename to authentik/core/__init__.py diff --git a/passbook/core/admin.py b/authentik/core/admin.py similarity index 90% rename from passbook/core/admin.py rename to authentik/core/admin.py index a1f5f5450a..d30ece7e8f 100644 --- a/passbook/core/admin.py +++ b/authentik/core/admin.py @@ -1,4 +1,4 @@ -"""passbook core admin""" +"""authentik core admin""" from django.apps import AppConfig, apps from django.contrib import admin @@ -19,6 +19,6 @@ def admin_autoregister(app: AppConfig): for _app in apps.get_app_configs(): - if _app.label.startswith("passbook_"): + if _app.label.startswith("authentik_"): LOGGER.debug("Registering application for dj-admin", application=_app.label) admin_autoregister(_app) diff --git a/passbook/core/api/__init__.py b/authentik/core/api/__init__.py similarity index 100% rename from passbook/core/api/__init__.py rename to authentik/core/api/__init__.py diff --git a/passbook/core/api/applications.py b/authentik/core/api/applications.py similarity index 92% rename from passbook/core/api/applications.py rename to authentik/core/api/applications.py index be65df662f..8dab692996 100644 --- a/passbook/core/api/applications.py +++ b/authentik/core/api/applications.py @@ -8,10 +8,10 @@ from rest_framework.serializers import ModelSerializer from rest_framework.viewsets import ModelViewSet from rest_framework_guardian.filters import ObjectPermissionsFilter -from passbook.admin.api.overview_metrics import get_events_per_1h -from passbook.audit.models import EventAction -from passbook.core.models import Application -from passbook.policies.engine import PolicyEngine +from authentik.admin.api.overview_metrics import get_events_per_1h +from authentik.audit.models import EventAction +from authentik.core.models import Application +from authentik.policies.engine import PolicyEngine class ApplicationSerializer(ModelSerializer): diff --git a/passbook/core/api/groups.py b/authentik/core/api/groups.py similarity index 91% rename from passbook/core/api/groups.py rename to authentik/core/api/groups.py index 1af8ab4251..fa1b8953d0 100644 --- a/passbook/core/api/groups.py +++ b/authentik/core/api/groups.py @@ -2,7 +2,7 @@ from rest_framework.serializers import ModelSerializer from rest_framework.viewsets import ModelViewSet -from passbook.core.models import Group +from authentik.core.models import Group class GroupSerializer(ModelSerializer): diff --git a/passbook/core/api/propertymappings.py b/authentik/core/api/propertymappings.py similarity index 94% rename from passbook/core/api/propertymappings.py rename to authentik/core/api/propertymappings.py index 7e72d65bfb..3394f5753f 100644 --- a/passbook/core/api/propertymappings.py +++ b/authentik/core/api/propertymappings.py @@ -2,7 +2,7 @@ from rest_framework.serializers import ModelSerializer, SerializerMethodField from rest_framework.viewsets import ReadOnlyModelViewSet -from passbook.core.models import PropertyMapping +from authentik.core.models import PropertyMapping class PropertyMappingSerializer(ModelSerializer): diff --git a/passbook/core/api/providers.py b/authentik/core/api/providers.py similarity index 95% rename from passbook/core/api/providers.py rename to authentik/core/api/providers.py index 4b493dcace..e0e32b074a 100644 --- a/passbook/core/api/providers.py +++ b/authentik/core/api/providers.py @@ -2,7 +2,7 @@ from rest_framework.serializers import ModelSerializer, SerializerMethodField from rest_framework.viewsets import ReadOnlyModelViewSet -from passbook.core.models import Provider +from authentik.core.models import Provider class ProviderSerializer(ModelSerializer): diff --git a/passbook/core/api/sources.py b/authentik/core/api/sources.py similarity index 88% rename from passbook/core/api/sources.py rename to authentik/core/api/sources.py index 0cc49212be..e19acf27e1 100644 --- a/passbook/core/api/sources.py +++ b/authentik/core/api/sources.py @@ -2,8 +2,8 @@ from rest_framework.serializers import ModelSerializer, SerializerMethodField from rest_framework.viewsets import ReadOnlyModelViewSet -from passbook.admin.forms.source import SOURCE_SERIALIZER_FIELDS -from passbook.core.models import Source +from authentik.admin.forms.source import SOURCE_SERIALIZER_FIELDS +from authentik.core.models import Source class SourceSerializer(ModelSerializer): diff --git a/passbook/core/api/tokens.py b/authentik/core/api/tokens.py similarity index 91% rename from passbook/core/api/tokens.py rename to authentik/core/api/tokens.py index 166d76012f..bdaedf915c 100644 --- a/passbook/core/api/tokens.py +++ b/authentik/core/api/tokens.py @@ -6,8 +6,8 @@ from rest_framework.response import Response from rest_framework.serializers import ModelSerializer from rest_framework.viewsets import ModelViewSet -from passbook.audit.models import Event, EventAction -from passbook.core.models import Token +from authentik.audit.models import Event, EventAction +from authentik.core.models import Token class TokenSerializer(ModelSerializer): diff --git a/passbook/core/api/users.py b/authentik/core/api/users.py similarity index 92% rename from passbook/core/api/users.py rename to authentik/core/api/users.py index 1296e96d24..b4fb8554bc 100644 --- a/passbook/core/api/users.py +++ b/authentik/core/api/users.py @@ -10,8 +10,8 @@ from rest_framework.serializers import ( ) from rest_framework.viewsets import ModelViewSet -from passbook.core.models import User -from passbook.lib.templatetags.passbook_utils import avatar +from authentik.core.models import User +from authentik.lib.templatetags.authentik_utils import avatar class UserSerializer(ModelSerializer): diff --git a/authentik/core/apps.py b/authentik/core/apps.py new file mode 100644 index 0000000000..395737f39d --- /dev/null +++ b/authentik/core/apps.py @@ -0,0 +1,11 @@ +"""authentik core app config""" +from django.apps import AppConfig + + +class AuthentikCoreConfig(AppConfig): + """authentik core app config""" + + name = "authentik.core" + label = "authentik_core" + verbose_name = "authentik Core" + mountpoint = "" diff --git a/passbook/core/channels.py b/authentik/core/channels.py similarity index 89% rename from passbook/core/channels.py rename to authentik/core/channels.py index 5598ef8fa5..31be6ffd05 100644 --- a/passbook/core/channels.py +++ b/authentik/core/channels.py @@ -2,8 +2,8 @@ from channels.generic.websocket import JsonWebsocketConsumer from structlog import get_logger -from passbook.api.auth import token_from_header -from passbook.core.models import User +from authentik.api.auth import token_from_header +from authentik.core.models import User LOGGER = get_logger() diff --git a/passbook/core/exceptions.py b/authentik/core/exceptions.py similarity index 64% rename from passbook/core/exceptions.py rename to authentik/core/exceptions.py index 01fc51bfed..7b157fc269 100644 --- a/passbook/core/exceptions.py +++ b/authentik/core/exceptions.py @@ -1,5 +1,5 @@ -"""passbook core exceptions""" -from passbook.lib.sentry import SentryIgnoredException +"""authentik core exceptions""" +from authentik.lib.sentry import SentryIgnoredException class PropertyMappingExpressionException(SentryIgnoredException): diff --git a/passbook/core/expression.py b/authentik/core/expression.py similarity index 84% rename from passbook/core/expression.py rename to authentik/core/expression.py index 37a397ca0a..534ba4775f 100644 --- a/passbook/core/expression.py +++ b/authentik/core/expression.py @@ -3,8 +3,8 @@ from typing import Optional from django.http import HttpRequest -from passbook.core.models import User -from passbook.lib.expression.evaluator import BaseEvaluator +from authentik.core.models import User +from authentik.lib.expression.evaluator import BaseEvaluator class PropertyMappingEvaluator(BaseEvaluator): diff --git a/passbook/core/forms/__init__.py b/authentik/core/forms/__init__.py similarity index 100% rename from passbook/core/forms/__init__.py rename to authentik/core/forms/__init__.py diff --git a/passbook/core/forms/applications.py b/authentik/core/forms/applications.py similarity index 84% rename from passbook/core/forms/applications.py rename to authentik/core/forms/applications.py index f2cc801deb..db31e20a6c 100644 --- a/passbook/core/forms/applications.py +++ b/authentik/core/forms/applications.py @@ -1,9 +1,9 @@ -"""passbook Core Application forms""" +"""authentik Core Application forms""" from django import forms from django.utils.translation import gettext_lazy as _ -from passbook.core.models import Application, Provider -from passbook.lib.widgets import GroupedModelChoiceField +from authentik.core.models import Application, Provider +from authentik.lib.widgets import GroupedModelChoiceField class ApplicationForm(forms.ModelForm): @@ -36,7 +36,7 @@ class ApplicationForm(forms.ModelForm): help_texts = { "meta_launch_url": _( ( - "If left empty, passbook will try to extract the launch URL " + "If left empty, authentik will try to extract the launch URL " "based on the selected provider." ) ), diff --git a/passbook/core/forms/groups.py b/authentik/core/forms/groups.py similarity index 86% rename from passbook/core/forms/groups.py rename to authentik/core/forms/groups.py index e33805d0dc..8d10f1eae9 100644 --- a/passbook/core/forms/groups.py +++ b/authentik/core/forms/groups.py @@ -1,8 +1,8 @@ -"""passbook Core Group forms""" +"""authentik Core Group forms""" from django import forms -from passbook.admin.fields import CodeMirrorWidget, YAMLField -from passbook.core.models import Group, User +from authentik.admin.fields import CodeMirrorWidget, YAMLField +from authentik.core.models import Group, User class GroupForm(forms.ModelForm): diff --git a/passbook/core/forms/token.py b/authentik/core/forms/token.py similarity index 91% rename from passbook/core/forms/token.py rename to authentik/core/forms/token.py index bbc316b833..9bc43aa8fc 100644 --- a/passbook/core/forms/token.py +++ b/authentik/core/forms/token.py @@ -1,7 +1,7 @@ """Core user token form""" from django import forms -from passbook.core.models import Token +from authentik.core.models import Token class UserTokenForm(forms.ModelForm): diff --git a/passbook/core/forms/users.py b/authentik/core/forms/users.py similarity index 76% rename from passbook/core/forms/users.py rename to authentik/core/forms/users.py index f6b725cda7..36b5e33c55 100644 --- a/passbook/core/forms/users.py +++ b/authentik/core/forms/users.py @@ -1,8 +1,8 @@ -"""passbook core user forms""" +"""authentik core user forms""" from django import forms -from passbook.core.models import User +from authentik.core.models import User class UserDetailForm(forms.ModelForm): diff --git a/passbook/core/middleware.py b/authentik/core/middleware.py similarity index 73% rename from passbook/core/middleware.py rename to authentik/core/middleware.py index 116050bad8..9b43485e90 100644 --- a/passbook/core/middleware.py +++ b/authentik/core/middleware.py @@ -1,4 +1,4 @@ -"""passbook admin Middleware to impersonate users""" +"""authentik admin Middleware to impersonate users""" from logging import Logger from threading import local from typing import Callable @@ -6,8 +6,8 @@ from uuid import uuid4 from django.http import HttpRequest, HttpResponse -SESSION_IMPERSONATE_USER = "passbook_impersonate_user" -SESSION_IMPERSONATE_ORIGINAL_USER = "passbook_impersonate_original_user" +SESSION_IMPERSONATE_USER = "authentik_impersonate_user" +SESSION_IMPERSONATE_ORIGINAL_USER = "authentik_impersonate_original_user" LOCAL = local() @@ -41,16 +41,16 @@ class RequestIDMiddleware: if not hasattr(request, "request_id"): request_id = uuid4().hex setattr(request, "request_id", request_id) - LOCAL.passbook = {"request_id": request_id} + LOCAL.authentik = {"request_id": request_id} response = self.get_response(request) - response["X-passbook-id"] = request.request_id - del LOCAL.passbook["request_id"] + response["X-authentik-id"] = request.request_id + del LOCAL.authentik["request_id"] return response # pylint: disable=unused-argument def structlog_add_request_id(logger: Logger, method_name: str, event_dict): - """If threadlocal has passbook defined, add request_id to log""" - if hasattr(LOCAL, "passbook"): - event_dict["request_id"] = LOCAL.passbook.get("request_id", "") + """If threadlocal has authentik defined, add request_id to log""" + if hasattr(LOCAL, "authentik"): + event_dict["request_id"] = LOCAL.authentik.get("request_id", "") return event_dict diff --git a/passbook/core/migrations/0001_initial.py b/authentik/core/migrations/0001_initial.py similarity index 92% rename from passbook/core/migrations/0001_initial.py rename to authentik/core/migrations/0001_initial.py index f46601d14b..e79bbbfd1e 100644 --- a/passbook/core/migrations/0001_initial.py +++ b/authentik/core/migrations/0001_initial.py @@ -10,7 +10,7 @@ import guardian.mixins from django.conf import settings from django.db import migrations, models -import passbook.core.models +import authentik.core.models class Migration(migrations.Migration): @@ -18,7 +18,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ("passbook_policies", "0001_initial"), + ("authentik_policies", "0001_initial"), ("auth", "0011_update_proxy_permissions"), ] @@ -152,7 +152,7 @@ class Migration(migrations.Migration): parent_link=True, primary_key=True, serialize=False, - to="passbook_policies.PolicyBindingModel", + to="authentik_policies.PolicyBindingModel", ), ), ("name", models.TextField(help_text="Source's display Name.")), @@ -164,11 +164,11 @@ class Migration(migrations.Migration): ( "property_mappings", models.ManyToManyField( - blank=True, default=None, to="passbook_core.PropertyMapping" + blank=True, default=None, to="authentik_core.PropertyMapping" ), ), ], - bases=("passbook_policies.policybindingmodel",), + bases=("authentik_policies.policybindingmodel",), ), migrations.CreateModel( name="UserSourceConnection", @@ -188,7 +188,7 @@ class Migration(migrations.Migration): "source", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, - to="passbook_core.Source", + to="authentik_core.Source", ), ), ( @@ -218,7 +218,7 @@ class Migration(migrations.Migration): ( "expires", models.DateTimeField( - default=passbook.core.models.default_token_duration + default=authentik.core.models.default_token_duration ), ), ("expiring", models.BooleanField(default=True)), @@ -252,7 +252,7 @@ class Migration(migrations.Migration): ( "property_mappings", models.ManyToManyField( - blank=True, default=None, to="passbook_core.PropertyMapping" + blank=True, default=None, to="authentik_core.PropertyMapping" ), ), ], @@ -281,7 +281,7 @@ class Migration(migrations.Migration): null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="children", - to="passbook_core.Group", + to="authentik_core.Group", ), ), ], @@ -300,7 +300,7 @@ class Migration(migrations.Migration): parent_link=True, primary_key=True, serialize=False, - to="passbook_policies.PolicyBindingModel", + to="authentik_policies.PolicyBindingModel", ), ), ("name", models.TextField(help_text="Application's display Name.")), @@ -322,22 +322,23 @@ class Migration(migrations.Migration): default=None, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, - to="passbook_core.Provider", + to="authentik_core.Provider", ), ), ], - bases=("passbook_policies.policybindingmodel",), + bases=("authentik_policies.policybindingmodel",), ), migrations.AddField( model_name="user", name="groups", - field=models.ManyToManyField(to="passbook_core.Group"), + field=models.ManyToManyField(to="authentik_core.Group"), ), migrations.AddField( model_name="user", name="sources", field=models.ManyToManyField( - through="passbook_core.UserSourceConnection", to="passbook_core.Source" + through="authentik_core.UserSourceConnection", + to="authentik_core.Source", ), ), migrations.AddField( diff --git a/passbook/core/migrations/0002_auto_20200523_1133.py b/authentik/core/migrations/0002_auto_20200523_1133.py similarity index 87% rename from passbook/core/migrations/0002_auto_20200523_1133.py rename to authentik/core/migrations/0002_auto_20200523_1133.py index 79855d62fd..ecc0717fc9 100644 --- a/passbook/core/migrations/0002_auto_20200523_1133.py +++ b/authentik/core/migrations/0002_auto_20200523_1133.py @@ -7,8 +7,8 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_flows", "0003_auto_20200523_1133"), - ("passbook_core", "0001_initial"), + ("authentik_flows", "0003_auto_20200523_1133"), + ("authentik_core", "0001_initial"), ] operations = [ @@ -26,7 +26,7 @@ class Migration(migrations.Migration): null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="source_authentication", - to="passbook_flows.Flow", + to="authentik_flows.Flow", ), ), migrations.AddField( @@ -39,7 +39,7 @@ class Migration(migrations.Migration): null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="source_enrollment", - to="passbook_flows.Flow", + to="authentik_flows.Flow", ), ), migrations.AddField( @@ -49,7 +49,7 @@ class Migration(migrations.Migration): help_text="Flow used when authorizing this provider.", on_delete=django.db.models.deletion.CASCADE, related_name="provider_authorization", - to="passbook_flows.Flow", + to="authentik_flows.Flow", ), ), ] diff --git a/passbook/core/migrations/0003_default_user.py b/authentik/core/migrations/0003_default_user.py similarity index 76% rename from passbook/core/migrations/0003_default_user.py rename to authentik/core/migrations/0003_default_user.py index c043038e33..ffa3eee82e 100644 --- a/passbook/core/migrations/0003_default_user.py +++ b/authentik/core/migrations/0003_default_user.py @@ -7,21 +7,21 @@ from django.db.backends.base.schema import BaseDatabaseSchemaEditor def create_default_user(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): # We have to use a direct import here, otherwise we get an object manager error - from passbook.core.models import User + from authentik.core.models import User db_alias = schema_editor.connection.alias - pbadmin, _ = User.objects.using(db_alias).get_or_create( - username="pbadmin", email="root@localhost", name="passbook Default Admin" + akadmin, _ = User.objects.using(db_alias).get_or_create( + username="akadmin", email="root@localhost", name="authentik Default Admin" ) - pbadmin.set_password("pbadmin", signal=False) # noqa # nosec - pbadmin.save() + akadmin.set_password("akadmin", signal=False) # noqa # nosec + akadmin.save() class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0002_auto_20200523_1133"), + ("authentik_core", "0002_auto_20200523_1133"), ] operations = [ diff --git a/passbook/core/migrations/0004_auto_20200703_2213.py b/authentik/core/migrations/0004_auto_20200703_2213.py similarity index 93% rename from passbook/core/migrations/0004_auto_20200703_2213.py rename to authentik/core/migrations/0004_auto_20200703_2213.py index b56c3d95cb..e3e98bea60 100644 --- a/passbook/core/migrations/0004_auto_20200703_2213.py +++ b/authentik/core/migrations/0004_auto_20200703_2213.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0003_default_user"), + ("authentik_core", "0003_default_user"), ] operations = [ diff --git a/passbook/core/migrations/0005_token_intent.py b/authentik/core/migrations/0005_token_intent.py similarity index 90% rename from passbook/core/migrations/0005_token_intent.py rename to authentik/core/migrations/0005_token_intent.py index 975bae05d4..b7790106d8 100644 --- a/passbook/core/migrations/0005_token_intent.py +++ b/authentik/core/migrations/0005_token_intent.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0004_auto_20200703_2213"), + ("authentik_core", "0004_auto_20200703_2213"), ] operations = [ diff --git a/passbook/core/migrations/0006_auto_20200709_1608.py b/authentik/core/migrations/0006_auto_20200709_1608.py similarity index 89% rename from passbook/core/migrations/0006_auto_20200709_1608.py rename to authentik/core/migrations/0006_auto_20200709_1608.py index 527b3aa456..2dec93721a 100644 --- a/passbook/core/migrations/0006_auto_20200709_1608.py +++ b/authentik/core/migrations/0006_auto_20200709_1608.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0005_token_intent"), + ("authentik_core", "0005_token_intent"), ] operations = [ diff --git a/passbook/core/migrations/0007_auto_20200815_1841.py b/authentik/core/migrations/0007_auto_20200815_1841.py similarity index 88% rename from passbook/core/migrations/0007_auto_20200815_1841.py rename to authentik/core/migrations/0007_auto_20200815_1841.py index 6733e05d94..51fe03d1ee 100644 --- a/passbook/core/migrations/0007_auto_20200815_1841.py +++ b/authentik/core/migrations/0007_auto_20200815_1841.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0006_auto_20200709_1608"), + ("authentik_core", "0006_auto_20200709_1608"), ] operations = [ diff --git a/passbook/core/migrations/0008_auto_20200824_1532.py b/authentik/core/migrations/0008_auto_20200824_1532.py similarity index 82% rename from passbook/core/migrations/0008_auto_20200824_1532.py rename to authentik/core/migrations/0008_auto_20200824_1532.py index 23ac854302..13ba0d3d1a 100644 --- a/passbook/core/migrations/0008_auto_20200824_1532.py +++ b/authentik/core/migrations/0008_auto_20200824_1532.py @@ -7,14 +7,14 @@ class Migration(migrations.Migration): dependencies = [ ("auth", "0012_alter_user_first_name_max_length"), - ("passbook_core", "0007_auto_20200815_1841"), + ("authentik_core", "0007_auto_20200815_1841"), ] operations = [ migrations.RemoveField( model_name="user", name="groups", - field=models.ManyToManyField(to="passbook_core.Group"), + field=models.ManyToManyField(to="authentik_core.Group"), ), migrations.AddField( model_name="user", @@ -31,6 +31,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name="user", name="pb_groups", - field=models.ManyToManyField(to="passbook_core.Group"), + field=models.ManyToManyField(to="authentik_core.Group"), ), ] diff --git a/passbook/core/migrations/0009_group_is_superuser.py b/authentik/core/migrations/0009_group_is_superuser.py similarity index 76% rename from passbook/core/migrations/0009_group_is_superuser.py rename to authentik/core/migrations/0009_group_is_superuser.py index 3efe597a4a..37133587e3 100644 --- a/passbook/core/migrations/0009_group_is_superuser.py +++ b/authentik/core/migrations/0009_group_is_superuser.py @@ -3,29 +3,29 @@ from django.apps.registry import Apps from django.db import migrations, models from django.db.backends.base.schema import BaseDatabaseSchemaEditor -import passbook.core.models +import authentik.core.models def create_default_admin_group(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): db_alias = schema_editor.connection.alias - Group = apps.get_model("passbook_core", "Group") - User = apps.get_model("passbook_core", "User") + Group = apps.get_model("authentik_core", "Group") + User = apps.get_model("authentik_core", "User") # Creates a default admin group group, _ = Group.objects.using(db_alias).get_or_create( is_superuser=True, defaults={ - "name": "passbook Admins", + "name": "authentik Admins", }, ) - group.users.set(User.objects.filter(username="pbadmin")) + group.users.set(User.objects.filter(username="akadmin")) group.save() class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0008_auto_20200824_1532"), + ("authentik_core", "0008_auto_20200824_1532"), ] operations = [ @@ -41,7 +41,7 @@ class Migration(migrations.Migration): model_name="user", name="pb_groups", field=models.ManyToManyField( - related_name="users", to="passbook_core.Group" + related_name="users", to="authentik_core.Group" ), ), migrations.AddField( @@ -55,7 +55,7 @@ class Migration(migrations.Migration): migrations.AlterModelManagers( name="user", managers=[ - ("objects", passbook.core.models.UserManager()), + ("objects", authentik.core.models.UserManager()), ], ), ] diff --git a/passbook/core/migrations/0010_auto_20200917_1021.py b/authentik/core/migrations/0010_auto_20200917_1021.py similarity index 91% rename from passbook/core/migrations/0010_auto_20200917_1021.py rename to authentik/core/migrations/0010_auto_20200917_1021.py index 29c3ae7a25..d9e670dac5 100644 --- a/passbook/core/migrations/0010_auto_20200917_1021.py +++ b/authentik/core/migrations/0010_auto_20200917_1021.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0009_group_is_superuser"), + ("authentik_core", "0009_group_is_superuser"), ] operations = [ diff --git a/passbook/core/migrations/0011_provider_name_temp.py b/authentik/core/migrations/0011_provider_name_temp.py similarity index 87% rename from passbook/core/migrations/0011_provider_name_temp.py rename to authentik/core/migrations/0011_provider_name_temp.py index 932029f79f..9b38c50d25 100644 --- a/passbook/core/migrations/0011_provider_name_temp.py +++ b/authentik/core/migrations/0011_provider_name_temp.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0010_auto_20200917_1021"), + ("authentik_core", "0010_auto_20200917_1021"), ] operations = [ diff --git a/passbook/core/migrations/0012_auto_20201003_1737.py b/authentik/core/migrations/0012_auto_20201003_1737.py similarity index 61% rename from passbook/core/migrations/0012_auto_20201003_1737.py rename to authentik/core/migrations/0012_auto_20201003_1737.py index 180dae627a..8ec00aa246 100644 --- a/passbook/core/migrations/0012_auto_20201003_1737.py +++ b/authentik/core/migrations/0012_auto_20201003_1737.py @@ -6,9 +6,9 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0011_provider_name_temp"), - ("passbook_providers_oauth2", "0006_remove_oauth2provider_name"), - ("passbook_providers_saml", "0006_remove_samlprovider_name"), + ("authentik_core", "0011_provider_name_temp"), + ("authentik_providers_oauth2", "0006_remove_oauth2provider_name"), + ("authentik_providers_saml", "0006_remove_samlprovider_name"), ] operations = [ diff --git a/passbook/core/migrations/0013_auto_20201003_2132.py b/authentik/core/migrations/0013_auto_20201003_2132.py similarity index 94% rename from passbook/core/migrations/0013_auto_20201003_2132.py rename to authentik/core/migrations/0013_auto_20201003_2132.py index 6aa8ed7327..9ed9b36243 100644 --- a/passbook/core/migrations/0013_auto_20201003_2132.py +++ b/authentik/core/migrations/0013_auto_20201003_2132.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0012_auto_20201003_1737"), + ("authentik_core", "0012_auto_20201003_1737"), ] operations = [ diff --git a/passbook/core/migrations/0014_auto_20201018_1158.py b/authentik/core/migrations/0014_auto_20201018_1158.py similarity index 74% rename from passbook/core/migrations/0014_auto_20201018_1158.py rename to authentik/core/migrations/0014_auto_20201018_1158.py index 78c20804a2..0f3f9dc96f 100644 --- a/passbook/core/migrations/0014_auto_20201018_1158.py +++ b/authentik/core/migrations/0014_auto_20201018_1158.py @@ -3,12 +3,12 @@ from django.apps.registry import Apps from django.db import migrations, models from django.db.backends.base.schema import BaseDatabaseSchemaEditor -import passbook.core.models +import authentik.core.models def set_default_token_key(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): db_alias = schema_editor.connection.alias - Token = apps.get_model("passbook_core", "Token") + Token = apps.get_model("authentik_core", "Token") for token in Token.objects.using(db_alias).all(): token.key = token.pk.hex @@ -18,14 +18,14 @@ def set_default_token_key(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0013_auto_20201003_2132"), + ("authentik_core", "0013_auto_20201003_2132"), ] operations = [ migrations.AddField( model_name="token", name="key", - field=models.TextField(default=passbook.core.models.default_token_key), + field=models.TextField(default=authentik.core.models.default_token_key), ), migrations.AlterUniqueTogether( name="token", @@ -38,12 +38,12 @@ class Migration(migrations.Migration): ), migrations.AddIndex( model_name="token", - index=models.Index(fields=["key"], name="passbook_co_key_e45007_idx"), + index=models.Index(fields=["key"], name="authentik_co_key_e45007_idx"), ), migrations.AddIndex( model_name="token", index=models.Index( - fields=["identifier"], name="passbook_co_identif_1a34a8_idx" + fields=["identifier"], name="authentik_co_identif_1a34a8_idx" ), ), migrations.RunPython(set_default_token_key), diff --git a/passbook/core/migrations/0015_application_icon.py b/authentik/core/migrations/0015_application_icon.py similarity index 90% rename from passbook/core/migrations/0015_application_icon.py rename to authentik/core/migrations/0015_application_icon.py index 5db76b9ede..4ea6ac2c8b 100644 --- a/passbook/core/migrations/0015_application_icon.py +++ b/authentik/core/migrations/0015_application_icon.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("passbook_core", "0014_auto_20201018_1158"), + ("authentik_core", "0014_auto_20201018_1158"), ] operations = [ diff --git a/authentik/core/migrations/0016_auto_20201202_2234.py b/authentik/core/migrations/0016_auto_20201202_2234.py new file mode 100644 index 0000000000..e03ab30e08 --- /dev/null +++ b/authentik/core/migrations/0016_auto_20201202_2234.py @@ -0,0 +1,36 @@ +# Generated by Django 3.1.3 on 2020-12-02 22:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_core", "0015_application_icon"), + ] + + operations = [ + migrations.RemoveIndex( + model_name="token", + name="authentik_co_key_e45007_idx", + ), + migrations.RemoveIndex( + model_name="token", + name="authentik_co_identif_1a34a8_idx", + ), + migrations.RenameField( + model_name="user", + old_name="pb_groups", + new_name="ak_groups", + ), + migrations.AddIndex( + model_name="token", + index=models.Index( + fields=["identifier"], name="authentik_c_identif_d9d032_idx" + ), + ), + migrations.AddIndex( + model_name="token", + index=models.Index(fields=["key"], name="authentik_c_key_f71355_idx"), + ), + ] diff --git a/passbook/core/migrations/__init__.py b/authentik/core/migrations/__init__.py similarity index 100% rename from passbook/core/migrations/__init__.py rename to authentik/core/migrations/__init__.py diff --git a/passbook/core/models.py b/authentik/core/models.py similarity index 92% rename from passbook/core/models.py rename to authentik/core/models.py index da9da6afc7..b55acac518 100644 --- a/passbook/core/models.py +++ b/authentik/core/models.py @@ -1,4 +1,4 @@ -"""passbook core models""" +"""authentik core models""" from datetime import timedelta from typing import Any, Dict, Optional, Type from uuid import uuid4 @@ -16,15 +16,16 @@ from guardian.mixins import GuardianUserMixin from model_utils.managers import InheritanceManager from structlog import get_logger -from passbook.core.exceptions import PropertyMappingExpressionException -from passbook.core.signals import password_changed -from passbook.core.types import UILoginButton -from passbook.flows.models import Flow -from passbook.lib.models import CreatedUpdatedModel -from passbook.policies.models import PolicyBindingModel +from authentik.core.exceptions import PropertyMappingExpressionException +from authentik.core.signals import password_changed +from authentik.core.types import UILoginButton +from authentik.flows.models import Flow +from authentik.lib.models import CreatedUpdatedModel +from authentik.policies.models import PolicyBindingModel LOGGER = get_logger() -PASSBOOK_USER_DEBUG = "passbook_user_debug" +USER_ATTRIBUTE_DEBUG = "goauthentik.io/user/debug" +USER_ATTRIBUTE_SA = "goauthentik.io/user/service-account" def default_token_duration(): @@ -84,7 +85,7 @@ class User(GuardianUserMixin, AbstractUser): name = models.TextField(help_text=_("User's display name.")) sources = models.ManyToManyField("Source", through="UserSourceConnection") - pb_groups = models.ManyToManyField("Group", related_name="users") + ak_groups = models.ManyToManyField("Group", related_name="users") password_change_date = models.DateTimeField(auto_now_add=True) attributes = models.JSONField(default=dict, blank=True) @@ -95,7 +96,7 @@ class User(GuardianUserMixin, AbstractUser): """Get a dictionary containing the attributes from all groups the user belongs to, including the users attributes""" final_attributes = {} - for group in self.pb_groups.all().order_by("name"): + for group in self.ak_groups.all().order_by("name"): final_attributes.update(group.attributes) final_attributes.update(self.attributes) return final_attributes @@ -103,7 +104,7 @@ class User(GuardianUserMixin, AbstractUser): @cached_property def is_superuser(self) -> bool: """Get supseruser status based on membership in a group with superuser status""" - return self.pb_groups.filter(is_superuser=True).exists() + return self.ak_groups.filter(is_superuser=True).exists() @property def is_staff(self) -> bool: @@ -160,7 +161,7 @@ class Provider(models.Model): class Application(PolicyBindingModel): - """Every Application which uses passbook for authentication/identification/authorization + """Every Application which uses authentik for authentication/identification/authorization needs an Application record. Other authentication types can subclass this Model to add custom fields and other properties""" @@ -171,7 +172,7 @@ class Application(PolicyBindingModel): ) meta_launch_url = models.URLField(default="", blank=True) - # For template applications, this can be set to /static/passbook/applications/* + # For template applications, this can be set to /static/authentik/applications/* meta_icon = models.FileField(upload_to="application-icons/", default="", blank=True) meta_description = models.TextField(default="", blank=True) meta_publisher = models.TextField(default="", blank=True) @@ -352,7 +353,7 @@ class PropertyMapping(models.Model): self, user: Optional[User], request: Optional[HttpRequest], **kwargs ) -> Any: """Evaluate `self.expression` using `**kwargs` as Context.""" - from passbook.core.expression import PropertyMappingEvaluator + from authentik.core.expression import PropertyMappingEvaluator evaluator = PropertyMappingEvaluator() evaluator.set_context(user, request, **kwargs) diff --git a/passbook/core/signals.py b/authentik/core/signals.py similarity index 78% rename from passbook/core/signals.py rename to authentik/core/signals.py index d6c9446f52..ef493518fb 100644 --- a/passbook/core/signals.py +++ b/authentik/core/signals.py @@ -1,4 +1,4 @@ -"""passbook core signals""" +"""authentik core signals""" from django.core.signals import Signal # Arguments: user: User, password: str diff --git a/passbook/core/tasks.py b/authentik/core/tasks.py similarity index 90% rename from passbook/core/tasks.py rename to authentik/core/tasks.py index 34aa6fb5c6..d7c5fa0911 100644 --- a/passbook/core/tasks.py +++ b/authentik/core/tasks.py @@ -1,4 +1,4 @@ -"""passbook core tasks""" +"""authentik core tasks""" from datetime import datetime from io import StringIO @@ -10,9 +10,9 @@ from django.core import management from django.utils.timezone import now from structlog import get_logger -from passbook.core.models import ExpiringModel -from passbook.lib.tasks import MonitoredTask, TaskResult, TaskResultStatus -from passbook.root.celery import CELERY_APP +from authentik.core.models import ExpiringModel +from authentik.lib.tasks import MonitoredTask, TaskResult, TaskResultStatus +from authentik.root.celery import CELERY_APP LOGGER = get_logger() diff --git a/passbook/core/templates/403_csrf.html b/authentik/core/templates/403_csrf.html similarity index 95% rename from passbook/core/templates/403_csrf.html rename to authentik/core/templates/403_csrf.html index 9fd0de3a97..518b8705cc 100644 --- a/passbook/core/templates/403_csrf.html +++ b/authentik/core/templates/403_csrf.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block card_title %} {{ title }} (403) diff --git a/passbook/core/templates/base/page.html b/authentik/core/templates/base/page.html similarity index 90% rename from passbook/core/templates/base/page.html rename to authentik/core/templates/base/page.html index dca47d93cb..90f9ed892a 100644 --- a/passbook/core/templates/base/page.html +++ b/authentik/core/templates/base/page.html @@ -3,7 +3,7 @@ {% load i18n %} {% block body %} - +
{% trans 'Skip to content' %} {% block page_content %} diff --git a/passbook/core/templates/base/skeleton.html b/authentik/core/templates/base/skeleton.html similarity index 79% rename from passbook/core/templates/base/skeleton.html rename to authentik/core/templates/base/skeleton.html index 1174d47561..d26ccd0cc0 100644 --- a/passbook/core/templates/base/skeleton.html +++ b/authentik/core/templates/base/skeleton.html @@ -1,6 +1,6 @@ {% load static %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} @@ -10,25 +10,25 @@ - {% block title %}{% trans title|default:config.passbook.branding.title %}{% endblock %} - - + {% block title %}{% trans title|default:config.authentik.branding.title %}{% endblock %} + + - + {% block head %} {% endblock %} - {% if 'passbook_impersonate_user' in request.session %} + {% if 'authentik_impersonate_user' in request.session %}
{% blocktrans with user=user %}You're currently impersonating {{ user }}.{% endblocktrans %} - {% trans 'Stop impersonation' %} + {% trans 'Stop impersonation' %}
diff --git a/passbook/core/templates/error/generic.html b/authentik/core/templates/error/generic.html similarity index 97% rename from passbook/core/templates/error/generic.html rename to authentik/core/templates/error/generic.html index b32f942ecc..095be61d7b 100644 --- a/passbook/core/templates/error/generic.html +++ b/authentik/core/templates/error/generic.html @@ -1,7 +1,7 @@ {% extends 'base/page.html' %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block body %}
diff --git a/passbook/core/templates/generic/autosubmit_form.html b/authentik/core/templates/generic/autosubmit_form.html similarity index 97% rename from passbook/core/templates/generic/autosubmit_form.html rename to authentik/core/templates/generic/autosubmit_form.html index 902930d4b9..b7254b437d 100644 --- a/passbook/core/templates/generic/autosubmit_form.html +++ b/authentik/core/templates/generic/autosubmit_form.html @@ -1,6 +1,6 @@ {% extends "login/base.html" %} -{% load passbook_utils %} +{% load authentik_utils %} {% load i18n %} {% block title %} diff --git a/passbook/core/templates/generic/autosubmit_form_full.html b/authentik/core/templates/generic/autosubmit_form_full.html similarity index 97% rename from passbook/core/templates/generic/autosubmit_form_full.html rename to authentik/core/templates/generic/autosubmit_form_full.html index 687e765654..e3b044b8a4 100644 --- a/passbook/core/templates/generic/autosubmit_form_full.html +++ b/authentik/core/templates/generic/autosubmit_form_full.html @@ -1,6 +1,6 @@ {% extends "login/base_full.html" %} -{% load passbook_utils %} +{% load authentik_utils %} {% load i18n %} {% block title %} diff --git a/passbook/core/templates/generic/delete.html b/authentik/core/templates/generic/delete.html similarity index 98% rename from passbook/core/templates/generic/delete.html rename to authentik/core/templates/generic/delete.html index 7f74699eae..594155be05 100644 --- a/passbook/core/templates/generic/delete.html +++ b/authentik/core/templates/generic/delete.html @@ -1,7 +1,7 @@ {% extends container_template|default:"administration/base.html" %} {% load i18n %} -{% load passbook_utils %} +{% load authentik_utils %} {% block content %}
diff --git a/passbook/core/templates/library.html b/authentik/core/templates/library.html similarity index 90% rename from passbook/core/templates/library.html rename to authentik/core/templates/library.html index a2f4d46a63..fa69e07a97 100644 --- a/passbook/core/templates/library.html +++ b/authentik/core/templates/library.html @@ -13,7 +13,7 @@ {% if applications %}
`; } diff --git a/web/src/pages/admin-overview/TopApplicationsTable.ts b/web/src/pages/admin-overview/TopApplicationsTable.ts index 2cf60e39b3..dc1f17dfa1 100644 --- a/web/src/pages/admin-overview/TopApplicationsTable.ts +++ b/web/src/pages/admin-overview/TopApplicationsTable.ts @@ -5,7 +5,7 @@ import { COMMON_STYLES } from "../../common/styles"; import "../../elements/Spinner"; -@customElement("pb-top-applications-table") +@customElement("ak-top-applications-table") export class TopApplicationsTable extends LitElement { @property({attribute: false}) @@ -43,7 +43,7 @@ export class TopApplicationsTable extends LitElement { - ${this.topN ? this.topN.map((e) => this.renderRow(e)) : html``} + ${this.topN ? this.topN.map((e) => this.renderRow(e)) : html``} `; } diff --git a/web/src/pages/applications/ApplicationListPage.ts b/web/src/pages/applications/ApplicationListPage.ts index 5e65819dfc..e8d190f97e 100644 --- a/web/src/pages/applications/ApplicationListPage.ts +++ b/web/src/pages/applications/ApplicationListPage.ts @@ -4,13 +4,13 @@ import { Application } from "../../api/application"; import { PBResponse } from "../../api/client"; import { TablePage } from "../../elements/table/TablePage"; -@customElement("pb-application-list") +@customElement("ak-application-list") export class ApplicationList extends TablePage { pageTitle(): string { return gettext("Applications"); } pageDescription(): string { - return gettext("External Applications which use passbook as Identity-Provider, utilizing protocols like OAuth2 and SAML."); + return gettext("External Applications which use authentik as Identity-Provider, utilizing protocols like OAuth2 and SAML."); } pageIcon(): string { return gettext("pf-icon pf-icon-applications"); @@ -34,18 +34,18 @@ export class ApplicationList extends TablePage { item.provider.toString(), item.provider.toString(), ` - - + + Edit - +
-
- - + + + Delete - +
-
+ `, ]; } diff --git a/web/src/pages/applications/ApplicationViewPage.ts b/web/src/pages/applications/ApplicationViewPage.ts index 1d24a99328..12e35095d6 100644 --- a/web/src/pages/applications/ApplicationViewPage.ts +++ b/web/src/pages/applications/ApplicationViewPage.ts @@ -9,7 +9,7 @@ import { Table } from "../../elements/table/Table"; import "../../elements/Tabs"; import "../../elements/AdminLoginsChart"; -@customElement("pb-bound-policies-list") +@customElement("ak-bound-policies-list") export class BoundPoliciesList extends Table { @property() target?: string; @@ -33,24 +33,24 @@ export class BoundPoliciesList extends Table { item.order.toString(), item.timeout.toString(), ` - - + + Edit - +
-
- - + + + Delete - +
-
+ `, ]; } } -@customElement("pb-application-view") +@customElement("ak-application-view") export class ApplicationViewPage extends LitElement { @property() set args(value: { [key: string]: string }) { @@ -88,8 +88,8 @@ export class ApplicationViewPage extends LitElement {

${this.application?.meta_publisher}

- -
+ +
-
+
- +
- `; + `; } } diff --git a/web/src/pages/generic/FlowShellCard.ts b/web/src/pages/generic/FlowShellCard.ts index 49e319bd85..79e789fba3 100644 --- a/web/src/pages/generic/FlowShellCard.ts +++ b/web/src/pages/generic/FlowShellCard.ts @@ -11,7 +11,7 @@ interface Response { body?: string; } -@customElement("pb-flow-shell-card") +@customElement("ak-flow-shell-card") export class FlowShellCard extends LitElement { @property() flowBodyUrl = ""; @@ -59,7 +59,7 @@ export class FlowShellCard extends LitElement { this.setFormSubmitHandlers(); break; default: - console.debug(`passbook/flows: unexpected data type ${data.type}`); + console.debug(`authentik/flows: unexpected data type ${data.type}`); break; } } @@ -84,13 +84,13 @@ export class FlowShellCard extends LitElement { const element = form.elements[index]; if (element.value === form.action) { console.debug( - "passbook/flows: Found Form action URL in form elements, not changing form action." + "authentik/flows: Found Form action URL in form elements, not changing form action." ); return false; } } form.action = this.flowBodyUrl; - console.debug(`passbook/flows: updated form.action ${this.flowBodyUrl}`); + console.debug(`authentik/flows: updated form.action ${this.flowBodyUrl}`); return true; } @@ -102,11 +102,11 @@ export class FlowShellCard extends LitElement { setFormSubmitHandlers(): void { this.querySelectorAll("form").forEach((form) => { - console.debug(`passbook/flows: Checking for autosubmit attribute ${form}`); + console.debug(`authentik/flows: Checking for autosubmit attribute ${form}`); this.checkAutosubmit(form); - console.debug(`passbook/flows: Setting action for form ${form}`); + console.debug(`authentik/flows: Setting action for form ${form}`); this.updateFormAction(form); - console.debug(`passbook/flows: Adding handler for form ${form}`); + console.debug(`authentik/flows: Adding handler for form ${form}`); form.addEventListener("submit", (e) => { e.preventDefault(); const formData = new FormData(form); @@ -125,14 +125,14 @@ export class FlowShellCard extends LitElement { this.errorMessage(e); }); }); - form.classList.add("pb-flow-wrapped"); + form.classList.add("ak-flow-wrapped"); }); } errorMessage(error: string): void { this.flowBody = ` diff --git a/website/static/img/brand_inverted.svg b/website/static/img/brand_inverted.svg deleted file mode 100644 index 86711c6bb5..0000000000 --- a/website/static/img/brand_inverted.svg +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/website/static/img/icon.png b/website/static/img/icon.png new file mode 100644 index 0000000000..ea83f744ad Binary files /dev/null and b/website/static/img/icon.png differ diff --git a/website/static/img/icon.svg b/website/static/img/icon.svg new file mode 100644 index 0000000000..46d3fd1dbe --- /dev/null +++ b/website/static/img/icon.svg @@ -0,0 +1 @@ + diff --git a/website/static/img/icon_left_brand.svg b/website/static/img/icon_left_brand.svg new file mode 100644 index 0000000000..00a6fea249 --- /dev/null +++ b/website/static/img/icon_left_brand.svg @@ -0,0 +1 @@ + diff --git a/website/static/img/icon_top_brand.svg b/website/static/img/icon_top_brand.svg new file mode 100644 index 0000000000..517eb179d2 --- /dev/null +++ b/website/static/img/icon_top_brand.svg @@ -0,0 +1 @@ + diff --git a/website/static/img/logo.png b/website/static/img/logo.png deleted file mode 100644 index 2735ab357d..0000000000 Binary files a/website/static/img/logo.png and /dev/null differ diff --git a/website/static/img/logo.svg b/website/static/img/logo.svg deleted file mode 100644 index 5209542003..0000000000 --- a/website/static/img/logo.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/website/static/img/screen_admin.png b/website/static/img/screen_admin.png index 61371cd25e..97d2cd9189 100644 Binary files a/website/static/img/screen_admin.png and b/website/static/img/screen_admin.png differ diff --git a/website/static/img/screen_apps.png b/website/static/img/screen_apps.png index 00d34c909b..562c4a4381 100644 Binary files a/website/static/img/screen_apps.png and b/website/static/img/screen_apps.png differ