mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#1105
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/lldap/lldap/pull/1075
Author: @broeng
Created: 1/13/2025
Status: ✅ Merged
Merged: 1/22/2025
Merged by: @nitnelave
Base:
main← Head:attr-underscores📝 Commits (1)
0006ce3Add validation and error/warning messages for attribute names📊 Changes
12 files changed (+399 additions, -30 deletions)
View changed files
📝
Cargo.lock(+6 -0)📝
app/Cargo.toml(+3 -0)📝
app/src/components/create_group_attribute.rs(+8 -0)📝
app/src/components/create_user_attribute.rs(+8 -0)📝
app/src/components/fragments/attribute_schema.rs(+43 -27)📝
app/src/components/group_schema_table.rs(+1 -1)📝
app/src/components/user_schema_table.rs(+1 -1)📝
server/Cargo.toml(+3 -0)📝
server/src/infra/graphql/mutation.rs(+269 -1)➕
validation/Cargo.toml(+9 -0)➕
validation/src/attributes.rs(+45 -0)➕
validation/src/lib.rs(+3 -0)📄 Description
This commit adds support for basic validation of attribute names at creation, and also in the schema overview. Both user and group attributes are validated with the same rules.
For now, attribute names will be considered valid, if they only contain alphanumeric characters.
Validation has been added the following places:
In graphql API, for creation of both user and group attributes. Request will be rejected, if attribute name is invalid.
In frontend, before submitting a request to create a new user or group attribute. Rejection here will show an error message including a list of the invalid characters used.
As this change adds stricter validation to attributes, and, since the rationale for this is partly compatibility with other LDAP systems, this change also adds a warning in the schema overviews to any attribute using invalid characters. As this is unfortunately quite a few of the hardcoded attributes, we should probably consider listing other, valid, aliases for the same attributes instead.
Screenshots
Backend rejecting creation through GraphQL API (frontend validation disabled here for the screenshot):
Frontend rejecting creation of invalid attribute pre-submit:
Schema attribute overview showing warnings for potentially problematic attributes:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.