mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
Update .gitignore and mask 'secret' in settings API
Added /cache, /redis, and /pgdata to .gitignore to prevent committing local data directories. Updated the admin settings API to also mask values for keys containing 'secret' in addition to other sensitive keys.
This commit is contained in:
+4
-1
@@ -48,4 +48,7 @@ next-env.d.ts
|
||||
/media
|
||||
|
||||
/src/generated/prisma
|
||||
/RMAB
|
||||
/RMAB
|
||||
/cache
|
||||
/redis
|
||||
/pgdata
|
||||
@@ -17,7 +17,7 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
// Mask sensitive values
|
||||
const maskValue = (key: string, value: string | null | undefined) => {
|
||||
const sensitiveKeys = ['token', 'api_key', 'password'];
|
||||
const sensitiveKeys = ['token', 'api_key', 'password', 'secret'];
|
||||
if (value && sensitiveKeys.some((k) => key.includes(k))) {
|
||||
return '••••••••••••';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user