Skip to content

feat(config): let a consumer hand uicore its settings via setConfig - #352

Open
gcutrini wants to merge 4 commits into
feat/access-token-resolver-5xfrom
feat/config-setter-5x
Open

gcutrini wants to merge 4 commits into
feat/access-token-resolver-5xfrom
feat/config-setter-5x

Conversation

@gcutrini

@gcutrini gcutrini commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

ref: https://app.clickup.com/t/86bcdq027

5.x sibling of #351 (v4.x). Based on #329 (resolver 5.x).

uicore reads its OAuth/app settings (apiBaseUrl, idpBaseUrl, oauth2ClientId, timeApiUrl) from window globals by default. setConfig lets a consumer hand uicore those settings directly; the config readers (clock, exclusive-wrapper, auth-callback routes, security actions/methods) delegate to it when a config is registered, otherwise the built-in window-globals flow is unchanged. Shared through a globalThis Symbol.for slot, consistent with the resolver (#329).

Settings registered through setConfig win over the window globals uicore
has always read; unset keys keep the window fallback, so existing
consumers are unaffected. A key set to undefined or an empty string is
unset; null, false and 0 are values (oauth2UseRefreshToken: false turns
the refresh flow off).

The state lives on globalThis under
Symbol.for('openstack-uicore-foundation.config'), so every copy of the
module shares it: bundles that inline it, nested installs, and symlinked
dev checkouts.
getServerTime fetched whatever getTimeServiceUrl returned, so an
unconfigured host produced a garbage request ('' fetches the current
page, undefined fetches the literal string) before landing on the same
local-clock fallback a rejected fetch reaches directly.
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9abbcca2-86d7-47ef-926d-b0b44be1d9b0
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@gcutrini
gcutrini added this pull request to stack #354 October 6, 2026 16:04
@gcutrini
gcutrini removed this pull request from stack #354 October 6, 2026 16:08
@gcutrini
gcutrini added this pull request to stack #355 October 6, 2026 16:22
readConfig and setConfig used bare globalThis. They now use the same
_global fallback (globalThis → window → {}) as the security methods, so
the window-globals fallback still works on a runtime without globalThis.
getUserInfo split the allowed-user-groups string whenever it was not '',
so the null value getAllowedUserGroups returns with no window threw.
parseUserGroups splits a truthy string and returns an empty list for any
falsy value; getUserInfo calls it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant