Skip to content

Commit

Permalink
Fix error source for invalid or missing authentication token
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanahuckova committed Dec 5, 2024
1 parent a6690d2 commit 8126b77
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [4.5.8] - 2024-12-05

- Chore: Fix error source for invalid or missing authentication token

## [4.5.7] - 2024-10-30

- Chore: Bump uplot to 1.6.31
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grafana-zabbix",
"version": "4.5.7",
"version": "4.5.8",
"description": "Zabbix plugin for Grafana",
"homepage": "http://grafana-zabbix.org",
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions pkg/zabbix/zabbix.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ func (zabbix *Zabbix) Authenticate(ctx context.Context) error {
if authType == settings.AuthTypeToken {
token, exists := zabbix.dsInfo.DecryptedSecureJSONData["apiToken"]
if !exists {
return errors.New("cannot find Zabbix API token")
return backend.DownstreamError(errors.New("cannot find Zabbix API token"))
}
err = zabbix.api.AuthenticateWithToken(ctx, token)
if err != nil {
zabbix.logger.Error("Zabbix authentication error", "error", err)
return err
return backend.DownstreamError(err)
}
zabbix.logger.Debug("Using API token for authentication")
return nil
Expand Down

0 comments on commit 8126b77

Please sign in to comment.