S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_user_manager.h
Go to the documentation of this file.
1/*
2 * Licensed to Systerel under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work
4 * for additional information regarding copyright ownership.
5 * Systerel licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this
7 * file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
33#ifndef SOPC_USER_MANAGER_H_
34#define SOPC_USER_MANAGER_H_
35
36#include <stdbool.h>
37
38#include "sopc_builtintypes.h"
39#include "sopc_pki_decl.h"
40#include "sopc_user.h"
41
44
54
60
75
78 SOPC_UserAuthentication_Manager* authenticationManager,
79 const SOPC_ExtensionObject* pUser,
80 SOPC_UserAuthentication_Status* pUserAuthenticated);
81
86 const SOPC_NodeId* nodeId,
87 uint32_t attributeId,
88 const SOPC_User* pUser,
89 bool* pbOperationAuthorized);
90
118
147
159
168
183 const SOPC_ExtensionObject* pUser,
184 SOPC_UserAuthentication_Status* pUserAuthenticated);
185
190
206 const SOPC_NodeId* nodeId,
207 uint32_t attributeId,
208 bool* pbOperationAuthorized);
211
214
217
220
233 const SOPC_ExtensionObject* pUserIdentity,
234 SOPC_UserAuthorization_Manager* authorizationManager);
235
246 SOPC_UserAuthorization_Manager* authorizationManager);
247
250 SOPC_UserWithAuthorization* userWithAuthorization);
251
254
257
258#endif /* SOPC_USER_MANAGER_H_ */
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
Defines the common declarations for the PKI objects. The structures and macros defined in this file a...
Defines the logged-in (server-side) user.
struct SOPC_User SOPC_User
Logged in (successfully) user structure.
Definition sopc_user.h:40
void SOPC_UserWithAuthorization_Free(SOPC_UserWithAuthorization **ppUserWithAuthorization)
Free a SOPC_UserWithAuthorization and its embedded user when needed.
struct SOPC_UserAuthentication_Functions SOPC_UserAuthentication_Functions
SOPC_ReturnStatus SOPC_UserAuthentication_ValidateUserIdentity_Func(SOPC_UserAuthentication_Manager *authenticationManager, const SOPC_ExtensionObject *pUser, SOPC_UserAuthentication_Status *pUserAuthenticated)
Definition sopc_user_manager.h:77
SOPC_ReturnStatus SOPC_UserAuthorization_IsAuthorizedOperation(SOPC_UserWithAuthorization *userWithAuthorization, SOPC_UserAuthorization_OperationType operationType, const SOPC_NodeId *nodeId, uint32_t attributeId, bool *pbOperationAuthorized)
Authorize an operation with the chosen authorization manager.
void SOPC_UserAuthentication_PKIProviderUpdateCb(uintptr_t updateParam)
Callback instance to be used on user PKI update.
SOPC_UserAuthorization_Manager * SOPC_UserWithAuthorization_GetManager(SOPC_UserWithAuthorization *userWithAuthorization)
Return the user part of the user with authorization manager.
SOPC_UserWithAuthorization * SOPC_UserWithAuthorization_CreateFromIdentityToken(const SOPC_ExtensionObject *pUserIdentity, SOPC_UserAuthorization_Manager *authorizationManager)
Creates a SOPC_UserWithAuthorization from an OpcUa_IdentityToken and an authorization manager.
const SOPC_User * SOPC_UserWithAuthorization_GetUser(SOPC_UserWithAuthorization *userWithAuthorization)
Return the authorization manager associated with the user.
SOPC_ReturnStatus SOPC_UserAuthorization_AuthorizeOperation_Func(SOPC_UserAuthorization_Manager *authorizationManager, SOPC_UserAuthorization_OperationType operationType, const SOPC_NodeId *nodeId, uint32_t attributeId, const SOPC_User *pUser, bool *pbOperationAuthorized)
Definition sopc_user_manager.h:83
void SOPC_UserAuthorization_Free_Func(SOPC_UserAuthorization_Manager *authorizationManager)
Definition sopc_user_manager.h:82
void SOPC_UserAuthentication_Free_Func(SOPC_UserAuthentication_Manager *authenticationManager)
Definition sopc_user_manager.h:76
SOPC_ReturnStatus SOPC_UserAuthentication_IsValidUserIdentity(SOPC_UserAuthentication_Manager *authenticationManager, const SOPC_ExtensionObject *pUser, SOPC_UserAuthentication_Status *pUserAuthenticated)
Authenticate a user with the chosen authentication manager.
struct SOPC_UserAuthorization_Functions SOPC_UserAuthorization_Functions
SOPC_UserAuthentication_Status
The user authentication status code, see SOPC_UserAuthentication_IsValidUserIdentity.
Definition sopc_user_manager.h:63
@ SOPC_USER_AUTHENTICATION_OK
Definition sopc_user_manager.h:73
@ SOPC_USER_AUTHENTICATION_ACCESS_DENIED
Definition sopc_user_manager.h:71
@ SOPC_USER_AUTHENTICATION_SIGNATURE_INVALID
Definition sopc_user_manager.h:72
@ SOPC_USER_AUTHENTICATION_REJECTED_TOKEN
Definition sopc_user_manager.h:65
@ SOPC_USER_AUTHENTICATION_INVALID_TOKEN
Definition sopc_user_manager.h:64
SOPC_UserAuthorization_OperationType
The operation type to authorize, see SOPC_UserAuthorization_IsAuthorizedOperation.
Definition sopc_user_manager.h:47
@ SOPC_USER_AUTHORIZATION_OPERATION_EXECUTABLE
Definition sopc_user_manager.h:51
@ SOPC_USER_AUTHORIZATION_OPERATION_WRITE
Definition sopc_user_manager.h:49
@ SOPC_USER_AUTHORIZATION_OPERATION_READ
Definition sopc_user_manager.h:48
@ SOPC_USER_AUTHORIZATION_OPERATION_ADDNODE
Definition sopc_user_manager.h:52
void SOPC_UserAuthorization_FreeManager(SOPC_UserAuthorization_Manager **ppAuthorizationManager)
Deletes a SOPC_UserAuthorization_Manager using its pFuncFree.
void SOPC_UserAuthentication_FreeManager(SOPC_UserAuthentication_Manager **ppAuthenticationManager)
Deletes a SOPC_UserAuthentication_Manager using its pFuncFree.
SOPC_UserAuthorization_Manager * SOPC_UserAuthorization_CreateManager_AllowAll(void)
A helper implementation that always authorize an operation.
SOPC_UserAuthentication_Manager * SOPC_UserAuthentication_CreateManager_AllowAll(void)
A helper implementation that always authentication positively a user.
SOPC_UserWithAuthorization * SOPC_UserWithAuthorization_CreateLocal(SOPC_UserAuthorization_Manager *authorizationManager)
Creates a SOPC_UserWithAuthorization for a local user.
An ExtensionObject is a container for any Structured DataTypes which cannot be encoded as one of the ...
Definition sopc_builtintypes.h:262
This structure describes a basic NodeID in OPC UA.
Definition sopc_builtintypes.h:189
The PKIProvider object for the Public Key Infrastructure.
Definition sopc_pki_struct_lib_internal.h:39
Definition sopc_user_manager.h:92
SOPC_UserAuthentication_ValidateUserIdentity_Func * pFuncValidateUserIdentity
Called to authorize a user connection, when receiving an ActivateSession request.
Definition sopc_user_manager.h:116
SOPC_UserAuthentication_Free_Func * pFuncFree
Deallocation function, called upon SOPC_UserAuthentication_Manager destruction.
Definition sopc_user_manager.h:98
Definition sopc_user_manager.h:149
const SOPC_UserAuthentication_Functions * pFunctions
Definition sopc_user_manager.h:151
void * pData
Definition sopc_user_manager.h:157
SOPC_PKIProvider * pUsrPKI
Definition sopc_user_manager.h:154
Definition sopc_user_manager.h:120
SOPC_UserAuthorization_Free_Func * pFuncFree
Deallocation function, called upon SOPC_UserAuthorization_Manager destruction.
Definition sopc_user_manager.h:126
SOPC_UserAuthorization_AuthorizeOperation_Func * pFuncAuthorizeOperation
Called to authorize a read or a write operation in the address space.
Definition sopc_user_manager.h:145
Definition sopc_user_manager.h:161
const SOPC_UserAuthorization_Functions * pFunctions
Definition sopc_user_manager.h:163
void * pData
Definition sopc_user_manager.h:166
Definition sopc_user_manager_internal.h:31
SOPC_UserAuthorization_Manager * authorizationManager
Definition sopc_user_manager_internal.h:33