-
Notifications
You must be signed in to change notification settings - Fork 10
feat(context-navigation): add plugin package, dev portal integration, and plugin docs #4751
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9e9e90e
feat(context-navigation): add context navigation plugin package
Noggling ef5734b
feat(context): add routing strategy and navigation fixes
Noggling 31542ea
feat(dev-portal): integrate context navigation plugin
Noggling caecc2b
docs: add plugin documentation, migration guides, and changesets
Noggling 4674b4b
docs: improve context routing documentation and fix TSDoc accuracy
Noggling a7c5606
fix(changeset): correct context module changeset to reflect actual ch…
Noggling 9e427f5
fix(context-provider): suppress TypeScript errors for future signatur…
Noggling 088891e
fix(navigation): normalize basename to treat '/' as no-basename and f…
Noggling ed5b23e
fix(context-navigation): force replace:true on app switch and URL dri…
Noggling 33874b1
fix(navigation): prevent ReDoS vulnerability in pathname normalization
Noggling 84d14fc
fix(context-navigation): clear hash fragment on context changes
Noggling 2aa1c65
fix(navigation): eliminate remaining ReDoS vulnerability in trailing …
Noggling 54e06ee
fix(navigation): refactor pathname normalization functions to improve…
Noggling ec2f839
refactor: improve readability by adding braces to conditional stateme…
Noggling 477481f
chore: remove unnecessary blank line in handleReplaceModeGuard function
Noggling 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.changeset/fusion-framework-dev-portal_context-navigation-handler.md
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,7 @@ | ||
| --- | ||
| "@equinor/fusion-framework-dev-portal": patch | ||
| --- | ||
|
|
||
| Integrate `@equinor/fusion-framework-plugin-context-navigation` into the dev portal. | ||
|
|
||
| Portal context-to-URL reconciliation is now handled by `@equinor/fusion-framework-plugin-context-navigation`, replacing the ad-hoc hook-based approach. |
16 changes: 16 additions & 0 deletions
16
.changeset/fusion-framework-module-context_routing-strategy.md
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,16 @@ | ||
| --- | ||
| "@equinor/fusion-framework-module-context": patch | ||
| --- | ||
|
|
||
| Move URL-based initial context resolution to the context-navigation plugin. | ||
|
|
||
| The context module's `resolveInitialContext` no longer resolves context from the URL path — that responsibility has been moved to `@equinor/fusion-framework-plugin-context-navigation` at the portal level. This decouples URL concerns from the context module. | ||
|
|
||
| **Changes:** | ||
|
|
||
| - `resolveInitialContext` no longer accepts the `options` parameter with path resolution config. | ||
| - URL-based initial context resolution is now handled by the context-navigation plugin. | ||
| - Added `version` property to `IContextProvider` interface (non-breaking). | ||
| - Added explanatory `@ts-ignore` directives on compatibility assignments to avoid a breaking API signature change in this release. | ||
|
|
||
| **Migration:** Apps do not need to change their code. Portal hosts should enable the `@equinor/fusion-framework-plugin-context-navigation` plugin to restore URL-based context resolution behavior. |
9 changes: 9 additions & 0 deletions
9
.changeset/fusion-framework-module-navigation_trailing-slash-fix.md
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,9 @@ | ||
| --- | ||
| "@equinor/fusion-framework-module-navigation": patch | ||
| --- | ||
|
|
||
| Fix basename boundary matching and trailing-slash handling. | ||
|
|
||
| - `normalizePathname` no longer strips trailing slashes — only collapses consecutive slashes. Trailing slash is now preserved as part of the path identity. | ||
| - `_isWithinBasenameScope` uses a path-boundary check (`pathname === basename || pathname.startsWith(basename + '/')`) to prevent false positives from apps with overlapping name prefixes (e.g. `/apps/my-app` no longer matches `/apps/my-app-other/foo`). | ||
| - `_localizePath` falls back to `'/'` when the basename-stripped pathname is empty. |
19 changes: 19 additions & 0 deletions
19
.changeset/fusion-framework-plugin-context-navigation_initial.md
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,19 @@ | ||
| --- | ||
| "@equinor/fusion-framework-plugin-context-navigation": minor | ||
| --- | ||
|
|
||
| Initial release of the context navigation plugin. | ||
|
|
||
| Adapter-based, event-driven plugin that reconciles context selection with the browser URL for portal hosts. Ships with built-in adapters for query-param, path-segment, and custom URL shapes, plus two pre-wired source strategies: | ||
|
|
||
| - **app-first** — app sets context, the plugin encodes it to the URL. | ||
| - **context-first** — the plugin decodes context from the URL on startup, redirects to a configurable null-context URL when no context is resolvable. | ||
|
|
||
| ```ts | ||
| import { enableContextNavigation } from '@equinor/fusion-framework-plugin-context-navigation'; | ||
| import { createAppFirstSource } from '@equinor/fusion-framework-plugin-context-navigation/sources'; | ||
|
|
||
| enableContextNavigation(configurator, (builder) => { | ||
| builder.setSourceFactory(createAppFirstSource()); | ||
| }); | ||
| ``` | ||
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,11 @@ | ||
| --- | ||
| "@equinor/fusion-framework-module-navigation": patch | ||
| --- | ||
|
|
||
| **Security Fix**: Replaced regex-based pathname normalization with iterative approach to prevent potential ReDoS (Regular Expression Denial of Service) vulnerability when processing user-controlled basename values. | ||
|
|
||
| The `normalizePathname` function now uses a simple character-by-character scan instead of `/\/+/g` regex, ensuring O(n) linear time complexity even with pathological input containing thousands of consecutive slashes. | ||
|
|
||
| This addresses CodeQL security alert: "Polynomial regular expression used on uncontrolled data" | ||
|
|
||
| Related: #4751 |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.