Skip to content

Allow for toggling of LDAP attribute ordering - #68628

Draft
tacerus wants to merge 2 commits into
saltstack:3008.xfrom
tacerus:ldap-order
Draft

tacerus wants to merge 2 commits into
saltstack:3008.xfrom
tacerus:ldap-order

Conversation

@tacerus

@tacerus tacerus commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

With some LDAP implementations attributes are not stored and returned in the order in which they were added, leading to the state repeatedly reporting changes. Introduce a toggle which enables internal sorting of old and new attributes and restores idempotency in such situations.

What issues does this PR fix or reference?

Fixes #68626.

Previous Behavior

Stray changes upon ordering differences.

New Behavior

No changes if ordering is not deemed relevant.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

With some LDAP implementations attributes are not stored and returned in
the order in which they were added, leading to the state repeatedly
reporting changes. Introduce a toggle which enables internal sorting of
old and new attributes and restores idempotency in such situations.

Signed-off-by: Georg Pfuetzenreuter <[email protected]>
Comment thread salt/states/ldap.py Outdated
Comment on lines -350 to -351
# convert the value sets to lists before returning them to the
# user (sorted for easier comparisons)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment was removed, but sorted is still called on the output below on line 368 attr: sorted(vals).

@tacerus tacerus Jan 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the pointer, that indeed needs to go too.
Currently I have this a bit stalled because I submitted python-ldap/python-ldap#604 in parallel, and in case that gets approved, it would be nice to make strict_order support a list of attributes instead of only a general toggle. Generally the improvements here would not do much without the patch in python-ldap (besides improving the output after removing the sorted() you mention), because the change would be reported but never committed.

@dwoz dwoz added the test:full Run the full test suite label Jun 19, 2026
@dwoz dwoz added this to the Sulphur v3006.26 milestone Jun 19, 2026
@twangboy

twangboy commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

We are no longer accepting Bugfix releases on the 3006.x branch. Please rebase this on the 3008.x branch.

@dwoz
dwoz changed the base branch from 3006.x to 3008.x October 22, 2026 00:12
@dwoz

dwoz commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@tacerus 3006.x has entered security only. Please rebase these changes on 3008.x

@twangboy twangboy modified the milestones: Argon v3008.5, Argon v3008.7 Oct 30, 2026

This branch was previously deployed

1 inactive (outdated) deployment
ci — 1e49a629 Deployed Jan 13, 2026 by tacerus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants