Merge branch 'main' into multi-tenant-django-tenants

This commit is contained in:
Marc 'risson' Schmitt 2024-01-12 18:23:15 +01:00
commit 076efa6597
No known key found for this signature in database
GPG key ID: 9C3FA22FABF1AA8D
15 changed files with 162 additions and 158 deletions

View file

@ -4,7 +4,7 @@ description: "Setup authentik testing environment"
inputs:
postgresql_version:
description: "Optional postgresql image tag"
default: "12"
default: "16"
runs:
using: "composite"
@ -18,7 +18,7 @@ runs:
- name: Setup python and restore poetry
uses: actions/setup-python@v4
with:
python-version-file: 'pyproject.toml'
python-version-file: "pyproject.toml"
cache: "poetry"
- name: Setup node
uses: actions/setup-node@v3

View file

@ -2,7 +2,7 @@ version: "3.7"
services:
postgresql:
image: docker.io/library/postgres:${PSQL_TAG:-12}
image: docker.io/library/postgres:${PSQL_TAG:-16}
volumes:
- db-data:/var/lib/postgresql/data
environment:

View file

@ -24,7 +24,7 @@ class SourceTypeSerializer(PassiveSerializer):
"""Serializer for SourceType"""
name = CharField(required=True)
slug = CharField(required=True)
verbose_name = CharField(required=True)
urls_customizable = BooleanField()
request_token_url = CharField(read_only=True, allow_null=True)
authorization_url = CharField(read_only=True, allow_null=True)

View file

@ -1,13 +1,14 @@
"""OAuth Source tests"""
from django.test import TestCase
from django.urls import reverse
from requests_mock import Mocker
from rest_framework.test import APITestCase
from authentik.core.tests.utils import create_test_admin_user
from authentik.sources.oauth.api.source import OAuthSourceSerializer
from authentik.sources.oauth.models import OAuthSource
class TestOAuthSource(TestCase):
class TestOAuthSource(APITestCase):
"""OAuth Source tests"""
def setUp(self):
@ -20,6 +21,19 @@ class TestOAuthSource(TestCase):
consumer_key="",
)
def test_api_read(self):
"""Test reading a source"""
self.client.force_login(create_test_admin_user())
response = self.client.get(
reverse(
"authentik_api:oauthsource-detail",
kwargs={
"slug": self.source.slug,
},
)
)
self.assertEqual(response.status_code, 200)
def test_api_validate(self):
"""Test API validation"""
self.assertTrue(

View file

@ -50,7 +50,7 @@ class AzureADType(SourceType):
authorization_url = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"
access_token_url = "https://login.microsoftonline.com/common/oauth2/v2.0/token" # nosec
profile_url = "https://login.microsoftonline.com/common/openid/userinfo"
profile_url = "https://graph.microsoft.com/v1.0/me"
oidc_well_known_url = (
"https://login.microsoftonline.com/common/.well-known/openid-configuration"
)

View file

@ -1,4 +1,5 @@
"""Validation stage challenge checking"""
from json import loads
from typing import Optional
from urllib.parse import urlencode
@ -10,11 +11,12 @@ from django.utils.translation import gettext_lazy as _
from rest_framework.fields import CharField
from rest_framework.serializers import ValidationError
from structlog.stdlib import get_logger
from webauthn import options_to_json
from webauthn.authentication.generate_authentication_options import generate_authentication_options
from webauthn.authentication.verify_authentication_response import verify_authentication_response
from webauthn.helpers.base64url_to_bytes import base64url_to_bytes
from webauthn.helpers.exceptions import InvalidAuthenticationResponse
from webauthn.helpers.structs import AuthenticationCredential
from webauthn.helpers.structs import UserVerificationRequirement
from authentik.core.api.utils import JSONDictField, PassiveSerializer
from authentik.core.models import Application, User
@ -66,12 +68,7 @@ def get_webauthn_challenge_without_user(
)
request.session[SESSION_KEY_WEBAUTHN_CHALLENGE] = authentication_options.challenge
return authentication_options.model_dump(
mode="json",
by_alias=True,
exclude_unset=False,
exclude_none=True,
)
return loads(options_to_json(authentication_options))
def get_webauthn_challenge(
@ -91,17 +88,12 @@ def get_webauthn_challenge(
authentication_options = generate_authentication_options(
rp_id=get_rp_id(request),
allow_credentials=allowed_credentials,
user_verification=stage.webauthn_user_verification,
user_verification=UserVerificationRequirement(stage.webauthn_user_verification),
)
request.session[SESSION_KEY_WEBAUTHN_CHALLENGE] = authentication_options.challenge
return authentication_options.model_dump(
mode="json",
by_alias=True,
exclude_unset=False,
exclude_none=True,
)
return loads(options_to_json(authentication_options))
def select_challenge(request: HttpRequest, device: Device):
@ -152,7 +144,7 @@ def validate_challenge_webauthn(data: dict, stage_view: StageView, user: User) -
try:
authentication_verification = verify_authentication_response(
credential=AuthenticationCredential.model_validate(data),
credential=data,
expected_challenge=challenge,
expected_rp_id=get_rp_id(request),
expected_origin=get_origin(request),

View file

@ -1,14 +1,18 @@
"""WebAuthn stage"""
from json import loads
from django.http import HttpRequest, HttpResponse
from django.http.request import QueryDict
from rest_framework.fields import CharField
from rest_framework.serializers import ValidationError
from webauthn import options_to_json
from webauthn.helpers.bytes_to_base64url import bytes_to_base64url
from webauthn.helpers.exceptions import InvalidRegistrationResponse
from webauthn.helpers.structs import (
AuthenticatorSelectionCriteria,
PublicKeyCredentialCreationOptions,
RegistrationCredential,
ResidentKeyRequirement,
UserVerificationRequirement,
)
from webauthn.registration.generate_registration_options import generate_registration_options
from webauthn.registration.verify_registration_response import (
@ -53,7 +57,7 @@ class AuthenticatorWebAuthnChallengeResponse(ChallengeResponse):
try:
registration: VerifiedRegistration = verify_registration_response(
credential=RegistrationCredential.model_validate(response),
credential=response,
expected_challenge=challenge,
expected_rp_id=get_rp_id(self.request),
expected_origin=get_origin(self.request),
@ -91,12 +95,12 @@ class AuthenticatorWebAuthnStageView(ChallengeStageView):
registration_options: PublicKeyCredentialCreationOptions = generate_registration_options(
rp_id=get_rp_id(self.request),
rp_name=self.request.brand.branding_title,
user_id=user.uid,
user_id=user.uid.encode("utf-8"),
user_name=user.username,
user_display_name=user.name,
authenticator_selection=AuthenticatorSelectionCriteria(
resident_key=str(stage.resident_key_requirement),
user_verification=str(stage.user_verification),
resident_key=ResidentKeyRequirement(str(stage.resident_key_requirement)),
user_verification=UserVerificationRequirement(str(stage.user_verification)),
authenticator_attachment=authenticator_attachment,
),
)
@ -106,12 +110,7 @@ class AuthenticatorWebAuthnStageView(ChallengeStageView):
return AuthenticatorWebAuthnChallenge(
data={
"type": ChallengeTypes.NATIVE.value,
"registration": registration_options.model_dump(
mode="json",
by_alias=True,
exclude_unset=False,
exclude_none=True,
),
"registration": loads(options_to_json(registration_options)),
}
)

53
poetry.lock generated
View file

@ -1824,13 +1824,13 @@ colors = ["colorama (>=0.4.6)"]
[[package]]
name = "jinja2"
version = "3.1.2"
version = "3.1.3"
description = "A very fast and expressive template engine."
optional = false
python-versions = ">=3.7"
files = [
{file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
{file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"},
{file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"},
{file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"},
]
[package.dependencies]
@ -3657,28 +3657,28 @@ pyasn1 = ">=0.1.3"
[[package]]
name = "ruff"
version = "0.1.11"
version = "0.1.12"
description = "An extremely fast Python linter and code formatter, written in Rust."
optional = false
python-versions = ">=3.7"
files = [
{file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:a7f772696b4cdc0a3b2e527fc3c7ccc41cdcb98f5c80fdd4f2b8c50eb1458196"},
{file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:934832f6ed9b34a7d5feea58972635c2039c7a3b434fe5ba2ce015064cb6e955"},
{file = "ruff-0.1.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9"},
{file = "ruff-0.1.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9bd4025b9c5b429a48280785a2b71d479798a69f5c2919e7d274c5f4b32c3607"},
{file = "ruff-0.1.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1ad00662305dcb1e987f5ec214d31f7d6a062cae3e74c1cbccef15afd96611d"},
{file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:4b077ce83f47dd6bea1991af08b140e8b8339f0ba8cb9b7a484c30ebab18a23f"},
{file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4a88efecec23c37b11076fe676e15c6cdb1271a38f2b415e381e87fe4517f18"},
{file = "ruff-0.1.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5b25093dad3b055667730a9b491129c42d45e11cdb7043b702e97125bcec48a1"},
{file = "ruff-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:231d8fb11b2cc7c0366a326a66dafc6ad449d7fcdbc268497ee47e1334f66f77"},
{file = "ruff-0.1.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:09c415716884950080921dd6237767e52e227e397e2008e2bed410117679975b"},
{file = "ruff-0.1.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0f58948c6d212a6b8d41cd59e349751018797ce1727f961c2fa755ad6208ba45"},
{file = "ruff-0.1.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:190a566c8f766c37074d99640cd9ca3da11d8deae2deae7c9505e68a4a30f740"},
{file = "ruff-0.1.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6464289bd67b2344d2a5d9158d5eb81025258f169e69a46b741b396ffb0cda95"},
{file = "ruff-0.1.11-py3-none-win32.whl", hash = "sha256:9b8f397902f92bc2e70fb6bebfa2139008dc72ae5177e66c383fa5426cb0bf2c"},
{file = "ruff-0.1.11-py3-none-win_amd64.whl", hash = "sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a"},
{file = "ruff-0.1.11-py3-none-win_arm64.whl", hash = "sha256:97ce4d752f964ba559c7023a86e5f8e97f026d511e48013987623915431c7ea9"},
{file = "ruff-0.1.11.tar.gz", hash = "sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb"},
{file = "ruff-0.1.12-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:544038693543c11edc56bb94a9875df2dc249e3616f90c15964c720dcccf0745"},
{file = "ruff-0.1.12-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8a0e3ef6299c4eab75a7740730e4b4bd4a36e0bd8102ded01553403cad088fd4"},
{file = "ruff-0.1.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47f6d939461e3273f10f4cd059fd0b83c249d73f1736032fffbac83a62939395"},
{file = "ruff-0.1.12-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25be18abc1fc3f3d3fb55855c41ed5d52063316defde202f413493bb3888218c"},
{file = "ruff-0.1.12-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d41e9f100b50526d80b076fc9c103c729387ff3f10f63606ed1038c30a372a40"},
{file = "ruff-0.1.12-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:472a0548738d4711549c7874b43fab61aacafb1fede29c5232d4cfb8e2d13f69"},
{file = "ruff-0.1.12-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46685ef2f106b827705df876d38617741ed4f858bbdbc0817f94476c45ab6669"},
{file = "ruff-0.1.12-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cf6073749c70b616d7929897b14824ec6713a6c3a8195dfd2ffdcc66594d880c"},
{file = "ruff-0.1.12-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4bdf26e5a2efab4c3aaf6b61648ea47a525dc12775810a85c285dc9ca03e5ac0"},
{file = "ruff-0.1.12-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b631c6a95e4b6d5c4299e599067b5a89f5b18e2f2d9a6c22b879b3c4b077c96e"},
{file = "ruff-0.1.12-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f193f460e231e63af5fc7516897cf5ab257cbda72ae83cf9a654f1c80c3b758a"},
{file = "ruff-0.1.12-py3-none-musllinux_1_2_i686.whl", hash = "sha256:718523c3a0b787590511f212d30cc9b194228ef369c8bdd72acd1282cc27c468"},
{file = "ruff-0.1.12-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1c49e826de55d81a6ef93808b760925e492bad7cc470aaa114a3be158b2c7f99"},
{file = "ruff-0.1.12-py3-none-win32.whl", hash = "sha256:fbb1c002eeacb60161e51d77b2274c968656599477a1c8c65066953276e8ee2b"},
{file = "ruff-0.1.12-py3-none-win_amd64.whl", hash = "sha256:7fe06ba77e5b7b78db1d058478c47176810f69bb5be7c1b0d06876af59198203"},
{file = "ruff-0.1.12-py3-none-win_arm64.whl", hash = "sha256:bb29f8e3e6c95024902eaec5a9ce1fd5ac4e77f4594f4554e67fbb0f6d9a2f37"},
{file = "ruff-0.1.12.tar.gz", hash = "sha256:97189f38c655e573f6bea0d12e9f18aad5539fd08ab50651449450999f45383a"},
]
[[package]]
@ -4383,21 +4383,20 @@ files = [
[[package]]
name = "webauthn"
version = "1.11.1"
version = "2.0.0"
description = "Pythonic WebAuthn"
optional = false
python-versions = "*"
files = [
{file = "webauthn-1.11.1-py3-none-any.whl", hash = "sha256:13592ee71489b571cb6e4a5d8b3c34f7b040cd3539a9d94b6b7d23fa88df5dfb"},
{file = "webauthn-1.11.1.tar.gz", hash = "sha256:24eda57903897369797f52a377f8c470e7057e79da5525779d0720a9fcc11926"},
{file = "webauthn-2.0.0-py3-none-any.whl", hash = "sha256:644dc68af5caaade06be6a2a2278775e85116e92dd755ad7a49d992d51c82033"},
{file = "webauthn-2.0.0.tar.gz", hash = "sha256:12cc1759da98668b8242badc37c4129df300f89d89f5c183fac80e7b33c41dfd"},
]
[package.dependencies]
asn1crypto = ">=1.4.0"
cbor2 = ">=5.4.6"
cryptography = ">=41.0.4"
pydantic = ">=1.10.11"
pyOpenSSL = ">=23.2.0"
cryptography = ">=41.0.7"
pyOpenSSL = ">=23.3.0"
[[package]]
name = "websocket-client"

View file

@ -43241,7 +43241,7 @@ components:
properties:
name:
type: string
slug:
verbose_name:
type: string
urls_customizable:
type: boolean
@ -43277,8 +43277,8 @@ components:
- oidc_well_known_url
- profile_url
- request_token_url
- slug
- urls_customizable
- verbose_name
SpBindingEnum:
enum:
- redirect

View file

@ -3,7 +3,7 @@ version: "3.7"
services:
postgresql:
container_name: postgres
image: docker.io/library/postgres:12
image: docker.io/library/postgres:16
volumes:
- db-data:/var/lib/postgresql/data
environment:

View file

@ -9,10 +9,10 @@
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@wdio/cli": "^8.27.1",
"@wdio/local-runner": "^8.27.0",
"@wdio/mocha-framework": "^8.27.0",
"@wdio/spec-reporter": "^8.27.0",
"@wdio/cli": "^8.27.2",
"@wdio/local-runner": "^8.27.2",
"@wdio/mocha-framework": "^8.27.2",
"@wdio/spec-reporter": "^8.27.2",
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-sonarjs": "^0.23.0",
@ -1166,18 +1166,18 @@
"dev": true
},
"node_modules/@wdio/cli": {
"version": "8.27.1",
"resolved": "https://registry.npmjs.org/@wdio/cli/-/cli-8.27.1.tgz",
"integrity": "sha512-RY9o4h0iN6UGpU31X5c9mu/TK2FlHtKtDaRJYunm5ycZvGahQcN+naYpea1ftDr4IpI2gGGlHxvEeHkJF7urDQ==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/cli/-/cli-8.27.2.tgz",
"integrity": "sha512-gRbwqjjczReWqLFZQX9iwTsCwGPFavJwL7iKSoIeAS645sM9PMmPW7mHzawmkFxqDDAyBWO3qFn4KV2H/2YfdA==",
"dev": true,
"dependencies": {
"@types/node": "^20.1.1",
"@wdio/config": "8.27.0",
"@wdio/globals": "8.27.0",
"@wdio/config": "8.27.2",
"@wdio/globals": "8.27.2",
"@wdio/logger": "8.24.12",
"@wdio/protocols": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/utils": "8.27.0",
"@wdio/types": "8.27.2",
"@wdio/utils": "8.27.2",
"async-exit-hook": "^2.0.1",
"chalk": "^5.2.0",
"chokidar": "^3.5.3",
@ -1192,7 +1192,7 @@
"lodash.union": "^4.6.0",
"read-pkg-up": "^10.0.0",
"recursive-readdir": "^2.2.3",
"webdriverio": "8.27.0",
"webdriverio": "8.27.2",
"yargs": "^17.7.2"
},
"bin": {
@ -1215,14 +1215,14 @@
}
},
"node_modules/@wdio/config": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/config/-/config-8.27.0.tgz",
"integrity": "sha512-zYM5daeiBVVAbQj0ASymAt0RUsocLVIwKiUHNa8gg/1GsZnztGjetXExSp1gXlxtMVM5xWUSKjh6ceFK79gWDQ==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/config/-/config-8.27.2.tgz",
"integrity": "sha512-qR1r7K7/jsQhi9g5NiW40lgbvbzCcwwk8nz07hzTj6m8fQ8TXkQPob2fnrlDaNrXjzbZC4od0uv0a5fimK9YOQ==",
"dev": true,
"dependencies": {
"@wdio/logger": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/utils": "8.27.0",
"@wdio/types": "8.27.2",
"@wdio/utils": "8.27.2",
"decamelize": "^6.0.0",
"deepmerge-ts": "^5.0.0",
"glob": "^10.2.2",
@ -1233,29 +1233,29 @@
}
},
"node_modules/@wdio/globals": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/globals/-/globals-8.27.0.tgz",
"integrity": "sha512-HUPOIsrmxfF0LhU68lVsNGQGZkW/bWOvcCd8WxeaggTAH9JyxasxxfwzeCceAuhAvwtlwoMXITOpjAXO2mj38Q==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/globals/-/globals-8.27.2.tgz",
"integrity": "sha512-kU9fsOD1HVSROgN0TkjH8+O2SWbd5hHzL952+YOifMHFtt05Ua/n5mqxTTVAWmxUMMCz6VOuySmBt2Dhd4NnKA==",
"dev": true,
"engines": {
"node": "^16.13 || >=18"
},
"optionalDependencies": {
"expect-webdriverio": "^4.6.1",
"webdriverio": "8.27.0"
"expect-webdriverio": "^4.8.0",
"webdriverio": "8.27.2"
}
},
"node_modules/@wdio/local-runner": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/local-runner/-/local-runner-8.27.0.tgz",
"integrity": "sha512-nxS17mhoLkXP20eoPMkz7tbMFMOQejSw0hZfkEvuDCNhJokr8ugp6IjYXL9f7yV9IB9UDGHox8WGY4ArSrOeBA==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/local-runner/-/local-runner-8.27.2.tgz",
"integrity": "sha512-7m0vEulOyriMPB1+559ioEdjXlLu7yseM3KfQapCdLqaqTWvURJlMSxiHZZwuHaVGKa6YBPNB7NhRcHoUsqsAg==",
"dev": true,
"dependencies": {
"@types/node": "^20.1.0",
"@wdio/logger": "8.24.12",
"@wdio/repl": "8.24.12",
"@wdio/runner": "8.27.0",
"@wdio/types": "8.27.0",
"@wdio/runner": "8.27.2",
"@wdio/types": "8.27.2",
"async-exit-hook": "^2.0.1",
"split2": "^4.1.0",
"stream-buffers": "^3.0.2"
@ -1292,16 +1292,16 @@
}
},
"node_modules/@wdio/mocha-framework": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/mocha-framework/-/mocha-framework-8.27.0.tgz",
"integrity": "sha512-NaFUPv90ks1XlZy0qdUaJ5/ilBtiCCgTIxaPexshJiaVDT5cV+Igjag/O80HIcvqknOZpdKAR0I1ArQzhJrmcA==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/mocha-framework/-/mocha-framework-8.27.2.tgz",
"integrity": "sha512-R0PRW5X8VDJzpHPhtOGkcPFrcetDOYz9q//4uqvdtdKtngrp4goz2cVNEmnbXJDMUm5VHSYy2GW6YtsjWUxbkA==",
"dev": true,
"dependencies": {
"@types/mocha": "^10.0.0",
"@types/node": "^20.1.0",
"@wdio/logger": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/utils": "8.27.0",
"@wdio/types": "8.27.2",
"@wdio/utils": "8.27.2",
"mocha": "^10.0.0"
},
"engines": {
@ -1327,14 +1327,14 @@
}
},
"node_modules/@wdio/reporter": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/reporter/-/reporter-8.27.0.tgz",
"integrity": "sha512-kBwsrHbsblmXfHSWlaOKXjPRPeT29WSKTUoCmzuTcCkhvbjY4TrEB0p04cpaM7uNqdIZTxHng54gZVaG/nZPiw==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/reporter/-/reporter-8.27.2.tgz",
"integrity": "sha512-vMhoTVsowDmk6EXYgJ4nFBd6vvMFLIO3zUL4w/DCCkPDyjS9/6ggs/wpVSlrKxw9qisAph1Z4W9ngtNuhQQuwg==",
"dev": true,
"dependencies": {
"@types/node": "^20.1.0",
"@wdio/logger": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/types": "8.27.2",
"diff": "^5.0.0",
"object-inspect": "^1.12.0"
},
@ -1343,35 +1343,35 @@
}
},
"node_modules/@wdio/runner": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/runner/-/runner-8.27.0.tgz",
"integrity": "sha512-da332r2d1QXdRhMhsDxMObcqLZS0l/u14pHICNTvEHp+72gOttbjUDvdMHPQY6Ae5ul7AVVQ05qpmz9CX7TzOg==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/runner/-/runner-8.27.2.tgz",
"integrity": "sha512-a72dJ+7ap0DOrkrjx1ofYHzgDYzK0I7RjSGOEvi2cc+SwnwESHnwtPug5F3NfDFEMXV3Y3pN+E/yz81S27WpvQ==",
"dev": true,
"dependencies": {
"@types/node": "^20.1.0",
"@wdio/config": "8.27.0",
"@wdio/globals": "8.27.0",
"@wdio/config": "8.27.2",
"@wdio/globals": "8.27.2",
"@wdio/logger": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/utils": "8.27.0",
"@wdio/types": "8.27.2",
"@wdio/utils": "8.27.2",
"deepmerge-ts": "^5.0.0",
"expect-webdriverio": "^4.6.1",
"expect-webdriverio": "^4.8.0",
"gaze": "^1.1.2",
"webdriver": "8.27.0",
"webdriverio": "8.27.0"
"webdriver": "8.27.2",
"webdriverio": "8.27.2"
},
"engines": {
"node": "^16.13 || >=18"
}
},
"node_modules/@wdio/spec-reporter": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/spec-reporter/-/spec-reporter-8.27.0.tgz",
"integrity": "sha512-EOXLBIr4oLzSDp/BQ86IqCulSF0jwEAj2EiMeY6dh9WXzBBtoR8WnoX/27xFoZ8GU2zetWC3EVnLJ0Ex8Up1mA==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/spec-reporter/-/spec-reporter-8.27.2.tgz",
"integrity": "sha512-2U1MALAHjUqDo3C+PYinN1wAnDBiy+kLG3GrTpMeIWZ2qZ6m1fRWt9GlADX7r07vhiRqShxy131nUenqeoF/qg==",
"dev": true,
"dependencies": {
"@wdio/reporter": "8.27.0",
"@wdio/types": "8.27.0",
"@wdio/reporter": "8.27.2",
"@wdio/types": "8.27.2",
"chalk": "^5.1.2",
"easy-table": "^1.2.0",
"pretty-ms": "^7.0.0"
@ -1393,9 +1393,9 @@
}
},
"node_modules/@wdio/types": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/types/-/types-8.27.0.tgz",
"integrity": "sha512-LbP9FKh8r0uW9/dKhTIUCC1Su8PsP9TmzGKXkWt6/IMacgJiB/zW3u1CgyaLw9lG0UiQORHGoeJX9zB2HZAh4w==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/types/-/types-8.27.2.tgz",
"integrity": "sha512-z/TtSQysEtAUNh+DooOs22G7xotTsJC2RcIZKaVtHY4Gl6lF+tn8kLRXD79jem2ta1byB1TpW62K366k1vzcLw==",
"dev": true,
"dependencies": {
"@types/node": "^20.1.0"
@ -1405,14 +1405,14 @@
}
},
"node_modules/@wdio/utils": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-8.27.0.tgz",
"integrity": "sha512-4BY+JBQssVn003P5lA289uDMie3LtGinHze5btkcW9timB6VaU+EeZS4eKTPC0pziizLhteVvXYxv3YTpeeRfA==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-8.27.2.tgz",
"integrity": "sha512-jWxUhGjlZ4L3uOsP96oLKWjkITpoH/KPTtKzU7xdoVGhd1LXK4d/Fr8cTFTNkDBXM7yuM7C+EMmQ8HJHR55KTA==",
"dev": true,
"dependencies": {
"@puppeteer/browsers": "^1.6.0",
"@wdio/logger": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/types": "8.27.2",
"decamelize": "^6.0.0",
"deepmerge-ts": "^5.1.0",
"edgedriver": "^5.3.5",
@ -2481,9 +2481,9 @@
}
},
"node_modules/devtools-protocol": {
"version": "0.0.1237913",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1237913.tgz",
"integrity": "sha512-Pxtmz2ZIqBkpU82HaIdsvCQBG94yTC4xajrEsWx9p38QKEfBCJktSazsHkrjf9j3dVVNPhg5LR21F6KWeXpjiQ==",
"version": "0.0.1239539",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1239539.tgz",
"integrity": "sha512-uS7hZVqZxGyZwR8lX/8wWyNLGEYs1wWWxN7qeRC+wBZ4VM5JXYwCJg8hofEna5yX0W2cavpjHOE4ukHXLHlEaA==",
"dev": true
},
"node_modules/diff": {
@ -3182,9 +3182,9 @@
}
},
"node_modules/expect-webdriverio": {
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/expect-webdriverio/-/expect-webdriverio-4.6.1.tgz",
"integrity": "sha512-w6ee91kN3BoxNGVKQheAqFpRGMehdDg7kDiErEk/oM7tbd/WUT4R4v9KYOUtjiaUFHWWCRW2FtcOOjcd0+1pvQ==",
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/expect-webdriverio/-/expect-webdriverio-4.8.1.tgz",
"integrity": "sha512-JD5aboj/tCiMXdEPCpt3BA0xL3DBhNu1MoiOdBGT9LT+9COIXoDG6Ks6h5S4c4PNwLs6xSeU8s7XxFAmBPu45Q==",
"dev": true,
"dependencies": {
"expect": "^29.7.0",
@ -3195,9 +3195,9 @@
"node": ">=16 || >=18 || >=20"
},
"optionalDependencies": {
"@wdio/globals": "^8.23.1",
"@wdio/logger": "^8.16.17",
"webdriverio": "^8.23.1"
"@wdio/globals": "^8.27.0",
"@wdio/logger": "^8.24.12",
"webdriverio": "^8.27.0"
}
},
"node_modules/external-editor": {
@ -8520,18 +8520,18 @@
}
},
"node_modules/webdriver": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/webdriver/-/webdriver-8.27.0.tgz",
"integrity": "sha512-n1IA+rR3u84XxU9swiKUM06BkEC0GDimfZkBML57cny+utQOUbdM/mBpqCUnkWX/RBz/p2EfHdKNyOs3/REaog==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/webdriver/-/webdriver-8.27.2.tgz",
"integrity": "sha512-vY2Lr0ZNr83n0v8PjLCXtJwR9E7QGycJVS+ev2G72gI54/rFwLv58HMSbJNn8CtE27VkhtewMUPlDpSkj5wGPQ==",
"dev": true,
"dependencies": {
"@types/node": "^20.1.0",
"@types/ws": "^8.5.3",
"@wdio/config": "8.27.0",
"@wdio/config": "8.27.2",
"@wdio/logger": "8.24.12",
"@wdio/protocols": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/utils": "8.27.0",
"@wdio/types": "8.27.2",
"@wdio/utils": "8.27.2",
"deepmerge-ts": "^5.1.0",
"got": "^12.6.1",
"ky": "^0.33.0",
@ -8542,23 +8542,23 @@
}
},
"node_modules/webdriverio": {
"version": "8.27.0",
"resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-8.27.0.tgz",
"integrity": "sha512-Qh5VCiBjEmxnmXcL1QEFoDzFqTtaWKrXriuU5G0yHKCModGAt2G7IHTkAok3CpmkVJfZpEvY630aP1MvgDtFhw==",
"version": "8.27.2",
"resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-8.27.2.tgz",
"integrity": "sha512-X6PhKE8e8XsB33Q/KSS1zYKP2Rqkq2Nef0YKOhQO+5OTlTkeqMCjnEtyRcfmdtfAwT0DEFqMnGnUKEbTajFC4Q==",
"dev": true,
"dependencies": {
"@types/node": "^20.1.0",
"@wdio/config": "8.27.0",
"@wdio/config": "8.27.2",
"@wdio/logger": "8.24.12",
"@wdio/protocols": "8.24.12",
"@wdio/repl": "8.24.12",
"@wdio/types": "8.27.0",
"@wdio/utils": "8.27.0",
"@wdio/types": "8.27.2",
"@wdio/utils": "8.27.2",
"archiver": "^6.0.0",
"aria-query": "^5.0.0",
"css-shorthand-properties": "^1.1.1",
"css-value": "^0.0.1",
"devtools-protocol": "^0.0.1237913",
"devtools-protocol": "^0.0.1239539",
"grapheme-splitter": "^1.0.2",
"import-meta-resolve": "^4.0.0",
"is-plain-obj": "^4.1.0",
@ -8570,7 +8570,7 @@
"resq": "^1.9.1",
"rgb2hex": "0.2.5",
"serialize-error": "^11.0.1",
"webdriver": "8.27.0"
"webdriver": "8.27.2"
},
"engines": {
"node": "^16.13 || >=18"

View file

@ -6,10 +6,10 @@
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@wdio/cli": "^8.27.1",
"@wdio/local-runner": "^8.27.0",
"@wdio/mocha-framework": "^8.27.0",
"@wdio/spec-reporter": "^8.27.0",
"@wdio/cli": "^8.27.2",
"@wdio/local-runner": "^8.27.2",
"@wdio/mocha-framework": "^8.27.2",
"@wdio/spec-reporter": "^8.27.2",
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-sonarjs": "^0.23.0",

8
web/package-lock.json generated
View file

@ -17,7 +17,7 @@
"@codemirror/theme-one-dark": "^6.1.2",
"@formatjs/intl-listformat": "^7.5.3",
"@fortawesome/fontawesome-free": "^6.5.1",
"@goauthentik/api": "^2023.10.6-1704825130",
"@goauthentik/api": "^2023.10.6-1705072854",
"@lit-labs/context": "^0.4.0",
"@lit-labs/task": "^3.1.0",
"@lit/localize": "^0.11.4",
@ -2913,9 +2913,9 @@
}
},
"node_modules/@goauthentik/api": {
"version": "2023.10.6-1704825130",
"resolved": "https://registry.npmjs.org/@goauthentik/api/-/api-2023.10.6-1704825130.tgz",
"integrity": "sha512-04fpXJJcAUx5uOPgqK6krqMwWk8XJUdXu5rZ8yEDB2E5IyFcmGZOQpqiR2EyYf2ty9dFYjkFDFVVTqcC0UGjKA=="
"version": "2023.10.6-1705072854",
"resolved": "https://registry.npmjs.org/@goauthentik/api/-/api-2023.10.6-1705072854.tgz",
"integrity": "sha512-6JD95OqARjlkOhI3pxHY2NYLambQ0vb8cQNH/7Vk+hGoO50VPufkpYK40JNJS7uLisrBsVJ+XhOC1J4Td1Xv8g=="
},
"node_modules/@hcaptcha/types": {
"version": "1.0.3",

View file

@ -42,7 +42,7 @@
"@codemirror/theme-one-dark": "^6.1.2",
"@formatjs/intl-listformat": "^7.5.3",
"@fortawesome/fontawesome-free": "^6.5.1",
"@goauthentik/api": "^2023.10.6-1704825130",
"@goauthentik/api": "^2023.10.6-1705072854",
"@lit-labs/context": "^0.4.0",
"@lit-labs/task": "^3.1.0",
"@lit/localize": "^0.11.4",
@ -93,8 +93,8 @@
"@storybook/api": "^7.6.7",
"@storybook/blocks": "^7.6.4",
"@storybook/manager-api": "^7.6.7",
"@storybook/web-components-vite": "^7.6.7",
"@storybook/web-components": "^7.6.7",
"@storybook/web-components-vite": "^7.6.7",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/chart.js": "^2.9.41",
"@types/codemirror": "5.60.15",
@ -105,12 +105,12 @@
"babel-plugin-macros": "^3.1.0",
"babel-plugin-tsconfig-paths": "^1.0.3",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-custom-elements": "0.0.8",
"eslint-plugin-lit": "^1.11.0",
"eslint-plugin-sonarjs": "^0.23.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint": "^8.56.0",
"lit-analyzer": "^2.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",

View file

@ -64,7 +64,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
clearIcon = false;
async send(data: OAuthSource): Promise<OAuthSource> {
data.providerType = (this.providerType?.slug || "") as ProviderTypeEnum;
data.providerType = (this.providerType?.name || "") as ProviderTypeEnum;
let source: OAuthSource;
if (this.instance) {
source = await new SourcesApi(DEFAULT_CONFIG).sourcesOauthPartialUpdate({
@ -178,7 +178,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
</p>
</ak-form-element-horizontal> `
: html``}
${this.providerType.slug === ProviderTypeEnum.Openidconnect ||
${this.providerType.name === ProviderTypeEnum.Openidconnect ||
this.providerType.oidcWellKnownUrl !== ""
? html`<ak-form-element-horizontal
label=${msg("OIDC Well-known URL")}
@ -200,7 +200,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
</p>
</ak-form-element-horizontal>`
: html``}
${this.providerType.slug === ProviderTypeEnum.Openidconnect ||
${this.providerType.name === ProviderTypeEnum.Openidconnect ||
this.providerType.oidcJwksUrl !== ""
? html`<ak-form-element-horizontal
label=${msg("OIDC JWKS URL")}