Fix/issue#1289 (#1460)

* fix #1289

* Add unit test case

* fix `jwtTransKey`

* fix `jwtTransKey`

Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
anqiansong
2022-01-18 11:52:30 +08:00
committed by GitHub
parent c903966fc7
commit df0f8ed59e
4 changed files with 35 additions and 0 deletions

View File

@@ -111,6 +111,17 @@ func getAuths(api *spec.ApiSpec) []string {
return authNames.KeysStr()
}
func getJwtTrans(api *spec.ApiSpec) []string {
jwtTransList := collection.NewSet()
for _, g := range api.Service.Groups {
jt := g.GetAnnotation(jwtTransKey)
if len(jt) > 0 {
jwtTransList.Add(jt)
}
}
return jwtTransList.KeysStr()
}
func getMiddleware(api *spec.ApiSpec) []string {
result := collection.NewSet()
for _, g := range api.Service.Groups {