TeslaGov / ngx-http-auth-jwt-module

Secure your NGINX locations with JWT
MIT License
309 stars 118 forks source link

PEM key file support #56

Closed penumbra23 closed 2 years ago

penumbra23 commented 3 years ago
penumbra23 commented 2 years ago

@fitzyjoe I've updated the code and refactored (a bit). First idea was to have a static keyBin variable to hold the key upon config merging. That was quite okay for one location, but as soon as I added two location with different keyfile, both locations were using the last one loaded...

Now the location config has a (kinda) private _auth_jwt_keyfile field holding the key data and keysize for each specified location block. It's loaded on config merging and reused on each request to improve the performance a bit.

Hope it's okay now, leave more comments because we're using this plugin heavily!