Skip to content

Conversation

@ryanbas21
Copy link
Collaborator

@ryanbas21 ryanbas21 commented Jan 22, 2026

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-4665

Description

Add support for well known endpoint

Summary by CodeRabbit

Release Notes

  • New Features

    • Added OIDC well-known endpoint support for automatic configuration discovery from tenants.
    • Enhanced configuration resolution with intelligent realm path inference from issuer URLs.
    • Implemented URL validation for well-known endpoints to ensure secure configurations.
  • Tests

    • Added comprehensive test coverage for well-known configuration utilities and discovery logic.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

🦋 Changeset detected

Latest commit: 73386a2

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 Minor
@forgerock/davinci-client Minor
@forgerock/device-client Minor
@forgerock/oidc-client Minor
@forgerock/protect Minor
@forgerock/sdk-types Minor
@forgerock/sdk-utilities Minor
@forgerock/iframe-manager Minor
@forgerock/sdk-logger Minor
@forgerock/sdk-oidc Minor
@forgerock/sdk-request-middleware Minor
@forgerock/storage Minor

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
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

This PR introduces OIDC well-known endpoint discovery support to the @forgerock/journey-client package. It adds new configuration types and utilities to retrieve and resolve configuration from a well-known endpoint, integrates a new RTK Query API into Redux state management, and updates the config resolution flow to support both standard and async configuration paths.

Changes

Cohort / File(s) Summary
Configuration Type Definitions
packages/journey-client/src/lib/config.types.ts
Introduces WellknownServerConfig, AsyncJourneyClientConfig, InternalJourneyClientConfig, and JourneyConfigInput union type to support well-known discovery mode alongside standard baseUrl configuration.
Well-known Discovery Implementation
packages/journey-client/src/lib/wellknown.api.ts, packages/journey-client/src/lib/wellknown.utils.ts
Adds RTK Query API for fetching OIDC well-known configuration with caching, plus utility functions: hasWellknownConfig (type guard), inferRealmFromIssuer (parses AM issuer URLs), and isValidWellknownUrl (validates well-known endpoints).
Well-known Utilities Tests
packages/journey-client/src/lib/wellknown.utils.test.ts
Comprehensive test suite covering type-narrowing, issuer parsing with subrealm extraction, and well-known URL validation across multiple scenarios.
Client Store & Async Config Resolution
packages/journey-client/src/lib/client.store.ts
Updates config resolution flow with new resolveAsyncConfig function that fetches and merges well-known configuration. Reroutes initialization to select between async well-known resolution and standard normalization based on presence of well-known URL.
Redux Store & Slice Integration
packages/journey-client/src/lib/client.store.utils.ts, packages/journey-client/src/lib/journey.slice.ts
Registers wellknownApi in Redux root reducer and middleware chain; updates config type references from JourneyClientConfig to InternalJourneyClientConfig throughout store and slice.
Public API Exports
packages/journey-client/src/types.ts
Re-exports well-known utility functions (hasWellknownConfig, inferRealmFromIssuer, isValidWellknownUrl) as public API.
Release Metadata
.changeset/rich-cows-try.md
Declares minor version bump for @forgerock/journey-client with well-known endpoint support.

Sequence Diagram

sequenceDiagram
    participant App as App
    participant JourneyFactory as Journey Factory
    participant ConfigResolver as Config Resolver
    participant WellknownAPI as Wellknown API
    participant Redux as Redux Store
    participant JourneyStore as Journey Store

    rect rgba(100, 150, 200, 0.5)
    Note over App,JourneyStore: Well-known Configuration Path
    App->>JourneyFactory: journey(JourneyConfigInput with wellknown URL)
    JourneyFactory->>ConfigResolver: hasWellknownConfig(config)?
    ConfigResolver-->>JourneyFactory: true
    JourneyFactory->>ConfigResolver: resolveAsyncConfig(config)
    ConfigResolver->>WellknownAPI: Fetch well-known configuration
    WellknownAPI->>Redux: Cache result
    WellknownAPI-->>ConfigResolver: WellKnownResponse
    ConfigResolver->>ConfigResolver: inferRealmFromIssuer(issuer)
    ConfigResolver->>ConfigResolver: Merge configurations
    ConfigResolver-->>JourneyFactory: InternalJourneyClientConfig
    end

    rect rgba(150, 100, 200, 0.5)
    Note over App,JourneyStore: Standard Configuration Path
    App->>JourneyFactory: journey(JourneyConfigInput)
    JourneyFactory->>ConfigResolver: hasWellknownConfig(config)?
    ConfigResolver-->>JourneyFactory: false
    JourneyFactory->>ConfigResolver: normalizeConfig(config)
    ConfigResolver-->>JourneyFactory: InternalJourneyClientConfig
    end

    JourneyFactory->>JourneyStore: createJourneyStore(resolvedConfig)
    JourneyStore->>Redux: Register API, reducer, middleware
    Redux-->>JourneyStore: Store created
    JourneyStore-->>App: Store ready
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • #431 — Modifies client.store.ts and the config normalization flow, providing context for these changes.
  • #412 — Updates shared package dependencies and types that this PR builds upon, including config and store module changes.

Suggested reviewers

  • cerebrl

🐰 A journey client hops into place,
Well-known endpoints set the pace,
Realms dance from issuer URL,
Redux stores the data bright and full,
Async discovery makes us hop with glee!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main feature being added: well-known endpoint configuration support for the journey-client package.
Description check ✅ Passed The description includes the required JIRA ticket reference and a brief description of changes, following the template structure.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jan 22, 2026

View your CI Pipeline Execution ↗ for commit 73386a2

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

☁️ Nx Cloud last updated this comment at 2026-01-22 19:09:17 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 22, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/davinci-client@525

@forgerock/device-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/device-client@525

@forgerock/journey-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/journey-client@525

@forgerock/oidc-client

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/oidc-client@525

@forgerock/protect

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/protect@525

@forgerock/sdk-types

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-types@525

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-utilities@525

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/iframe-manager@525

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-logger@525

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-oidc@525

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/sdk-request-middleware@525

@forgerock/storage

pnpm add https://pkg.pr.new/ForgeRock/ping-javascript-sdk/@forgerock/storage@525

commit: 73386a2

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 78.29912% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.50%. Comparing base (b89ad58) to head (73386a2).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
packages/journey-client/src/lib/client.store.ts 55.64% 55 Missing ⚠️
packages/journey-client/src/lib/wellknown.api.ts 79.66% 12 Missing ⚠️
packages/journey-client/src/types.ts 0.00% 7 Missing ⚠️

❌ Your project status has failed because the head coverage (19.50%) 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     #525      +/-   ##
==========================================
+ Coverage   18.79%   19.50%   +0.71%     
==========================================
  Files         140      144       +4     
  Lines       27640    28054     +414     
  Branches      980     1010      +30     
==========================================
+ Hits         5195     5473     +278     
- Misses      22445    22581     +136     
Files with missing lines Coverage Δ
...kages/journey-client/src/lib/client.store.utils.ts 100.00% <100.00%> (ø)
packages/journey-client/src/lib/journey.slice.ts 100.00% <100.00%> (ø)
packages/journey-client/src/lib/wellknown.utils.ts 100.00% <100.00%> (ø)
packages/journey-client/src/types.ts 0.00% <0.00%> (ø)
packages/journey-client/src/lib/wellknown.api.ts 79.66% <79.66%> (ø)
packages/journey-client/src/lib/client.store.ts 77.81% <55.64%> (-14.98%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

Deployed 04794f6 to https://ForgeRock.github.io/ping-javascript-sdk/pr-525/04794f6a6212c98698f331ca125dc65582860a6d branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/journey-client - 0.0 KB (-82.4 KB, -100.0%)
🔺 @forgerock/journey-client - 89.0 KB (+6.6 KB, +8.0%)

➖ No Changes

@forgerock/device-client - 9.2 KB
@forgerock/oidc-client - 23.4 KB
@forgerock/protect - 150.1 KB
@forgerock/sdk-utilities - 8.5 KB
@forgerock/sdk-types - 8.0 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/sdk-oidc - 2.6 KB
@forgerock/davinci-client - 39.8 KB


13 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

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