Client wrapper API: should provide connection context in session user password callbacks
Description
The client wrapper API provides a way to configure a callback to retrieve username and password for connections: SOPC_ClientConfigHelper_SetUserNamePasswordCallback
.
But since several connections might exist, it is necessary to provide a SOPC_SecureConnection_Config
context to be able to identify the concerned connection that might be necessary context to choose the appropriate callback input parameters.
Analysis
It is necessary to change the user name/password callback type to be able to identify the concerned connection:
typedef bool SOPC_GetClientUserNamePassword_Fct(const SOPC_SecureConnection_Config* secConnConfig,
char** outUserName,
char** outPassword);
In the same way, the user certificate/key password callback shall be modified:
typedef bool SOPC_GetClientUserKeyPassword_Fct(const SOPC_SecureConnection_Config* secConnConfig,
const char* userCertThumb, char** outPassword);
Moreover a new access function should be added to avoid the application code to access internal representation to have access to user id SOPC_SecureConnection_Config
:
const char* SOPC_ClientConfigHelper_GetUserIdFromConfig(SOPC_SecureConnection_Config* secConnConfig);