gitlab_user: update SSH keys when key material changes (#11996)
* gitlab_user: update SSH keys when key material changes
Compare SSH keys by key type and key material so comment-only differences remain idempotent while changed keys are replaced. Add unit and integration coverage for SSH key updates.
Fixes#6516
* gitlab_user: add SSH key update modes
Restore backward-compatible same-name SSH key handling by default and
add explicit update and deduplicate modes for controlled replacement
behavior.
Refs: #6516
* Apply suggestions from code review
---------
(cherry picked from commit 2cb4a5d4e7)
Co-authored-by: Fulvius <31437530+LCerebo@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* gitlab_user: add expires_at option
* Add changelog
* Add integration test
* Add expires_at to addSshKeyToUser function
* password is required if state is set to present
* Check expires_at will not be added to a present ssh key
* add documentation about present ssh key
* add expires_at to unit tests
* Improve documentation
Co-authored-by: Felix Fontein <felix@fontein.de>
* Only pass expires_at to api when it is not None
* Emphasize on SSH public key
* Apply felixfontein suggestion
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>