20 Commits

Author SHA1 Message Date
Cédric Verstraeten
fe86ea942d Return errors for failed SOAP responses
Propagate HTTP 4xx/5xx errors from SOAP and digest requests, preserve responses, and ensure PTZ zero coordinates are serialized. Add regression tests for both behaviors.
2026-08-05 13:13:42 +02:00
Cédric Verstraeten
96918255a9 feat: enhance authentication mechanism and improve event handling
- Added EndpointRefAddress to DeviceParams for better endpoint management.
- Updated FilterType to use pointers for TopicExpression and MessageContent.
- Refactored SendSoapWithDigest to strip WS-Security headers to avoid credential duplication.
- Updated package imports to reflect new repository structure.
- Introduced ReadAndParse function for improved HTTP response handling in SDK.
2026-07-07 12:49:51 +00:00
Cédric Verstraeten
2fb619deda Merge branch 'master' into fix/authentication-mechanism 2026-07-07 14:18:26 +02:00
Cédric Verstraeten
119a6511b1 feat(auth): add AuthMode-driven auth with HTTP digest support
On use-go/onvif the only authenticated transport was WS-Security
UsernameToken. Cameras whose firmware requires HTTP digest for
authenticated operations therefore onboarded fine (GetCapabilities is
allowed unauthenticated) but rejected every authenticated call such as
PTZ ContinuousMove, making pan/tilt appear completely broken.

Add an AuthMode selector on DeviceParams and route CallMethod through a
new AuthMode-aware sendSOAP helper:

  - none:          no auth
  - usernametoken: WS-Security only (never escalates to digest)
  - digest:        HTTP digest only
  - both / unset:  WS-Security when credentials exist, plus an HTTP
                   digest retry only when the device answers HTTP 401

networking.SendSoapWithDigest performs a standards-compliant RFC 2617
digest handshake (MD5 / MD5-sess, qop=auth) using only the standard
library, and never strips an existing WS-Security header. The default
(unset AuthMode) stays backward compatible: digest is attempted only on
a genuine 401 challenge, so WS-Security-only cameras are unaffected.

Adds unit tests covering challenge parsing, the RFC 2617 worked example,
authorization-header consistency, and rejection of unsupported qop.
2026-07-07 12:00:16 +00:00
Cedric Verstraeten
6fc6d9a99e reuse main http client + resolved memory leak (close previous response) before creating new one. 2025-01-16 21:43:28 +01:00
Cedric Verstraeten
ee8a919932 support for latest hikivision ONVIF 19.12 2024-08-21 16:07:06 +02:00
Cedric Verstraeten
8902e4e789 upgrade onvif library 2023-12-18 20:16:21 +01:00
tarancss
1a23395c53 remove debug logs 2022-09-17 01:24:52 +02:00
tarancss
8677b3be7e fix memory leak and events 2022-09-17 01:18:56 +02:00
Jean-Francois Smigielski
47d91cba88 networking: use juju/errors and zerolog 2022-05-11 10:05:57 +02:00
kikimor
51ae55e8a0 External httpClient support 2021-02-24 21:58:44 +05:00
Edward
be84cab1fe add SendSoapWithTimeout 2020-05-01 22:58:33 +08:00
George Palanjyan
3eb2782699 api: fix bugs 2018-04-10 22:58:56 +03:00
George Palanjyan
3eb889f611 api: fix bugs 2018-04-10 14:20:39 +03:00
yakovlevdmv
b302c5c92b WS-security update(moved to gosoap progect), return error on HTTP digest authentification required 2018-04-10 02:59:48 +03:00
yakovlevdmv
42e62d7f52 Bugs fixed 2018-04-07 22:16:11 +03:00
yakovlevdmv
86573fc414 Some improvements added. README edited 2018-04-07 18:54:57 +03:00
yakovlevdmv
4966762ce0 README editted, reutrn error if got 404 and return error in device constructor 2018-04-07 18:22:03 +03:00
yakovlevdmv
d5ca888bc4 Added Analytics datatypes. Changing namespaces prefix at struct tags 2018-04-05 06:15:00 +03:00
George Palanjyan
c6ad810450 Fix bugs 2018-04-04 22:04:13 +03:00