enumerateUsers wildcard append assumes string criteria values

Open Beginner friendly
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

enhancement

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

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

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.

Dominant language
Python
Stars
13
Forks
22
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from collective/pas.plugins.ldap

All issues in collective/pas.plugins.ldap

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.