collective / collective/pas.plugins.ldap

enumerateUsers wildcard append assumes string criteria values

Open Beginner friendly
#148 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
13
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Found during the 2.0.0 release-readiness review (see #144).

In `enumerateUsers` (`src/pas/plugins/ldap/plugin.py`, ~line 430):

```python
if not value.endswith("*"):
kw[key] = value + "*"
```

If a caller passes a non-string criterion value (e.g. an int), `value.endswith` raises `AttributeError`. In practice PAS passes strings, so the risk is low, but a `str()` coercion / `isinstance` guard would harden it.

Severity: low / hardening.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/pas/plugins/ldap/plugin.py around enumerateUsers and inspect how criterion values are handled before the wildcard is appended. Confirm the expected behavior for non-string values, add coverage for an integer criterion, and run the relevant test suite to verify that string criteria still receive the correct wildcard handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.