Add backend policy tests and API client split
All checks were successful
Build and Deploy / build-and-push (push) Successful in 3m8s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 3m8s
This commit is contained in:
11
backend/utils/security.js
Normal file
11
backend/utils/security.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
const stripEnvQuotes = (value = '') => value.replace(/^"|"$/g, '');
|
||||
const hashSecret = (value) => crypto.createHash('sha256').update(value).digest('hex');
|
||||
const maskSecret = (id, value) => `masked:${id}:${value.slice(-6)}`;
|
||||
|
||||
module.exports = {
|
||||
stripEnvQuotes,
|
||||
hashSecret,
|
||||
maskSecret,
|
||||
};
|
||||
Reference in New Issue
Block a user