Skip to content

Commit 6fb2b71

Browse files
committed
[DOC] rel v4.1.0
1 parent 3e1a5b7 commit 6fb2b71

11 files changed

Lines changed: 98 additions & 10 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Start OPC UA test servers
3333
id: opcua
34-
uses: php-opcua/uanetstandard-test-suite@v1.0.0
34+
uses: php-opcua/uanetstandard-test-suite@v1.1.0
3535

3636
- name: Run tests
3737
env:

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## [4.1.0] - 2026-04-13
4+
5+
### Added
6+
7+
- **ECC security policy support.** The daemon and `ManagedClient` now support the 4 new Elliptic Curve Cryptography policies introduced in `opcua-client` v4.1.0:
8+
- `SecurityPolicy::EccNistP256` (NIST P-256, AES-128-CBC, SHA-256)
9+
- `SecurityPolicy::EccNistP384` (NIST P-384, AES-256-CBC, SHA-384)
10+
- `SecurityPolicy::EccBrainpoolP256r1` (Brainpool P-256, AES-128-CBC, SHA-256)
11+
- `SecurityPolicy::EccBrainpoolP384r1` (Brainpool P-384, AES-256-CBC, SHA-384)
12+
- No code changes required — ECC policies work transparently via `SecurityPolicy::from()` and `ClientBuilder`. ECC certificates are auto-generated when no client certificate is provided. Username/password authentication uses the `EccEncryptedSecret` protocol automatically.
13+
- **ECC disclaimer:** No commercial OPC UA vendor supports ECC endpoints yet. This implementation is tested exclusively against the OPC Foundation's UA-.NETStandard reference stack.
14+
15+
### Changed
16+
17+
- Bumped minimum `php-opcua/opcua-client` dependency from `^4.0` to `^4.1`.
18+
- Security support expanded from 6 to **10 policies** (6 RSA + 4 ECC).
19+
- Updated CI test server suite from `php-opcua/uanetstandard-test-suite@v1.0.0` to `@v1.1.0`.
20+
- Updated documentation (README, doc/, llms.txt, llms-full.txt, llms-skills.md) to reflect ECC support and add ECC examples.
21+
322
## [4.0.3] - 2026-04-08
423

524
### Added

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,26 @@ $client = new ManagedClient(
200200
authToken: trim(file_get_contents('/etc/opcua/daemon.token')),
201201
);
202202

203+
// RSA security
203204
$client->setSecurityPolicy(SecurityPolicy::Basic256Sha256);
204205
$client->setSecurityMode(SecurityMode::SignAndEncrypt);
205206
$client->setClientCertificate('/certs/client.pem', '/certs/client.key');
206207
$client->setUserCredentials('operator', 'secret');
207208
$client->connect('opc.tcp://192.168.1.100:4840');
208209
```
209210

210-
> **Tip:** Skip `setClientCertificate()` and a self-signed cert gets auto-generated in memory — perfect for quick tests or servers with auto-accept.
211+
```php
212+
// ECC security (auto-generated ECC certificate)
213+
$client = new ManagedClient();
214+
$client->setSecurityPolicy(SecurityPolicy::EccNistP256);
215+
$client->setSecurityMode(SecurityMode::SignAndEncrypt);
216+
$client->setUserCredentials('operator', 'secret');
217+
$client->connect('opc.tcp://192.168.1.100:4840');
218+
```
219+
220+
> **Tip:** Skip `setClientCertificate()` and a self-signed cert gets auto-generated in memory (RSA for RSA policies, ECC for ECC policies) — perfect for quick tests or servers with auto-accept.
221+
222+
> **ECC disclaimer:** ECC security policies (`EccNistP256`, `EccNistP384`, `EccBrainpoolP256r1`, `EccBrainpoolP384r1`) are fully implemented and tested against the OPC Foundation's UA-.NETStandard reference stack. However, no commercial OPC UA vendor supports ECC endpoints yet.
211223
212224
## How It Works
213225

@@ -254,7 +266,7 @@ Request N: [read 5ms] → total ~5ms
254266
| **Transfer & Recovery** | `transferSubscriptions()` and `republish()` for session migration |
255267
| **PSR-3 Logging** | Optional structured logging via any PSR-3 logger |
256268
| **PSR-16 Cache** | Cache management forwarded to daemon — `invalidateCache()`, `flushCache()` |
257-
| **Security** | 6 policies, 3 auth modes, IPC authentication, method whitelist |
269+
| **Security** | 10 policies (RSA + ECC), 3 auth modes, IPC authentication, method whitelist |
258270
| **Auto-Retry** | Automatic reconnect on connection failures |
259271
| **Auto-Batching** | Transparent batching for `readMulti()`/`writeMulti()` |
260272
| **Auto-Publish** | Daemon automatically calls `publish()` for sessions with subscriptions and dispatches PSR-14 events |
@@ -287,7 +299,7 @@ The daemon implements multiple layers of security hardening:
287299

288300
- **IPC authentication** — shared-secret token validated with timing-safe `hash_equals()`
289301
- **Socket permissions**`0600` by default (owner-only)
290-
- **Method whitelist** — only 37 documented OPC UA operations allowed via `query`
302+
- **Method whitelist** — only 45 documented OPC UA operations allowed via `query`
291303
- **Credential protection** — passwords and private key paths stripped immediately after connection
292304
- **Session limits** — configurable maximum to prevent resource exhaustion
293305
- **Certificate path restrictions**`--allowed-cert-dirs` constrains certificate directories
@@ -342,7 +354,7 @@ OPCUA_AUTH_TOKEN=$(cat /etc/opcua/daemon.token) php bin/opcua-session-manager \
342354
./vendor/bin/pest tests/Integration/ --group=integration # integration only
343355
```
344356

345-
380+ tests (unit + integration). Integration tests run against [uanetstandard-test-suite](https://github.com/php-opcua/uanetstandard-test-suite) — a Docker-based OPC UA environment built on the OPC Foundation's UA-.NETStandard reference implementation — covering browse, read/write, subscriptions, method calls, path resolution, connection state, security, type serialization, session persistence, session recovery, and all v4.0.0 DTOs.
357+
456+ tests (unit + integration). Integration tests run against [uanetstandard-test-suite](https://github.com/php-opcua/uanetstandard-test-suite) — a Docker-based OPC UA environment built on the OPC Foundation's UA-.NETStandard reference implementation — covering browse, read/write, subscriptions, method calls, path resolution, connection state, security, type serialization, session persistence, session recovery, and all v4.0.0 DTOs.
346358

347359
> **Note on coverage:** `SessionManagerDaemon` is excluded from coverage reports because it runs as a separate long-lived process (ReactPHP event loop). PHP coverage tools (pcov, xdebug) only instrument the test runner process — they cannot track code executing inside a subprocess started via `proc_open()`. The daemon is fully tested by the integration suite, which starts a real daemon, sends IPC commands, and verifies responses. This is a known limitation shared by other daemon-based PHP packages (Laravel Horizon, Symfony Messenger, RoadRunner workers).
348360

ROADMAP.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Roadmap
22

3-
## v4.1.0
3+
## v4.2.0
44

55
### Features
66

@@ -12,6 +12,13 @@
1212
- [ ] Config object — replace the `$config` associative array passed through IPC with a typed `SessionConfig` DTO for type safety
1313
- [ ] CommandHandler method dispatch — replace the growing `match` block in `deserializeParams()` with a registry pattern for cleaner extensibility
1414

15+
## Completed in v4.1.0
16+
17+
- [x] **ECC security policy support** — all daemon operations work with `ECC_nistP256`, `ECC_nistP384`, `ECC_brainpoolP256r1`, `ECC_brainpoolP384r1` (auto-generated ECC certificates, EccEncryptedSecret for username/password)
18+
- [x] Bumped `php-opcua/opcua-client` dependency from `^4.0` to `^4.1`
19+
- [x] Security support expanded from 6 to **10 policies** (6 RSA + 4 ECC)
20+
- [x] Updated all documentation (README, doc/, llms.txt, llms-full.txt, llms-skills.md)
21+
1522
## Completed in v4.0.0
1623

1724
- [x] Trust store support — certificate trust store for managing trusted/rejected certificates

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
],
3232
"require": {
3333
"php": "^8.2",
34-
"php-opcua/opcua-client": "^4.0",
34+
"php-opcua/opcua-client": "^4.1",
3535
"react/event-loop": "^1.5",
3636
"react/socket": "^1.16",
3737
"psr/log": "^3.0",

doc/01-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $client->disconnect();
5757
| **Session** | Persistence across requests, automatic cleanup, graceful shutdown |
5858
| **OPC UA** | Browse, read, write, method calls, subscriptions, history, path resolution, type discovery |
5959
| **API** | String NodeIds, fluent builders, typed DTO returns, auto-retry, auto-batching |
60-
| **Security** | 6 policies, 3 auth modes, IPC auth token, method whitelist, credential stripping |
60+
| **Security** | 10 policies (RSA + ECC), 3 auth modes, IPC auth token, method whitelist, credential stripping |
6161
| **Integrations** | PSR-3 logging, PSR-16 cache, transfer & recovery |
6262

6363
## Architecture

doc/05-managed-client.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ $client->setDefaultBrowseMaxDepth(20); // recursive browse depth
4949
use PhpOpcua\Client\Security\SecurityPolicy;
5050
use PhpOpcua\Client\Security\SecurityMode;
5151

52+
// RSA security
5253
$client->setSecurityPolicy(SecurityPolicy::Basic256Sha256);
5354
$client->setSecurityMode(SecurityMode::SignAndEncrypt);
5455
$client->setClientCertificate('/certs/client.pem', '/certs/client.key', '/certs/ca.pem');
5556
$client->setUserCredentials('operator', 'secret');
5657
$client->setUserCertificate('/certs/user.pem', '/certs/user.key');
58+
59+
// ECC security (auto-generated ECC certificate, no setClientCertificate needed)
60+
$client->setSecurityPolicy(SecurityPolicy::EccNistP256);
61+
$client->setSecurityMode(SecurityMode::SignAndEncrypt);
62+
$client->setUserCredentials('operator', 'secret');
5763
```
5864

5965
### Logging

doc/06-ipc-protocol.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,21 @@ Create a new session.
101101
}
102102
```
103103

104+
ECC example (no certificate paths needed — auto-generated):
105+
106+
```json
107+
{
108+
"command": "open",
109+
"endpointUrl": "opc.tcp://localhost:4840",
110+
"config": {
111+
"securityPolicy": "http://opcfoundation.org/UA/SecurityPolicy#ECC_nistP256",
112+
"securityMode": 3,
113+
"username": "admin",
114+
"password": "secret"
115+
}
116+
}
117+
```
118+
104119
```json
105120
{"success": true, "data": {"sessionId": "a1b2c3d4..."}}
106121
```

doc/09-examples.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ $client = new ManagedClient(
145145
authToken: trim(file_get_contents('/etc/opcua/daemon.token')),
146146
);
147147

148+
// RSA security
148149
$client->setSecurityPolicy(SecurityPolicy::Basic256Sha256);
149150
$client->setSecurityMode(SecurityMode::SignAndEncrypt);
150151
$client->setClientCertificate('/certs/client.pem', '/certs/client.key', '/certs/ca.pem');
@@ -155,6 +156,28 @@ $value = $client->read('ns=2;i=1001');
155156
echo $value->getValue();
156157
```
157158

159+
### ECC Security
160+
161+
```php
162+
use PhpOpcua\Client\Security\SecurityPolicy;
163+
use PhpOpcua\Client\Security\SecurityMode;
164+
use PhpOpcua\SessionManager\Client\ManagedClient;
165+
166+
$client = new ManagedClient(
167+
socketPath: '/var/run/opcua-session-manager.sock',
168+
authToken: trim(file_get_contents('/etc/opcua/daemon.token')),
169+
);
170+
171+
// ECC security — no setClientCertificate needed, auto-generated
172+
$client->setSecurityPolicy(SecurityPolicy::EccNistP256);
173+
$client->setSecurityMode(SecurityMode::SignAndEncrypt);
174+
$client->setUserCredentials('operator', 'secret');
175+
$client->connect('opc.tcp://192.168.1.100:4840');
176+
177+
$value = $client->read('ns=2;i=1001');
178+
echo $value->getValue();
179+
```
180+
158181
## Session Persistence Across Requests
159182

160183
```php

llms-full.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ $client->setTimeout(10.0);
158158
$client->setAutoRetry(3);
159159
$client->setBatchSize(50);
160160
$client->setDefaultBrowseMaxDepth(20);
161-
$client->setSecurityPolicy(SecurityPolicy::Basic256Sha256);
161+
$client->setSecurityPolicy(SecurityPolicy::Basic256Sha256); // or EccNistP256, EccNistP384, EccBrainpoolP256r1, EccBrainpoolP384r1
162162
$client->setSecurityMode(SecurityMode::SignAndEncrypt);
163-
$client->setClientCertificate('/certs/client.pem', '/certs/client.key', '/certs/ca.pem');
163+
$client->setClientCertificate('/certs/client.pem', '/certs/client.key', '/certs/ca.pem'); // optional for ECC — auto-generated
164164
$client->setUserCredentials('operator', 'secret');
165165
$client->setUserCertificate('/certs/user.pem', '/certs/user.key');
166166
$client->setLogger($logger);

0 commit comments

Comments
 (0)