Skip to content

Commit a1c6d4c

Browse files
authored
Merge pull request #283 from OWASP/fix-and-update
Fixes for react components and other items
2 parents 3112194 + 000dee6 commit a1c6d4c

File tree

9 files changed

+21
-16
lines changed

9 files changed

+21
-16
lines changed

helm/wrongsecrets-ctf-party/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ balancer:
3939
# -- Set this to a fixed random alpa-numeric string (recommended length 24 chars). If not set this get randomly generated with every helm upgrade, each rotation invalidates all active cookies / sessions requirering users to login again.
4040
cookieParserSecret: null
4141
repository: jeroenwillemsen/wrongsecrets-balancer
42-
tag: 1.6.5aws
42+
tag: 1.6.6aws
4343
# -- Number of replicas of the wrongsecrets-balancer deployment. Changing this in a commit? PLEASE UPDATE THE GITHUB WORKLFOWS THEN!(NUMBER OF "TRUE")
4444
replicas: 2
4545
# -- Port to expose on the balancer pods which the container listens on
@@ -142,7 +142,7 @@ wrongsecrets:
142142
maxInstances: 500
143143
# -- Wrongsecrets Image to use
144144
image: jeroenwillemsen/wrongsecrets
145-
tag: 1.6.5-no-vault
145+
tag: 1.6.7RC1-no-vault
146146
# -- Change the key when hosting a CTF event. This key gets used to generate the challenge flags. See: https://github.com/OWASP/wrongsecrets#ctf
147147
ctfKey: "[email protected]!9uR_K!NfkkTr"
148148
# -- Specify a custom Wrongsecrets config.yaml. See the Wrongsecrets Docs for any needed ENVs: https://github.com/OWASP/wrongsecrets
@@ -204,7 +204,7 @@ virtualdesktop:
204204
maxInstances: 500
205205
# -- Juice Shop Image to use
206206
image: jeroenwillemsen/wrongsecrets-desktop-k8s
207-
tag: 1.6.5
207+
tag: 1.6.6
208208
repository: commjoenie/wrongSecrets
209209
resources:
210210
request:

wrongsecrets-balancer/src/proxy/proxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async function updateLastConnectTimestamp(req, res, next) {
105105
*/
106106
function proxyTrafficToJuiceShop(req, res) {
107107
const teamname = req.teamname;
108-
const regex = new RegExp('^[a-z0-9]([-a-z0-9])+[a-z0-9]$', 'i');
108+
const regex = new RegExp('^[a-z0-9-]+$');
109109
if (!regex.test(teamname)) {
110110
logger.info(`Got malformed teamname: ${teamname}s`);
111111
return res.redirect('/balancer/');
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import App from './App';
44

55
it('renders without crashing', () => {
6-
const div = document.createElement('div');
7-
ReactDOM.render(<App />, div);
8-
ReactDOM.unmountComponentAtNode(div);
6+
const container = document.getElementById('div');
7+
const root = createRoot(container); // createRoot(container!) if you use TypeScript
8+
root.render(<App tab="home" />);
9+
910
});

wrongsecrets-balancer/ui/src/cards/InstanceRestartingCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl';
66
import { BodyCard, CenteredCard, Button } from '../Components';
77
import { Spinner } from '../Spinner';
88

9-
const LinkButton = Button.withComponent('a');
9+
const LinkButton = styled(Button).attrs({ as: 'a' })``;;
1010

1111
const CenteredText = styled.span`
1212
text-align: center;

wrongsecrets-balancer/ui/src/cards/InstanceStatusCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import promiseRetry from 'promise-retry';
77
import { BodyCard, CenteredCard, Button } from '../Components';
88
import { Spinner } from '../Spinner';
99

10-
const LinkButton = Button.withComponent('a');
10+
const LinkButton = styled(Button).attrs({ as: 'a' })``;;
1111

1212
const CenteredText = styled.span`
1313
text-align: center;

wrongsecrets-balancer/ui/src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import App from './App';
4-
ReactDOM.render(<App />, document.getElementById('root'));
4+
5+
const container = document.getElementById('root');
6+
const root = createRoot(container);
7+
root.render(<App tab="home" />);

wrongsecrets-balancer/ui/src/pages/JoinPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export const JoinPage = injectIntl(({ intl }) => {
229229
name="teamname"
230230
value={teamname}
231231
title={formatMessage(messages.teamnameValidationConstraints)}
232-
pattern="^[a-z0-9]([-a-z0-9])+[a-z0-9]$"
232+
pattern="^[a-z0-9][a-z0-9\-]+[a-z0-9]$"
233233
maxLength="16"
234234
onChange={({ target }) => setTeamname(target.value)}
235235
/>

wrongsecrets-balancer/ui/src/translations/de-DE.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ const germanTranslations = {
44
getting_started: "Los geht's",
55
join_failed_text: 'Das team konnte nicht erstellt / beigetreten werden.',
66
teamname: 'Teamname',
7-
teamname_validation_constraints:
8-
"Teamname muss aus kleinen Buchstaben, Nummern oder einem '-' bestehen",
7+
teamname_validation_constraints: 'Teamname muss aus kleinen Buchstaben, Nummern oder einem - bestehen',
98
create_or_join_team_label: 'Team erstellen / beitreten',
109
change_language: 'Sprache ändern',
1110
joining_team: 'Team {team} beitreten',
@@ -37,6 +36,7 @@ const germanTranslations = {
3736
'admin_table.noActiveTeams': 'Keine aktiven Teams',
3837
'admin_table.restarting': 'Wird neu gestartet',
3938
'admin_table.restart': 'Neustarten',
39+
'welcome_title': 'Wilkommen!'
4040
};
4141

4242
export default germanTranslations;

wrongsecrets-balancer/ui/src/translations/nl-NL.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const dutchTranslations = {
44
getting_started: 'Starten',
55
join_failed_text: 'Het team kan niet hersteld of bereikt worden.',
66
teamname: 'Teamnaam',
7-
teamname_validation_constraints: "Teamnaam moet uit kleine letters, nummers of '-' bestaan",
7+
teamname_validation_constraints: 'Teamnaam moet uit kleine letters, nummers of - bestaan',
88
create_or_join_team_label: 'Team aanmaken of joinen',
99
change_language: 'Kies taal',
1010
joining_team: 'Team {team} joinen',
@@ -30,6 +30,7 @@ const dutchTranslations = {
3030
'admin_table.noActiveTeams': 'Geen actieve teams',
3131
'admin_table.restarting': 'Wordt nu opnieuw gestart',
3232
'admin_table.restart': 'Herstarten',
33+
'welcome_title': "Welkom!",
3334
};
3435

3536
export default dutchTranslations;

0 commit comments

Comments
 (0)