Skip to content

Commit e5373c4

Browse files
committed
fix for key assignment
1 parent 6656b7e commit e5373c4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

wrongsecrets-balancer/src/teams/teams.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const Joi = require('@hapi/joi');
77
const expressJoiValidation = require('express-joi-validation');
88
const promClient = require('prom-client');
99
const accessPassword = process.env.REACT_APP_ACCESS_PASSWORD;
10+
const hmac_key = process.env.REACT_APP_CREATE_TEAM_HMAC_KEY || 'hardcodedkey';
1011

1112
const validator = expressJoiValidation.createValidator();
1213
const k8sEnv = process.env.K8S_ENV || 'k8s';
@@ -94,10 +95,6 @@ async function validateHMAC(req, res, next) {
9495
try {
9596
const { team } = req.params;
9697
const { hmacvalue } = req.body;
97-
var hmac_key = process.env.REACT_APP_CREATE_TEAM_HMAC_KEY;
98-
if (hmac_key === undefined || hmac_key === '') {
99-
hmac_key = 'hardcodedkey';
100-
}
10198
const validationValue = crypto
10299
.createHmac('sha256', hmac_key)
103100
.update(`${team}`, 'utf-8')

0 commit comments

Comments
 (0)