Skip to content

Add bind_address property for http4s server configuration#2714

Merged
simonredfern merged 2 commits intoOpenBankProject:developfrom
hongwei1:refactor/hostname-parsing-improvement
Feb 27, 2026
Merged

Add bind_address property for http4s server configuration#2714
simonredfern merged 2 commits intoOpenBankProject:developfrom
hongwei1:refactor/hostname-parsing-improvement

Conversation

@hongwei1
Copy link
Contributor

Summary

This PR adds a new bind_address property for http4s server configuration, providing more flexibility in network binding while maintaining backward compatibility.

Changes

  1. Added Http4sConfigUtil.parseHostname() utility in Http4sSupport.scala

    • Parses hostnames from both plain format ("127.0.0.1") and URI format ("http://127.0.0.1:8080")
    • Extracts the host component from full URIs
  2. Updated Http4sServer.scala to use the new bind_address property

    • Uses bind_address property if set
    • Falls back to parsing hostname property if bind_address is not set
    • The hostname property remains unchanged (critical for local_provider_name fallback)
  3. Added comprehensive test suite Http4sConfigUtilTest.scala

    • 9 test cases covering various hostname formats
    • Tests plain IPs, URIs with protocols, ports, paths, and domain names

Motivation

The hostname property is used as a fallback for local_provider_name, which affects user authentication. Changing it could break existing user logins. The new bind_address property allows operators to specify the network binding address independently without affecting authentication logic.

Backward Compatibility

✅ Fully backward compatible - if bind_address is not set, the system behaves exactly as before by parsing the hostname property.

Testing

  • Unit tests added for hostname parsing utility
  • All existing tests pass
  • Manual testing confirmed server starts correctly with both configurations

@hongwei1 hongwei1 force-pushed the refactor/hostname-parsing-improvement branch from aa4236b to f9edb6f Compare February 27, 2026 09:41
@sonarqubecloud
Copy link

@simonredfern simonredfern merged commit 76c5f91 into OpenBankProject:develop Feb 27, 2026
2 checks passed
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.

2 participants