From a6d0c8c26c609f8c31a548d3c07ff0bad8da3894 Mon Sep 17 00:00:00 2001 From: Jens L Date: Sun, 27 Dec 2020 22:38:04 +0100 Subject: [PATCH] providers/saml: Metadata Import (#432) * providers/saml: add basic metadata parser * providers/saml: add importer for Singing certificate, validate signature, add tests * providers/saml: add provider name to form, * web: don't use trailing slash for spa URLs * providers/saml: formatting fixes * sources/*: add verbose_name to source serializers * admin: add button launch import modal --- authentik/admin/forms/source.py | 2 + .../templates/administration/flow/list.html | 2 +- .../administration/provider/list.html | 11 ++ authentik/admin/urls.py | 6 + authentik/core/api/sources.py | 3 +- authentik/providers/saml/forms.py | 26 +++- .../saml/processors/metadata_parser.py | 143 ++++++++++++++++++ .../saml/templates/providers/saml/import.html | 13 ++ .../providers/saml/tests/test_metadata.py | 94 ++++++++++++ authentik/providers/saml/views.py | 33 ++++ authentik/sources/ldap/api.py | 3 +- authentik/sources/oauth/api.py | 3 +- authentik/sources/saml/api.py | 3 +- web/src/interfaces/AdminInterface.ts | 8 +- .../pages/applications/ApplicationListPage.ts | 2 +- web/src/routes.ts | 16 +- 16 files changed, 349 insertions(+), 19 deletions(-) create mode 100644 authentik/providers/saml/processors/metadata_parser.py create mode 100644 authentik/providers/saml/templates/providers/saml/import.html create mode 100644 authentik/providers/saml/tests/test_metadata.py diff --git a/authentik/admin/forms/source.py b/authentik/admin/forms/source.py index 5e5d04393..0a9b50065 100644 --- a/authentik/admin/forms/source.py +++ b/authentik/admin/forms/source.py @@ -14,4 +14,6 @@ SOURCE_SERIALIZER_FIELDS = [ "enabled", "authentication_flow", "enrollment_flow", + "verbose_name", + "verbose_name_plural", ] diff --git a/authentik/admin/templates/administration/flow/list.html b/authentik/admin/templates/administration/flow/list.html index 5bb2dfcd4..7711ceaae 100644 --- a/authentik/admin/templates/administration/flow/list.html +++ b/authentik/admin/templates/administration/flow/list.html @@ -53,7 +53,7 @@ {% for flow in object_list %} - +
{{ flow.slug }}
{{ flow.name }}
diff --git a/authentik/admin/templates/administration/provider/list.html b/authentik/admin/templates/administration/provider/list.html index 572dc7caf..80d07472e 100644 --- a/authentik/admin/templates/administration/provider/list.html +++ b/authentik/admin/templates/administration/provider/list.html @@ -41,6 +41,17 @@ {% endfor %} +
  • + + +
    +
    +