mesilat / zabbix-plugin

Zabbix Plugin for Atlassian Confluence
3 stars 0 forks source link

Zabbix 6.2 API Change #3

Open Legends0 opened 1 year ago

Legends0 commented 1 year ago

Zabbix Plugin will not be compatible once 6.4 is released.

In 6.2, the use of the "user" parameter for authentication was deprecated and the addition of a "username" parameter that would be its replacement was added. As of beta 5 of 6.4, the "user" parameter no longer exists and the "username" parameter must be used instead.

In order to continue supporting Zabbix, the plugin needs to be able to use the new "username" parameter. This may require additional code for supporting multiple versions of Zabbix API such as through a try/catch, or version selection/detection.

Legends0 commented 1 year ago

Adding back the removed line on Zabbix end in file /usr/share/zabbix/include/classes/api/services/CUser.php seems to be a workaround:

public function login(array $user) {
                $api_input_rules = ['type' => API_OBJECT, 'fields' => [
                        'user' =>       ['type' => API_STRING_UTF8, 'flags' => API_DEPRECATED, 'replacement' => 'username', 'length' => 255],
                        'username' =>   ['type' => API_STRING_UTF8, 'flags' => API_REQUIRED, 'length' => 255],
                        'password' =>   ['type' => API_STRING_UTF8, 'flags' => API_REQUIRED, 'length' => 255],
                        'userData' =>   ['type' => API_FLAG]
                ]];