Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR maps the existing WebChart MySQL schema to LDAP-required format by updating field mappings and adding numeric ID derivation logic.
- Derives uidNumber and gidNumber from WebChart database fields (user_id and realm id) with +10000 offset
- Updates LDAP user entry creation to use WebChart schema fields (first_name, last_name, email)
- Refactors MySQL queries to work with WebChart's users, realms, and user_realms tables
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/utils/ldapUtils.js | Maps WebChart user fields to LDAP entry format and derives numeric IDs |
| src/db/drivers/mysql.js | Updates database queries to use WebChart schema tables and relationships |
runleveldev
left a comment
There was a problem hiding this comment.
I'm fine with this merging as-is, but I don't want to close the related Issue until we can figure out chart types with observations for at least uidNumber and gidNumber
| const uidNumber = user.uid_number !== undefined && user.uid_number !== null ? user.uid_number.toString() : "0"; | ||
| const gidNumber = user.gid_number !== undefined && user.gid_number !== null ? user.gid_number.toString() : "0"; | ||
| // 1) Prefer observation-mapped UID (ldap_uid_number) | ||
| // 2) Fallback: old behavior (user_id + 10000) |
There was a problem hiding this comment.
We don't have to worry about maintaining this compatibility. It should log a warning if the user entry in webchart doesn't have a matching uid observation and either return a LDAP entry without a uidNumber or fail and return no entry.
There was a problem hiding this comment.
On second thought, uidNumber is a MUST for posixAccount in the LDAP schema. As such, a user that doesn't have a uidNumber observation should be considered invalid and no entry should ever be returned for them. This also has the benefit of giving an implicit way to distinguish between LDAP and non-LDAP users in the Webchart system.
|
Obseleted by #104 |


DONE