Skip to content

fix(journey-client): add createJourneyStep and baseUrl to support Platform Login#722

Open
ryanbas21 wants to merge 3 commits into
mainfrom
export-create-journey-step
Open

fix(journey-client): add createJourneyStep and baseUrl to support Platform Login#722
ryanbas21 wants to merge 3 commits into
mainfrom
export-create-journey-step

Conversation

@ryanbas21

@ryanbas21 ryanbas21 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Two fixes for Platform Login use cases. These additions are not intended for normal, customer use.

  1. Add createJourneyStep to a utility export
  2. Bring back the use of baseUrl as a config option

JIRA Ticket

No Jira

Description

Platform Login has edge cases that need to be support by the Journey Client. One is the ability to store a step outside of the Journey Client and "re-decorate" the Step object with convenience methods upon user return. The other is the ability to support authentication when there is no Wellknown endpoint avialable.

Summary by CodeRabbit

  • New Features
    • Exposed createJourneyStep (and related step/callback types) to simplify recreating steps from serialized data.
  • Improvements
    • Enhanced journey client configuration to support legacy serverConfig.baseUrl mode in addition to well-known discovery, including correct endpoint path handling and updated warnings behavior.
    • Added LegacyServerConfig to the public type surface.
  • Bug Fixes
    • WebAuthn device deletion now throws a clearer error when well-known configuration is missing.
  • Maintenance
    • Updated package subpath exports, generated API reports, and accompanying tests/release metadata.

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 611620d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/journey-client Patch
@forgerock/davinci-client Patch
@forgerock/device-client Patch
@forgerock/oidc-client Patch
@forgerock/protect Patch
@forgerock/sdk-types Patch
@forgerock/sdk-utilities Patch
@forgerock/iframe-manager Patch
@forgerock/sdk-logger Patch
@forgerock/sdk-oidc Patch
@forgerock/sdk-request-middleware Patch
@forgerock/storage Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 01649996-f0ef-427e-b34d-fa7c62a836c0

📥 Commits

Reviewing files that changed from the base of the PR and between 2f7b71f and 611620d.

📒 Files selected for processing (18)
  • .changeset/tender-signs-crash.md
  • e2e/journey-app/services/delete-webauthn-device.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/journey-client/api-report/journey-client._utils.api.md
  • packages/journey-client/api-report/journey-client.api.md
  • packages/journey-client/api-report/journey-client.types.api.md
  • packages/journey-client/package.json
  • packages/journey-client/src/_utils.ts
  • packages/journey-client/src/index.ts
  • packages/journey-client/src/lib/client.store.test.ts
  • packages/journey-client/src/lib/client.store.ts
  • packages/journey-client/src/lib/config.slice.test.ts
  • packages/journey-client/src/lib/config.slice.ts
  • packages/journey-client/src/lib/config.types.test-d.ts
  • packages/journey-client/src/lib/config.types.ts
  • packages/sdk-types/src/lib/config.types.ts
  • packages/sdk-utilities/src/lib/config/config.test.ts
🚧 Files skipped from review as they are similar to previous changes (16)
  • packages/journey-client/src/index.ts
  • packages/journey-client/api-report/journey-client.types.api.md
  • packages/journey-client/src/_utils.ts
  • .changeset/tender-signs-crash.md
  • packages/journey-client/src/lib/config.types.ts
  • packages/journey-client/src/lib/config.slice.test.ts
  • packages/journey-client/api-report/journey-client._utils.api.md
  • packages/journey-client/src/lib/client.store.test.ts
  • packages/sdk-types/src/lib/config.types.ts
  • packages/journey-client/api-report/journey-client.api.md
  • packages/sdk-utilities/src/lib/config/config.test.ts
  • packages/journey-client/src/lib/config.types.test-d.ts
  • e2e/journey-app/services/delete-webauthn-device.ts
  • packages/journey-client/src/lib/client.store.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/journey-client/src/lib/config.slice.ts

📝 Walkthrough

Walkthrough

The journey client now supports direct baseUrl configuration alongside well-known discovery and publicly exposes createJourneyStep through a new _utils entrypoint. DaVinci API reports and configuration types are updated accordingly.

Changes

Journey client updates

Layer / File(s) Summary
Configuration flow and reducer support
packages/sdk-types/src/lib/config.types.ts, packages/journey-client/src/lib/config.slice.ts, packages/journey-client/src/lib/client.store.ts, packages/journey-client/src/lib/*.test*, packages/sdk-utilities/..., e2e/...
JourneyClientConfig accepts baseUrl; initialization derives endpoint paths, reducer payloads are discriminated, and tests cover URL construction, typing, reducer behavior, mappings, and missing well-known configuration.
Public journey step export
.changeset/tender-signs-crash.md, packages/journey-client/src/_utils.ts, packages/journey-client/package.json, packages/journey-client/api-report/journey-client._utils.api.md
createJourneyStep, JourneyStep, CallbackFactory, and BaseCallback are exposed through the _utils subpath and documented in the generated API report.
Public configuration API and maintenance
packages/journey-client/api-report/journey-client*.api.md, packages/journey-client/src/index.ts, packages/journey-client/src/lib/config*.test-d.ts
LegacyServerConfig is added to public API reports and exports, while affected copyright headers are updated through 2026.

DaVinci API report

Layer / File(s) Summary
Cached response error unions
packages/davinci-client/api-report/*.api.md
Generated cache response types reorder SerializedError and FetchBaseQueryError in fulfilled and rejected variants.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Journey as journey()
  participant Wellknown as wellknownApi
  participant Config as configSlice
  alt serverConfig.baseUrl exists
    Journey->>Config: dispatch baseUrl and endpoint paths
  else serverConfig.wellknown
    Journey->>Wellknown: fetch OpenID configuration
    Wellknown-->>Journey: return wellknownResponse
    Journey->>Config: dispatch wellknown configuration
  end
Loading

Possibly related PRs

Suggested reviewers: cerebrl

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: exporting createJourneyStep and restoring baseUrl support for Journey Client.
Description check ✅ Passed The description includes the required JIRA Ticket and Description sections and clearly explains the two Platform Login fixes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch export-create-journey-step

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 611620d

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 3m 25s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-17 22:05:02 UTC

@codecov-commenter

codecov-commenter commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.46154% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.38%. Comparing base (eafe277) to head (611620d).
⚠️ Report is 48 commits behind head on main.

Files with missing lines Patch % Lines
packages/journey-client/src/lib/client.store.ts 89.47% 4 Missing ⚠️
packages/journey-client/src/_utils.ts 33.33% 2 Missing ⚠️

❌ Your project status has failed because the head coverage (23.38%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #722      +/-   ##
==========================================
+ Coverage   18.07%   23.38%   +5.30%     
==========================================
  Files         155      162       +7     
  Lines       24398    25628    +1230     
  Branches     1203     1629     +426     
==========================================
+ Hits         4410     5993    +1583     
+ Misses      19988    19635     -353     
Files with missing lines Coverage Δ
packages/journey-client/src/index.ts 100.00% <ø> (+75.00%) ⬆️
packages/journey-client/src/lib/config.slice.ts 100.00% <100.00%> (ø)
packages/sdk-types/src/lib/config.types.ts 20.00% <ø> (-80.00%) ⬇️
packages/journey-client/src/_utils.ts 33.33% <33.33%> (ø)
packages/journey-client/src/lib/client.store.ts 87.01% <89.47%> (+6.50%) ⬆️

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@722

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@722

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@722

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@722

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@722

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@722

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@722

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@722

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@722

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@722

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@722

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@722

commit: 611620d

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Deployed bf5dcfe to https://ForgeRock.github.io/ping-javascript-sdk/pr-722/bf5dcfeba89a0ad0ec998c275bc68ad8642a1453 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🆕 New Packages

🆕 @forgerock/device-client - 10.0 KB (new)
🆕 @forgerock/device-client - 0.0 KB (new)
🆕 @forgerock/journey-client - 93.7 KB (new)
🆕 @forgerock/journey-client - 0.0 KB (new)

📊 Minor Changes

📈 @forgerock/sdk-types - 9.1 KB (+0.0 KB)

➖ No Changes

@forgerock/protect - 144.6 KB
@forgerock/sdk-request-middleware - 4.6 KB
@forgerock/iframe-manager - 3.2 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/sdk-oidc - 5.7 KB
@forgerock/storage - 1.5 KB
@forgerock/oidc-client - 35.3 KB
@forgerock/sdk-utilities - 18.6 KB
@forgerock/davinci-client - 54.4 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/sdk-types/src/lib/config.types.ts`:
- Around line 42-46: Update the JourneyServerConfig interface so wellknown is
optional, allowing configurations that provide only baseUrl while preserving the
existing baseUrl and timeout fields.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b724b842-066b-498b-8cff-6ae56478b5f5

📥 Commits

Reviewing files that changed from the base of the PR and between cc8ab8d and 9776a7c.

📒 Files selected for processing (8)
  • packages/journey-client/api-report/journey-client.api.md
  • packages/journey-client/package.json
  • packages/journey-client/src/_utils.ts
  • packages/journey-client/src/index.ts
  • packages/journey-client/src/lib/client.store.ts
  • packages/journey-client/src/lib/config.slice.test.ts
  • packages/journey-client/src/lib/config.slice.ts
  • packages/sdk-types/src/lib/config.types.ts
💤 Files with no reviewable changes (1)
  • packages/journey-client/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/journey-client/api-report/journey-client.api.md

Comment thread packages/sdk-types/src/lib/config.types.ts
@cerebrl cerebrl changed the title feat(journey-client): add-create-journey-step-to-api fix(journey-client): add createJourneyStep and baseUrl to support Platform Login Jul 13, 2026
@ryanbas21
ryanbas21 force-pushed the export-create-journey-step branch 3 times, most recently from 44633fc to 2a1d32f Compare July 15, 2026 15:51

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
e2e/journey-app/services/delete-webauthn-device.ts (1)

95-98: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Support baseUrl configuration directly instead of throwing an error.

Since config.serverConfig can now contain baseUrl and config contains realmPath, you can avoid throwing an error and fully support the LegacyServerConfig branch here.

♻️ Proposed refactor to support `baseUrl`
-  const wellknown = 'wellknown' in config.serverConfig ? config.serverConfig.wellknown : undefined;
-  if (!wellknown) {
-    throw new Error('serverConfig.wellknown is required to delete a WebAuthn device.');
-  }
-  const baseUrl = getBaseUrlFromWellknown(wellknown);
-  const realmUrlPath = getRealmUrlPathFromWellknown(wellknown);
+  const baseUrl = 'baseUrl' in config.serverConfig
+    ? config.serverConfig.baseUrl
+    : getBaseUrlFromWellknown(config.serverConfig.wellknown);
+
+  const realmUrlPath = 'wellknown' in config.serverConfig
+    ? getRealmUrlPathFromWellknown(config.serverConfig.wellknown)
+    : `realms/${config.realmPath || 'root'}`;
+
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/journey-app/services/delete-webauthn-device.ts` around lines 95 - 98,
Update the WebAuthn device deletion flow around the wellknown lookup to support
the LegacyServerConfig branch: when serverConfig provides baseUrl, combine it
with config.realmPath to construct the required endpoint instead of throwing.
Preserve the existing wellknown behavior for configurations that provide
serverConfig.wellknown, and only fail when neither configuration can produce the
endpoint.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@e2e/journey-app/services/delete-webauthn-device.ts`:
- Around line 95-98: Update the WebAuthn device deletion flow around the
wellknown lookup to support the LegacyServerConfig branch: when serverConfig
provides baseUrl, combine it with config.realmPath to construct the required
endpoint instead of throwing. Preserve the existing wellknown behavior for
configurations that provide serverConfig.wellknown, and only fail when neither
configuration can produce the endpoint.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5a49c327-21a4-40d5-a33f-a68a76e0c974

📥 Commits

Reviewing files that changed from the base of the PR and between 9776a7c and 44633fc.

📒 Files selected for processing (15)
  • e2e/journey-app/services/delete-webauthn-device.ts
  • packages/journey-client/api-report/journey-client._utils.api.md
  • packages/journey-client/api-report/journey-client.api.md
  • packages/journey-client/api-report/journey-client.types.api.md
  • packages/journey-client/package.json
  • packages/journey-client/src/_utils.ts
  • packages/journey-client/src/index.ts
  • packages/journey-client/src/lib/client.store.test.ts
  • packages/journey-client/src/lib/client.store.ts
  • packages/journey-client/src/lib/config.slice.test.ts
  • packages/journey-client/src/lib/config.slice.ts
  • packages/journey-client/src/lib/config.types.test-d.ts
  • packages/journey-client/src/lib/config.types.ts
  • packages/sdk-types/src/lib/config.types.ts
  • packages/sdk-utilities/src/lib/config/config.test.ts
💤 Files with no reviewable changes (1)
  • packages/journey-client/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/journey-client/package.json
  • packages/journey-client/src/_utils.ts
  • packages/journey-client/src/lib/client.store.ts
  • packages/journey-client/src/lib/config.slice.ts

@ryanbas21
ryanbas21 force-pushed the export-create-journey-step branch from 2a1d32f to 2f7b71f Compare July 17, 2026 16:00
@ryanbas21
ryanbas21 force-pushed the export-create-journey-step branch from 2f7b71f to 611620d Compare July 17, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants