Ardis Lu [Fri, 22 May 2026 05:20:18 +0000 (22:20 -0700)]
Verify `Origin` header on POST
This is security hardening against cross-origin requests. Although the server already does not send CORS headers (so web browsers should already block a cross-origin POST), there should still be a server-side `Origin` check as defense-in-depth.
Ardis Lu [Thu, 21 May 2026 05:59:14 +0000 (22:59 -0700)]
Only get passkey if actually required
Getting passkey is not required when `encrypt` is run on a file where all variables are already encrypted, or `decrypt` is run on a file where all variables are already decrypted.
Previously, the passkey flow would always initiate. Now, it will only initiate the first time it is required.
This change improves the UX in situations where `encrypt` or `decrypt` are called on a continuous basis. For example, when calling `envpass encrypt` in a `prestart` npm script hook.