Repository navigation
Leave build details out of the page metadata for requests with no session - #1803
Merged
asteriscos merged 2 commits intoNov 26, 2026
Merged
Conversation
…sion Pages rendered for a request with no session, such as the login page, carried the build commit, branch, and Wazuh revision and release stage in osd-injected-metadata, while /api/status refuses the same client. The rendering service now blanks those four fields when the auth status is unauthenticated. The version and build number stay, since the browser sends the version on every request and loads its bundles by build number. Logged-in pages, and installs without an auth provider, keep every field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
|
Ripdiegozz
requested changes
Nov 26, 2026
Ripdiegozz
left a comment
There was a problem hiding this comment.
Blocked by finding 1 in the review above: the new test doesn't compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Ripdiegozz
approved these changes
Nov 26, 2026
asteriscos
deleted the
enhancement/7817-trim-login-page-build-metadata
branch
November 26, 2026 19:46
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.











Description
A request with no session, such as
GET /app/login, gets a page whoseosd-injected-metadatacarries the build commit (buildSha), the branch, and the Wazuh revision and release stage. The same client gets 401 from/api/status, the route that normally reports build details. None of these four fields is needed to show the login page or to log in.This PR removes them before login. It leaves the fields the browser needs to start:
osd-versionheader on every request, the login POST included.exposeToBrowserconfig: every plugin bundle is loaded and set up on the login page, and the login form reads the security plugin'sauthanduisettings.Proposed Changes
src/core/server/rendering/rendering_service.tsx: whenhttp.auth.get(request).statusisunauthenticated, the rendering service blanksbranch,buildSha,wazuhRevisionandwazuhStageinenv.packageInfo. The top-levelbranchandwazuhBuildInfo.revision/stagecome from the same object, so they are blank too.unauthenticatedspecifically:authenticatedand keep every field. Logging in reloads the page from the server, so features that read the build info after login are unaffected (agent registration commands, About page).unknownand keep every field, so they don't lose the build info for good./app/loginalso gets the blanked fields. That route hasauthRequired: false, so the auth handler never runs for it. This is harmless: the login page doesn't read these fields.Results and Evidence
Artifacts Affected
Configuration Changes
None.
Documentation Updates
None.
Tests Introduced
src/core/server/rendering/rendering_service.test.ts, with fixed package info:unauthenticatedstatus,branch,buildSha,wazuhRevisionandwazuhStageare empty, andversion,buildNumberandwazuhVersionare kept.authenticatedandunknownstatuses, every field is kept.The existing snapshots are unchanged (the HTTP mock defaults to
authenticated). Local results: Jest onsrc/core/server/rendering(33 passed), ESLint, Prettier andyarn typecheckall pass.Review Checklist
Manual verification, on a package or dev environment with the security plugin enabled:
With no session, run:
curl -sk https://<dashboard>/app/login | python3 -c 'import sys,re,json,html;j=json.loads(html.unescape(re.search(r"<osd-injected-metadata data=\"([^\"]*)\"",sys.stdin.read()).group(1)));p=j["env"]["packageInfo"];print(j["branch"],p["buildSha"],p["wazuhRevision"],p["wazuhStage"],j["wazuhBuildInfo"],j["version"],j["buildNumber"])'branch,buildSha,wazuhRevision,wazuhStageandwazuhBuildInfo.revision/stageare empty.versionandbuildNumberare present.The login page loads and a user can log in (basic auth; OIDC/SAML if available).
With no session,
GET /api/statusstill returns 401.After login, the agent registration commands and the About page show the correct version, revision and stage.
no-changelog)🤖 Generated with Claude Code