aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-18 22:45:06 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-18 22:45:06 +0100
commit74f18c6264618187386a5dc8b1152faa8727bf53 (patch)
treef3e233f6d79f6f0b8a9758aefb91ff3731793dee /src/common.h
parent5f5e172cd2392952162398c85b07e6f6b7e69398 (diff)
downloadBobinkCOpcUa-74f18c6264618187386a5dc8b1152faa8727bf53.tar.gz
BobinkCOpcUa-74f18c6264618187386a5dc8b1152faa8727bf53.zip
Extract configureAccessControl() into common
The access-control switch block was duplicated in server_lds.c and server_register.c. Move it to a shared helper in common.c with a Doxygen block that consolidates the rationale from both call sites.
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index b8643d7..63fa683 100644
--- a/src/common.h
+++ b/src/common.h
@@ -247,6 +247,23 @@ UA_StatusCode createSecureClientConfig (UA_ClientConfig *cc,
const SecurityConfig *sec,
const AuthConfig *auth);
+/**
+ * @brief Configures server access control from an AuthConfig.
+ *
+ * UA_ServerConfig_setDefaultWithSecureSecurityPolicies installs
+ * certificate-only authentication by default. This function
+ * overrides that with the desired policy: anonymous, username/password,
+ * or X509 certificate. For AUTH_CERT the sessionPKI verifier set by
+ * createServer is preserved, so UA_AccessControl_default automatically
+ * advertises the X509 certificate token policy.
+ *
+ * @param config Server configuration to modify.
+ * @param auth Authentication configuration.
+ * @return UA_STATUSCODE_GOOD on success, error code otherwise.
+ */
+UA_StatusCode configureAccessControl (UA_ServerConfig *config,
+ const AuthConfig *auth);
+
/* ========================================================================
* Output Formatting
* ======================================================================== */