1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

New builtin JWT middleware - this one supports encryption and ed25519

Former-commit-id: ca20d256b766e3e8717e91de7a3f3b5f213af0bc
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-05-27 12:02:17 +03:00
parent c866709acc
commit d556cfc39a
15 changed files with 930 additions and 19 deletions

View File

@@ -1135,26 +1135,34 @@ func getCaller() (string, int) {
n := runtime.Callers(1, pcs[:])
frames := runtime.CallersFrames(pcs[:n])
wd, _ := os.Getwd()
for {
frame, more := frames.Next()
file := filepath.ToSlash(frame.File)
if !strings.Contains(file, "_test.go") {
if strings.Contains(file, "/kataras/iris") && !strings.Contains(file, "kataras/iris/_examples") && !strings.Contains(file, "iris-contrib/examples") {
if !more {
break
}
continue
}
var (
frame runtime.Frame
more = true
)
for {
if !more {
break
}
frame, more = frames.Next()
file := filepath.ToSlash(frame.File)
// fmt.Printf("%s:%d | %s\n", file, frame.Line, frame.Function)
if strings.Contains(file, "go/src/runtime/") {
if !more {
break
}
continue
}
if !strings.Contains(file, "_test.go") {
if strings.Contains(file, "/kataras/iris") &&
!strings.Contains(file, "kataras/iris/_examples") &&
!strings.Contains(file, "kataras/iris/middleware") &&
!strings.Contains(file, "iris-contrib/examples") {
continue
}
}
if relFile, err := filepath.Rel(wd, file); err == nil {
if !strings.HasPrefix(relFile, "..") {
// Only if it's relative to this path, not parent.