diff options
author | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2020-11-16 17:12:52 +0300 |
---|---|---|
committer | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2020-11-16 17:57:25 +0300 |
commit | d0a2077b844ce9fc6293f2f285befad70993d10d (patch) | |
tree | 5a82bb31142d72d0c70bf5a53949fa562a7738b6 /tests/zabbix_server | |
parent | f705dd64abd7fb5520b1585dbb4d034cdcc65f6f (diff) |
........S. [ZBXNEXT-6207] added server side auth token validation
Diffstat (limited to 'tests/zabbix_server')
-rw-r--r-- | tests/zabbix_server/trapper/Makefile.am | 3 | ||||
-rw-r--r-- | tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/zabbix_server/trapper/Makefile.am b/tests/zabbix_server/trapper/Makefile.am index 06437cbdb77..5b9d49d6bc8 100644 --- a/tests/zabbix_server/trapper/Makefile.am +++ b/tests/zabbix_server/trapper/Makefile.am @@ -44,7 +44,8 @@ zbx_trapper_preproc_test_run_LDFLAGS = @SERVER_LDFLAGS@ zbx_trapper_preproc_test_run_CFLAGS = \ -I@top_srcdir@/tests @LIBXML2_CFLAGS@ \ -Wl,--wrap=zbx_preprocessor_test \ - -Wl,--wrap=DBget_user_by_active_session + -Wl,--wrap=DBget_user_by_active_session \ + -Wl,--wrap=DBget_user_by_auth_token endif diff --git a/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c b/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c index 4f4a93d78f2..4251f28fc58 100644 --- a/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c +++ b/tests/zabbix_server/trapper/zbx_trapper_preproc_test_run.c @@ -92,6 +92,16 @@ int __wrap_DBget_user_by_active_session(const char *sessionid, zbx_user_t *user) return SUCCEED; } +int __wrap_DBget_user_by_auth_token(const char *authtoken, zbx_user_t *user) +{ + ZBX_UNUSED(authtoken); + + user->type = USER_TYPE_ZABBIX_ADMIN; + user->userid = 0; + + return SUCCEED; +} + void zbx_mock_test_entry(void **state) { const char *request; |