-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add scatter-plot timeline view for config changes #2909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ab4d394
feat: add scatter-plot timeline view for config changes
moshloop 38de39d
feat(auth): add basic authentication system with login and session ha…
moshloop 1b6d0b4
fix(toast): use getErrorMessage for proper API error extraction
moshloop 73baeed
fix(plugins): pass user ID instead of object and show inline errors
moshloop 32164d7
fix(artifacts): render images natively and add filename to downloads
moshloop d7e3e90
fix(tests): lazy-load ConfigChangesGraph to fix reaviz module resolution
moshloop 2f980d7
fix(auth): add timeout and error handling to login endpoint
moshloop 8367840
feat(ui): add graph view toggle for config changes
moshloop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { NextResponse } from "next/server"; | ||
| import type { NextRequest } from "next/server"; | ||
|
|
||
| const publicPaths = ["/login", "/api/", "/registration"]; | ||
|
|
||
| function isPublicPath(pathname: string): boolean { | ||
| return publicPaths.some((p) => pathname.startsWith(p)); | ||
| } | ||
|
|
||
| export default function basicMiddleware(request: NextRequest) { | ||
| const { pathname } = request.nextUrl; | ||
|
|
||
| if (isPublicPath(pathname)) { | ||
| return NextResponse.next(); | ||
| } | ||
|
|
||
| const token = request.nextUrl.searchParams.get("token"); | ||
| if (token) { | ||
| return NextResponse.next(); | ||
| } | ||
|
Comment on lines
+17
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unvalidated On Line 17–20, any non-empty 🔐 Suggested hardening- const token = request.nextUrl.searchParams.get("token");
- if (token) {
- return NextResponse.next();
- }
+ // Do not bypass auth solely on token presence.
+ // If token-based login is required, validate token cryptographically here
+ // and only for explicit callback routes.🤖 Prompt for AI Agents |
||
|
|
||
| const hasSession = | ||
| request.cookies.has("ory_kratos_session") || | ||
| request.cookies.has("authorization"); | ||
|
|
||
| if (!hasSession) { | ||
| const returnTo = encodeURIComponent(request.url); | ||
| return NextResponse.redirect( | ||
| new URL(`/login?return_to=${returnTo}`, request.url) | ||
| ); | ||
| } | ||
|
|
||
| return NextResponse.next(); | ||
| } | ||
|
|
||
| export const config = { | ||
| matcher: ["/((?!.*\\..*|_next).*)"] | ||
| }; | ||
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public-path matching is overly broad.
On Line 7,
startsWith("/login")andstartsWith("/registration")also match paths like/login-anything, which can unintentionally expand unauthenticated surface area.✅ Safer matcher
function isPublicPath(pathname: string): boolean { - return publicPaths.some((p) => pathname.startsWith(p)); + return ( + pathname === "/login" || + pathname === "/registration" || + pathname.startsWith("/api/") + ); }📝 Committable suggestion
🤖 Prompt for AI Agents