1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

gitlab modules: deprecate basic auth method (#8383)

This commit is contained in:
Léo GATELLIER 2024-05-19 20:47:54 +02:00 committed by GitHub
parent 0350a631de
commit 70c78c1d71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,2 @@
deprecated_features:
- "gitlab modules - the basic auth method on GitLab API have been deprecated and will be removed in community.general 10.0.0 (https://github.com/ansible-collections/community.general/pull/8383)."

View file

@ -115,6 +115,11 @@ def gitlab_authentication(module, min_version=None):
# Changelog : https://github.com/python-gitlab/python-gitlab/releases/tag/v1.13.0
# This condition allow to still support older version of the python-gitlab library
if LooseVersion(gitlab.__version__) < LooseVersion("1.13.0"):
module.deprecate(
"GitLab basic auth is deprecated and will be removed in next major version, "
"using another auth method (API token or OAuth) is strongly recommended.",
version='10.0.0',
collection_name='community.general')
gitlab_instance = gitlab.Gitlab(url=gitlab_url, ssl_verify=verify, email=gitlab_user, password=gitlab_password,
private_token=gitlab_token, api_version=4)
else: