feat: Normalize fields across various Boundary components (#5599)

Normalizes various IP/Address/Host fields across Boundary resources/components to comply with IPv6 specifications.
This commit is contained in:
Hugo authored and GitHub committed 2025-05-13 16:55:28 +01:00
1 parent 2d880326b7
commit a65d5d8573
37 files changed
+1028 -348

No files matched your search

+3 -3
View File
@@ -244,7 +244,7 @@ func (b *Server) CreateDevLdapAuthMethod(ctx context.Context) error {
continue
}
host, _, err = util.SplitHostPort(ln.Config.Address)
if err != nil {
if err != nil && !errors.Is(err, util.ErrMissingPort) {
return fmt.Errorf("error splitting host/port: %w", err)
}
}
@@ -262,7 +262,7 @@ func (b *Server) CreateDevLdapAuthMethod(ctx context.Context) error {
// added back, otherwise the gldap server will fail to start due to a parsing
// error.
if ip := net.ParseIP(host); ip != nil {
if ip.To16() != nil {
if ip.To4() == nil && ip.To16() != nil {
host = fmt.Sprintf("[%s]", host)
}
}
@@ -463,7 +463,7 @@ func (b *Server) CreateDevOidcAuthMethod(ctx context.Context) error {
continue
}
b.DevOidcSetup.hostAddr, b.DevOidcSetup.callbackPort, err = util.SplitHostPort(ln.Config.Address)
if err != nil {
if err != nil && !errors.Is(err, util.ErrMissingPort) {
return fmt.Errorf("error splitting host/port: %w", err)
}
if b.DevOidcSetup.callbackPort == "" {