fix(notification/endpoint): remove slack token requirement
parent
ed01f5a16f
commit
b933e007cb
|
|
@ -81,10 +81,7 @@ func TestValidEndpoint(t *testing.T) {
|
|||
Base: goodBase,
|
||||
URL: "localhost",
|
||||
},
|
||||
err: &influxdb.Error{
|
||||
Code: influxdb.EInvalid,
|
||||
Msg: "slack endpoint token is invalid",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
{
|
||||
name: "invalid slack token",
|
||||
|
|
|
|||
|
|
@ -33,9 +33,11 @@ func (s *Slack) BackfillSecretKeys() {
|
|||
|
||||
// SecretFields return available secret fields.
|
||||
func (s Slack) SecretFields() []influxdb.SecretField {
|
||||
return []influxdb.SecretField{
|
||||
s.Token,
|
||||
arr := []influxdb.SecretField{}
|
||||
if s.Token.Key != "" {
|
||||
arr = append(arr, s.Token)
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
// Valid returns error if some configuration is invalid
|
||||
|
|
@ -56,7 +58,7 @@ func (s Slack) Valid() error {
|
|||
}
|
||||
}
|
||||
// TODO(desa): this requirement seems odd
|
||||
if s.Token.Key != s.ID.String()+slackTokenSuffix {
|
||||
if s.Token.Key != "" && s.Token.Key != s.ID.String()+slackTokenSuffix {
|
||||
return &influxdb.Error{
|
||||
Code: influxdb.EInvalid,
|
||||
Msg: "slack endpoint token is invalid",
|
||||
|
|
|
|||
Loading…
Reference in New Issue