upgrade 2.4.0: support grafana

This commit is contained in:
UlricQin 2020-05-28 20:28:48 +08:00
parent 3c1c43ae9c
commit 834669bf36
2 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
# release version
version=2.3.0
version=2.4.0
CWD=$(cd $(dirname $0)/; pwd)
cd $CWD

View File

@ -70,13 +70,11 @@ func headerUser(c *gin.Context) string {
return pair[0]
}
const internalToken = "monapi-builtin-token"
// CheckHeaderToken check thirdparty x-srv-token
func CheckHeaderToken() gin.HandlerFunc {
return func(c *gin.Context) {
token := c.GetHeader("x-srv-token")
if token != internalToken && !slice.ContainsString(config.Get().Tokens, token) {
if !slice.ContainsString(config.Get().Tokens, token) {
errors.Bomb("token[%s] invalid", token)
}
c.Next()