mirror of
https://github.com/kerberos-io/onvif.git
synced 2026-08-23 15:08:33 +00:00
Two findings from the resource/security and API reviews of the
streamtest example.
Credentials
-----------
* loadPassword resolves the camera password in order:
1. ONVIF_PASSWORD environment variable (recommended).
2. -password-file <path> (newline trimmed).
3. Interactive prompt when nothing else is set.
* -password flag still works but now logs a WARNING that the value
leaks into shell history and process listings. Documented as
'INSECURE' in the flag help.
* Updated package godoc with a Credentials section.
Errors-arm bug
--------------
* Previous code: case e := <-s.Errors() with no ok check. When the
Stream closed, this arm would spin on a closed channel printing
'<nil>' forever (until ctx-done elsewhere unblocked it). Mirror
the Events arm's ok pattern.
* Switched the error-log branch to inspect the typed errors added
in the previous commit: ErrRecreateFailed gets a louder 'camera
may be offline' log line; ErrPullFailed is a quieter
'will retry' since the loop handles transient pull errors
automatically.
Also prints '[after-reconnect]' on events carrying that flag so the
operator can see when the stream silently recovered a dropped
subscription — confirms the new observability surface is useful at
the CLI level.