ory / oathkeeper

A cloud native Identity & Access Proxy / API (IAP) and Access Control Decision API that authenticates, authorizes, and mutates incoming HTTP(s) requests. Inspired by the BeyondCorp / Zero Trust white paper. Written in Go.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=hydra
Apache License 2.0
3.2k stars 349 forks source link

chore: bump golang-jwt to v5 #1171

Open David-Wobrock opened 2 weeks ago

David-Wobrock commented 2 weeks ago

The rationale behind this update is that we see an ever increasing memory usage on our Oathkeeper instances, until they OOM and we start a new one.

From some pprof analysis in our prod environment, seems to indicate that it's in MutatorIDToken.Mutate that the issue lies. More specifically when signing the token string.

Screenshot 2024-06-25 at 17 26 37

In golang-jwt v5, this method does not use strings.Join anymore. See https://github.com/golang-jwt/jwt/pull/115

I'm entirely sure to understand why string joining could cause this issue, perhaps some reference that Oathkeeper is keeping and therefore leads to this memory leak 🤷 But in any case, we believe it's a good thing to keep dependencies up-to-date and use the latest version.

Let me know what you think :)

Checklist

Further Comments