|
@@ -9,13 +9,13 @@
|
|
extern "C" {
|
|
extern "C" {
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#include "ua_config.h"
|
|
|
|
#include "ua_types.h"
|
|
#include "ua_types.h"
|
|
#include "ua_types_generated.h"
|
|
#include "ua_types_generated.h"
|
|
#include "ua_types_generated_handling.h"
|
|
#include "ua_types_generated_handling.h"
|
|
#include "ua_nodeids.h"
|
|
#include "ua_nodeids.h"
|
|
#include "ua_plugin_log.h"
|
|
#include "ua_plugin_log.h"
|
|
#include "ua_plugin_network.h"
|
|
#include "ua_plugin_network.h"
|
|
|
|
+#include "ua_plugin_access_control.h"
|
|
|
|
|
|
/**
|
|
/**
|
|
* .. _server:
|
|
* .. _server:
|
|
@@ -23,78 +23,10 @@ extern "C" {
|
|
* Server
|
|
* Server
|
|
* ======
|
|
* ======
|
|
*
|
|
*
|
|
- * Access Control
|
|
|
|
- * --------------
|
|
|
|
- * The access control callback is used to authenticate sessions and grant access
|
|
|
|
- * rights accordingly. */
|
|
|
|
-typedef struct {
|
|
|
|
- /* These booleans are used to create endpoints for the possible
|
|
|
|
- * authentication methods */
|
|
|
|
- UA_Boolean enableAnonymousLogin;
|
|
|
|
- UA_Boolean enableUsernamePasswordLogin;
|
|
|
|
-
|
|
|
|
- /* Authenticate a session. The session handle is attached to the session and
|
|
|
|
- * passed into the node-based access control callbacks. */
|
|
|
|
- UA_StatusCode (*activateSession)(const UA_NodeId *sessionId,
|
|
|
|
- const UA_ExtensionObject *userIdentityToken,
|
|
|
|
- void **sessionHandle);
|
|
|
|
-
|
|
|
|
- /* Deauthenticate a session and cleanup */
|
|
|
|
- void (*closeSession)(const UA_NodeId *sessionId, void *sessionHandle);
|
|
|
|
-
|
|
|
|
- /* Access control for all nodes*/
|
|
|
|
- UA_UInt32 (*getUserRightsMask)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_NodeId *nodeId);
|
|
|
|
-
|
|
|
|
- /* Additional access control for variable nodes */
|
|
|
|
- UA_Byte (*getUserAccessLevel)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_NodeId *nodeId);
|
|
|
|
-
|
|
|
|
- /* Additional access control for method nodes */
|
|
|
|
- UA_Boolean (*getUserExecutable)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_NodeId *methodId);
|
|
|
|
-
|
|
|
|
- /* Additional access control for calling a method node in the context of a
|
|
|
|
- * specific object */
|
|
|
|
- UA_Boolean (*getUserExecutableOnObject)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_NodeId *methodId,
|
|
|
|
- const UA_NodeId *objectId);
|
|
|
|
-
|
|
|
|
- /* Allow adding a node */
|
|
|
|
- UA_Boolean (*allowAddNode)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_AddNodesItem *item);
|
|
|
|
-
|
|
|
|
- /* Allow adding a reference */
|
|
|
|
- UA_Boolean (*allowAddReference)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_AddReferencesItem *item);
|
|
|
|
-
|
|
|
|
- /* Allow deleting a node */
|
|
|
|
- UA_Boolean (*allowDeleteNode)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_DeleteNodesItem *item);
|
|
|
|
-
|
|
|
|
- /* Allow deleting a reference */
|
|
|
|
- UA_Boolean (*allowDeleteReference)(const UA_NodeId *sessionId,
|
|
|
|
- void *sessionHandle,
|
|
|
|
- const UA_DeleteReferencesItem *item);
|
|
|
|
-} UA_AccessControl;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
* Server Configuration
|
|
* Server Configuration
|
|
* --------------------
|
|
* --------------------
|
|
* The configuration structure is passed to the server during initialization. */
|
|
* The configuration structure is passed to the server during initialization. */
|
|
|
|
|
|
-typedef struct {
|
|
|
|
- UA_String username;
|
|
|
|
- UA_String password;
|
|
|
|
-} UA_UsernamePasswordLogin;
|
|
|
|
-
|
|
|
|
typedef struct {
|
|
typedef struct {
|
|
UA_UInt32 min;
|
|
UA_UInt32 min;
|
|
UA_UInt32 max;
|
|
UA_UInt32 max;
|