openresty / encrypted-session-nginx-module

encrypt and decrypt nginx variable values
http://openresty.org
198 stars 52 forks source link

Variables are not supported for configuring the module. #22

Open rcosnita opened 4 years ago

rcosnita commented 4 years ago

It would be extremely beneficial to support variables while configuring the module. This will give us the possibility to implement rotating IV for each encrypted session.

In addition, it allows us to mix the current module nicely with other extensions: e.g njs. Here is an example about the desired behaviour:

set $encryptionKey "abcdefghijklmnopqrstuvwxyz123456";
set $encryptionIV "1234567812345678";

encrypted_session_key $encryptionKey;
encrypted_session_iv $encryptionIV;

I would expect this to work but unfortunately the code treats this literally.

rcosnita commented 4 years ago

I will provide a PR for addressing this issue.