Skip to content

feat(apollo-vertex): let the shell run on an app-provided session - #1462

Draft
ruudandriessen wants to merge 2 commits into
mainfrom
feat/vertex-shell-external-auth
Draft

ruudandriessen wants to merge 2 commits into
mainfrom
feat/vertex-shell-external-auth

Conversation

@ruudandriessen

Copy link
Copy Markdown
Collaborator

Why

Apps that already authenticate outside the browser can't reuse ApolloShell as it is. Peak-hosted apps are one example: a platform .peak.ai HttpOnly session cookie carries their auth, and no token ever reaches the browser. They keep a fork of the shell for three reasons:

  1. The gate checks useAuth().accessToken, not isAuthenticated. With cookie auth there is no token, so the only way through is a fake one. That fake value then reaches anything that reads accessToken as a bearer token, such as the data-fabric and insights adapters and the AI-chat tools.
  2. A signed-out user always gets the "Sign in with UiPath" screen. An app that signs in by redirecting to its platform login has no way to change that.
  3. The sidebar highlights an item on every page under its path, and only / is matched exactly. In a workspace-scoped app the /<workspace> home link stays highlighted on every section page. The minimal header already avoids this by highlighting only the most specific match.

What

  • Gate on isAuthenticated. ShellAuthProvider sets it to accessToken != null, so apps using the built-in OAuth flow behave exactly as before.
  • New unauthenticatedElement prop on ApolloShell. It renders instead of ShellLogin while the user is signed out, for example an element that redirects to the platform login. When it is not set, the default sign-in screen is unchanged.
  • Documented "Bringing your own authentication". An app can provide the already-exported AuthContext itself instead of mounting ShellAuthProvider, with accessToken: null.
  • Sidebar highlights only one item. The new activeNavItemPath picks the item that owns the most specific match among item paths and sub-item paths. Only that item gets the current or prefix-active styling. A group whose sub-item sits outside the group's own path still owns that sub-item, the case fixed in c869233.
  • vitest.config.ts uses resolve.tsconfigPaths instead of a single @ alias. Component tests can then resolve the @/components/ui/* imports the shell uses.

There is no breaking change. Without unauthenticatedElement the shell renders what it rendered before. Sidebar highlighting changes only when one nav item's path is a prefix of another's.

Verification

All of these pass locally:

  • package typecheck, lint (0 warnings, 0 errors), format:check and knip;
  • vitest: 53 tests, including the new shell.test.tsx and activeNavItemPath cases;
  • package build with check-dist, registry:build, and the full docs-app build.

lint:deps reports only the existing no-circular warnings.

Two of the new gate tests fail against the old shell.tsx: rendering unauthenticatedElement, and rendering the app for a session that has no access token. The other two pass on both versions.

I haven't tested this in a consuming app yet. The first one will be the Peak vertex apps template.

ApolloShell decided whether to render the app from useAuth().accessToken,
so an app that authenticates without a browser token (a platform session
cookie, for example) could only reuse the shell by passing a fake token.
That value would then reach anything that reads accessToken as a bearer.

- The gate now reads isAuthenticated. ShellAuthProvider derives it from the
  token, so its behaviour is unchanged.
- New unauthenticatedElement prop replaces the sign-in screen, e.g. with
  an element that redirects to the platform login.
- Document providing AuthContext directly instead of ShellAuthProvider.
- vitest resolves tsconfig paths so component tests can render the shell.
A landing item such as /acme prefixes every section under it, so the
sidebar highlighted it together with /acme/projects. The sidebar now keeps
only the item that owns the most specific match among item and child
paths, as the minimal header already does.
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1957 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1721
ISC 91
Apache-2.0 57
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
CC0-1.0 4
MIT-0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Sub-items in an unselected navigation group can remain highlighted alongside the selected standalone item.

1 open issue
What changed in this PR

Enables ApolloShell to use app-provided authentication, including cookie-based sessions without browser access tokens, and refines sidebar navigation highlighting.

Changes:

  • Gate access on isAuthenticated and allow a custom signed-out element.
  • Select the most specific navigation owner for sidebar highlighting.
  • Document external authentication and add regression tests with TypeScript path resolution.
File Description
packages/​apollo-vertex/​vitest.config.ts Enable TypeScript path mappings in tests.
packages/​apollo-vertex/​registry/​shell/​shell.tsx Support tokenless sessions and custom signed-out content.
packages/​apollo-vertex/​registry/​shell/​shell.test.tsx Add authentication gate tests.
packages/​apollo-vertex/​registry/​shell/​shell-sidebar.tsx Restrict parent highlighting to the selected navigation owner.
packages/​apollo-vertex/​registry/​shell/​shell-nav-active.ts Add most-specific navigation owner selection.
packages/​apollo-vertex/​registry/​shell/​shell-nav-active.test.tsx Cover navigation ownership and overlapping paths.
packages/​apollo-vertex/​registry/​shell/​shell-auth-provider.tsx Document app-provided authentication context.
apps/​apollo-vertex/​content/​docs/​patterns/​shell.mdx Explain external authentication and navigation highlighting.

Review effort: Balanced

Comment on lines +225 to +227
const row = isActiveItem
? itemState
: { ...itemState, prefixActive: false, current: false };
@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — — — —
@uipath/apollo-react — — — — —
@uipath/apollo-ui-icons — — — — —
@uipath/apollo-vertex 67.9% 94.4% (17/18) 337.1 KB 1.88 MB +298 B
@uipath/apollo-wind — — — — —
@uipath/ap-chat — — — — —

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

✅ No stories are affected by this PR's changes; nothing to compare. Logs

Updated (PT): Oct 23, 2026, 06:27:55 AM

@ruudandriessen ruudandriessen added the dev-packages Adds dev package publishing on pushes to this PR label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📦 Dev Packages

Package Status Updated (PT)
@uipath/apollo-vertex@2.2.0-pr1462.cef4810 🟢 Published Oct 23, 2026, 06:48:15 AM

This branch was successfully deployed

4 active deployments
preview/apollo-design — d8c203f7 Deployed Oct 23, 2026 by github-actions[bot]
preview/apollo-landing — d8c203f7 Deployed Oct 23, 2026 by github-actions[bot]
preview/apollo-docs — d8c203f7 Deployed Oct 23, 2026 by github-actions[bot]
preview/apollo-vertex — d8c203f7 Deployed Oct 23, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:apollo-vertex dev-packages Adds dev package publishing on pushes to this PR size:L 100-499 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants