Skip to content

[RORDEV-1927] Xpack authentication header creator class refactoring#1210

Open
coutoPL wants to merge 5 commits intodevelopfrom
refactoring/RORDEV-1927
Open

[RORDEV-1927] Xpack authentication header creator class refactoring#1210
coutoPL wants to merge 5 commits intodevelopfrom
refactoring/RORDEV-1927

Conversation

@coutoPL
Copy link
Collaborator

@coutoPL coutoPL commented Feb 4, 2026

This PR simplifies and documents the authentication header serialization logic across all Elasticsearch versions
(6.7.x - 9.2.x):

Changes:

  • Removed version conditionals: Eliminated version-specific checks that were always true (all supported ES
    versions are ≥ 6.7.0/7.0.0/8.2.0)
  • Added inline documentation: Added clear comments explaining each serialization field (internal user flag, realm
    info, authentication type, metadata)
  • Fixed code style: Corrected whitespace in if (isInternal) conditional
  • Cleaned up imports: Removed unused TransportVersions import in ES 8.11+ versions
  • Improved consistency: Unified serialization format across all 33 ES version modules

The authentication header serialization now unconditionally writes all required fields in the expected order,
making the code more maintainable and easier to understand.

Summary by CodeRabbit

  • Bug Fixes
    • Consistent authentication header encoding across transport versions to improve reliability.
    • Fixed realm metadata emission so realm and lookup flags are always present and correctly encoded.
    • Clarified internal vs. regular user serialization so internal accounts use a minimal payload while regular users include full profile fields.

@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@coutoPL coutoPL force-pushed the refactoring/RORDEV-1927 branch from 0f8368d to d801b5d Compare February 12, 2026 11:28
@coutoPL coutoPL requested a review from mateuszkp96 February 12, 2026 11:31
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