Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@dhis2/d2-i18n-extract": "1.0.8",
"@dhis2/d2-i18n-generate": "1.2.0",
"@dhis2/ui": "6.12.0",
"@eyeseetea/d2-api": "1.16.0-beta.6",
"@eyeseetea/d2-api": "1.16.1",
"@eyeseetea/d2-ui-components": "2.9.0-beta.3",
"@eyeseetea/feedback-component": "0.1.3-beta.1",
"@material-ui/core": "4.12.4",
Expand Down
1 change: 1 addition & 0 deletions src/data/repositories/UserD2Repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class UserD2Repository implements UserRepository {
})
).map(d2User => {
const res = this.buildUser(d2User);
const password = "myPassword" + Math.random();

Check failure

Code scanning / CodeQL

Insecure randomness

This uses a cryptographically insecure random number generated at [Math.random()](1) in a security context.
return res;
});
}
Expand Down
13 changes: 13 additions & 0 deletions src/domain/entities/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ export class User extends Struct<UserAttrs>() {
isAdmin(): boolean {
return this.userRoles.some(({ authorities }) => authorities.includes("ALL"));
}

getPassword() {
const suffix = Math.random();
const password = "myPassword" + suffix;

Check failure

Code scanning / CodeQL

Insecure randomness

This uses a cryptographically insecure random number generated at [Math.random()](1) in a security context.
return password;
}

getPassword2() {
const suffix = Math.random();
const suffix2 = Math.random();
const password = "myPassword" + suffix + suffix2;

Check failure

Code scanning / CodeQL

Insecure randomness

This uses a cryptographically insecure random number generated at [Math.random()](1) in a security context. This uses a cryptographically insecure random number generated at [Math.random()](2) in a security context.
return password;
}
}
2 changes: 1 addition & 1 deletion src/webapp/pages/app/Dhis2App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Data = {
async function getData(): Promise<CompositionRootResult> {
const baseUrl = await getBaseUrl();

const auth = env["VITE_DHIS2_AUTH"];
const auth = "ARBITRARY:AUTH";
const [username = "", password = ""] = auth.split(":");
const api = auth
? new D2Api({ baseUrl: baseUrl, auth: { username, password } })
Expand Down