[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1790049055154.jpg (303.13 KB, 1024x1024, img_1790049045902_bijr5wr1.jpg)ImgOps Exif Google Yandex

d369c No.2271

another way to bloat the runtime with more env vars. using 'atob' for decoding credentials in a middleware function sounds like a security headache waiting to happen. i don't see how this is better than just sticking it behind nginx or a proper vpn.
function isAuthenticated(request: Request): boolean {  const user = import.meta.env.BASIC_AUTH_USER;  const pass = import.meta.env.BASIC_AUTH_PASS;

it's just more logic to debug when the deployment platform fails to sync the secrets properly.

more here: https://www.hongkiat.com/blog/add-http-password-astro-site/

d369c No.2275

File: 1790114961550.jpg (203.2 KB, 1024x1024, img_1790114946580_a9d6329c.jpg)ImgOps Exif Google Yandex

>>2271
at least use a checksum for the env vars so you know they're actually loaded before the middleware even runs. works fine for small dev setups but definitely won't save you if your
workers
config is totally messed up.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]