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:
37 files changed
+1028
-348
No files matched your search
@@ -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 == "" {
|
||||
|
||||
Reference in new issue
Block a user