remove config ntg token from code
This commit is contained in:
@@ -188,14 +188,19 @@ func (ntg NTGVision) Search(states []config.State) ([]Job, error) {
|
||||
return jobs, err
|
||||
}
|
||||
|
||||
func getNTGTokenKey() string {
|
||||
return "brokers_ntg_token"
|
||||
}
|
||||
|
||||
func getNTGToken() string {
|
||||
return config.Get().Brokers.NTG.Token
|
||||
db := config.Get().DB()
|
||||
b, _ := db.Get(getNTGTokenKey())
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func setNTGToken(token string) {
|
||||
conf := config.Get()
|
||||
conf.Brokers.NTG.Token = token
|
||||
config.Set(*conf)
|
||||
db := config.Get().DB()
|
||||
db.Set(getNTGTokenKey(), []byte(token))
|
||||
}
|
||||
|
||||
func (ntg NTGVision) search(states []config.State) (io.ReadCloser, error) {
|
||||
@@ -215,6 +220,7 @@ func (ntg NTGVision) search(states []config.State) (io.ReadCloser, error) {
|
||||
}
|
||||
|
||||
func (ntg NTGVision) refreshAuth() error {
|
||||
log.Printf("refreshing ntg auth...")
|
||||
b, _ := json.Marshal(map[string]string{
|
||||
"username": config.Get().Brokers.NTG.Username,
|
||||
"password": config.Get().Brokers.NTG.Password,
|
||||
|
||||
Reference in New Issue
Block a user