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
5 changes: 2 additions & 3 deletions mock.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ app.get("/cmk/v1/tenant1-id/groups", (req, res) => {
res.json(groups());
});

app.get("/cmk/v1/tenant1-id/user/:id?", (req, res) => {
const { id } = req.params;
res.json(user(id));
app.get("/cmk/v1/tenant1-id/userInfo", (req, res) => {
res.json(user());
});

app.get("/cmk/v1/tenant1-id/workflows/:taskId?", (req, res) => {
Expand Down
5 changes: 5 additions & 0 deletions mockServer/mockdata/systems.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ export default (systemId, keyConfigurationID, operation) => {
},
type: "SYSTEM"
};
} else if(systemId && !keyConfigurationID && operation === 'recoveryActions') {
return {
canCancel: true,
canRetry: false
};
}
}
19 changes: 7 additions & 12 deletions mockServer/mockdata/user.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import Chance from "chance";
const chance = new Chance();
export default (test) => {
const generateUser = (count) => {
return Array.from({ length: count }, () => (
{
id: chance.guid(),
name: chance.name(),
email: chance.email(),
groupName: chance.pickone(['KMS Admin', 'KMS Admin EU', 'KMS Admin US', 'KMS Auditor']),
}
));

export default () => {
return {
identifier: chance.guid(),
givenName: chance.name(),
familyName: chance.last(),
Comment on lines +6 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In chance@1.1.13, what is the return format of chance.name() vs chance.first(), and which is appropriate for a "givenName" field?

💡 Result:

  • chance.name() returns a full name string (e.g., "Dafi Vatemi", optionally including middle/prefix/suffix). [1]
  • chance.first() returns a first/given name string only (e.g., "Leila"). [2]

For a "givenName" field, use chance.first(). [2]

Sources: [1] [2]


Use chance.first() for givenName instead of chance.name().

Line 6 uses chance.name(), which returns a full name string. This creates a schema mismatch since givenName should contain only the given/first name, not a full name that duplicates the separate familyName on line 7.

Proposed fix
 export default () => {
     return {
         identifier: chance.guid(),
-        givenName: chance.name(),
+        givenName: chance.first(),
         familyName: chance.last(),
         email: chance.email(),
         role: chance.pickone(['KEY_ADMINISTRATOR', 'TENANT_ADMINISTRATOR', 'TENANT_AUDITOR']),
     };
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
givenName: chance.name(),
familyName: chance.last(),
export default () => {
return {
identifier: chance.guid(),
givenName: chance.first(),
familyName: chance.last(),
email: chance.email(),
role: chance.pickone(['KEY_ADMINISTRATOR', 'TENANT_ADMINISTRATOR', 'TENANT_AUDITOR']),
};
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mockServer/mockdata/user.mjs` around lines 6 - 7, The givenName field in
mockServer/mockdata/user.mjs is using chance.name() which returns a full name
and conflicts with the separate familyName field; update the givenName
assignment to use chance.first() instead of chance.name() so givenName contains
only the first/given name while familyName remains chance.last().

email: chance.email(),
role: chance.pickone(['KEY_ADMINISTRATOR', 'TENANT_ADMINISTRATOR', 'TENANT_AUDITOR']),
};
return generateUser(test);
}
22 changes: 0 additions & 22 deletions translation_v2.json

This file was deleted.

Empty file removed webapp/i18n/i18n_de.properties
Empty file.
Empty file removed webapp/i18n/i18n_es.properties
Empty file.
Empty file removed webapp/i18n/i18n_fr.properties
Empty file.
Empty file removed webapp/i18n/i18n_ja_JP.properties
Empty file.
Empty file removed webapp/i18n/i18n_pt_BR.properties
Empty file.
Empty file removed webapp/i18n/i18n_zh_CN.properties
Empty file.
Loading