Skip to content

web: Router tidy v1 - #13754

Closed
GirlBossRush wants to merge 1 commit into
mainfrom
router-tidy-v1
Closed

GirlBossRush wants to merge 1 commit into
mainfrom
router-tidy-v1

Conversation

@GirlBossRush

Copy link
Copy Markdown
Contributor

Details

This PR preps the client-side router for hash-less routes, partially getting our parameter logic into a more compatible format. This PR also...

  • Prepares the router for packaging.
  • Moves route related logic into the router package.
  • Fixes a UI issue where the sidebar does not scroll the current route into view after accordion expansion.

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@GirlBossRush GirlBossRush added the enhancement New feature or request label Apr 3, 2025
@GirlBossRush GirlBossRush self-assigned this Apr 3, 2025
@GirlBossRush
GirlBossRush requested a review from a team as a code owner April 3, 2025 04:20
@netlify

netlify Bot commented Apr 3, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 01ff1e1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/688271858828bf0008acdd47
😎 Deploy Preview https://deploy-preview-13754--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Apr 3, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit 01ff1e1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6882718547b2f4000734441b

@codecov

codecov Bot commented Apr 3, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.24%. Comparing base (4a933b8) to head (01ff1e1).
⚠️ Report is 3269 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13754      +/-   ##
==========================================
- Coverage   92.97%   92.24%   -0.74%     
==========================================
  Files         831      831              
  Lines       44226    44226              
==========================================
- Hits        41119    40795     -324     
- Misses       3107     3431     +324     
Flag Coverage Δ
e2e ?
integration 23.46% <ø> (+<0.01%) ⬆️
unit 91.28% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@netlify

netlify Bot commented Jul 24, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations canceled.

Name Link
🔨 Latest commit 01ff1e1
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6882718519e7cc000810dda5

Comment thread web/src/elements/router/utils.ts Outdated
if (!match) continue;

console.debug(
`authentik/router: matched route ${route.pattern} to ${pathname} with params`,

Check failure

Code scanning / CodeQL

Use of externally-controlled format string

Format string depends on a [user-provided value](1). Format string depends on a [user-provided value](2). Format string depends on a [user-provided value](3).
@BeryJu BeryJu changed the title Router tidy v1 web: Router tidy v1 Jul 24, 2025
render(): TemplateResult {
return this.route.render(this.arguments);
console.debug(
`authentik/router: matched route ${route.pattern} to ${pathname} with params`,

Check failure

Code scanning / CodeQL

Use of externally-controlled format string

Format string depends on a [user-provided value](1). Format string depends on a [user-provided value](2). Format string depends on a [user-provided value](3).

Copilot Autofix

AI over 1 year ago

To fix the issue, we will ensure that the untrusted pathname value is not directly interpolated into the format string. Instead, we will use a %s specifier in the format string and pass the pathname as a separate argument. This approach ensures that the pathname is treated as a string and prevents any unintended format specifiers from being processed.

The changes will be made in the matchRoute function in RouteMatch.ts. Specifically, the console.debug statement on line 30 will be updated to use a safe format string.


Suggested changeset 1
web/src/elements/router/RouteMatch.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/web/src/elements/router/RouteMatch.ts b/web/src/elements/router/RouteMatch.ts
--- a/web/src/elements/router/RouteMatch.ts
+++ b/web/src/elements/router/RouteMatch.ts
@@ -29,3 +29,5 @@
         console.debug(
-            `authentik/router: matched route ${route.pattern} to ${pathname} with params`,
+            "authentik/router: matched route %s to %s with params",
+            route.pattern,
+            pathname,
             match.pathname.groups,
EOF
@@ -29,3 +29,5 @@
console.debug(
`authentik/router: matched route ${route.pattern} to ${pathname} with params`,
"authentik/router: matched route %s to %s with params",
route.pattern,
pathname,
match.pathname.groups,
Copilot is powered by AI and may make mistakes. Always verify output.
@BeryJu BeryJu mentioned this pull request Jul 25, 2025
6 tasks
@BeryJu BeryJu closed this Oct 14, 2026
@BeryJu
BeryJu deleted the router-tidy-v1 branch October 14, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants