Auth: Able to use API tokens for authentication (#1662)
* Auth: Able to use API tokens for authentication * Update change log
This commit is contained in:
@@ -3,10 +3,12 @@ package settings
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/alexanderzobnin/grafana-zabbix/pkg/gtime"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/alexanderzobnin/grafana-zabbix/pkg/gtime"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
)
|
||||
|
||||
func ReadZabbixSettings(dsInstanceSettings *backend.DataSourceInstanceSettings) (*ZabbixDatasourceSettings, error) {
|
||||
@@ -17,6 +19,10 @@ func ReadZabbixSettings(dsInstanceSettings *backend.DataSourceInstanceSettings)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if zabbixSettingsDTO.AuthType == "" {
|
||||
zabbixSettingsDTO.AuthType = AuthTypeUserLogin
|
||||
}
|
||||
|
||||
if zabbixSettingsDTO.TrendsFrom == "" {
|
||||
zabbixSettingsDTO.TrendsFrom = "7d"
|
||||
}
|
||||
@@ -65,6 +71,7 @@ func ReadZabbixSettings(dsInstanceSettings *backend.DataSourceInstanceSettings)
|
||||
}
|
||||
|
||||
zabbixSettings := &ZabbixDatasourceSettings{
|
||||
AuthType: zabbixSettingsDTO.AuthType,
|
||||
Trends: zabbixSettingsDTO.Trends,
|
||||
TrendsFrom: trendsFrom,
|
||||
TrendsRange: trendsRange,
|
||||
|
||||
Reference in New Issue
Block a user