@@ -68,7 +68,6 @@ int wh_AuthBase_Init(void* context, const void *config)
6868 /* add a demo user with admin permissions */
6969 rc = wh_AuthBase_UserAdd (context , "admin" , & out_user_id , permissions ,
7070 WH_AUTH_METHOD_PIN , "1234" , 4 );
71- printf ("Admin user added with ID: %d\n" , out_user_id );
7271 return rc ;
7372}
7473
@@ -215,22 +214,17 @@ int wh_AuthBase_CheckRequestAuthorization(void* context,
215214{
216215 int rc ;
217216
218- printf ("In authorization check: User ID: %d, Group: %d, Action: %d\n" ,
219- user_id , group , action );
220-
221217 if (user_id == WH_USER_ID_INVALID ) {
222218 /* allow user login request attempt */
223219 if (group == WH_MESSAGE_GROUP_AUTH ) {
224220 if (action == WH_MESSAGE_AUTH_ACTION_LOGIN ) {
225221 rc = WH_ERROR_OK ;
226222 }
227223 else {
228- printf ("User does not have permissions for the action" );
229224 rc = WH_ERROR_ACCESS ;
230225 }
231226 }
232227 else {
233- printf ("No user associated with session" );
234228 rc = WH_ERROR_OK ; /*rc = WH_ERROR_ACCESS;*/
235229 }
236230 }
@@ -254,12 +248,10 @@ int wh_AuthBase_CheckRequestAuthorization(void* context,
254248 rc = WH_ERROR_OK ;
255249 }
256250 else {
257- printf ("User does not have permissions for the action" );
258251 rc = WH_ERROR_ACCESS ;
259252 }
260253 }
261254 else {
262- printf ("User does not have permissions for the group" );
263255 rc = WH_ERROR_ACCESS ;
264256 }
265257 }
@@ -278,9 +270,6 @@ int wh_AuthBase_CheckKeyAuthorization(void* context, uint16_t user_id,
278270 int i ;
279271 whAuthBase_User * user ;
280272
281- printf ("In key authorization check: User ID: %d, Key ID: %d, Action: %d\n" ,
282- user_id , key_id , action );
283-
284273 if (user_id == WH_USER_ID_INVALID ) {
285274 return WH_ERROR_ACCESS ;
286275 }
@@ -303,10 +292,6 @@ int wh_AuthBase_CheckKeyAuthorization(void* context, uint16_t user_id,
303292 }
304293 }
305294
306- if (rc != WH_ERROR_OK ) {
307- printf ("User does not have access to the key" );
308- }
309-
310295 (void )context ;
311296 (void )action ; /* Action could be used for future fine-grained key access control */
312297 return rc ;
0 commit comments