- Skip supervision WebSocket auth with warning when supervisionUser
contains ':' (convergence point for templates and all API paths)
- Reject ':' in authentication.username via Zod regex in UI config
schema (covers ui/web and ui/cli config files)
return
}
if (this.stationInfo?.supervisionUser != null && this.stationInfo.supervisionPassword != null) {
- options.auth = `${this.stationInfo.supervisionUser}:${this.stationInfo.supervisionPassword}`
+ if (this.stationInfo.supervisionUser.includes(':')) {
+ logger.warn(
+ `${this.logPrefix()} Supervision user contains ':' which is invalid in HTTP Basic Auth (RFC 7617) — skipping auth`
+ )
+ } else {
+ options.auth = `${this.stationInfo.supervisionUser}:${this.stationInfo.supervisionPassword}`
+ }
}
if (params.closeOpened) {
this.closeWSConnection()
enabled: z.boolean(),
password: z.string().optional(),
type: z.enum(AuthenticationType),
- username: z.string().optional(),
+ username: z
+ .string()
+ .regex(/^[^:]*$/, 'must not contain ":"')
+ .optional(),
})
.refine(
data =>