[PR #9753/fa7876bb backport][stable-10] Jira: add SSL client certificate support for authentication (#9763)
Jira: add SSL client certificate support for authentication (#9753)
* jira: add ssl client certificate support for authentification
* fix code bugs from first CI run
* fix fstring not compatible with older python and chhange urlopen module call
* removed duplicated post,put,get method
* fix urllib module detection Python2/ Python3
* edit HTTP Request back to fetch_url
* add changelog fragment
* fix python line spacing
* Update plugins/modules/jira.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/jira.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* edit documentation certificate auth not mutually exclusive
* Update changelogs/fragments/9753-jira-add-client-certificate-auth.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* edit documentation for client certificate auth and token
* add no_log for client_cert and client_key
* removed no_log for client_cert and client_key
---------
Co-authored-by: domin <domin@MacBookPro.fritz.box>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit fa7876bb40
)
Co-authored-by: Dominik <47948163+weristdominik@users.noreply.github.com>
pull/9765/head
parent
dedd625700
commit
d811807e1f
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- jira - adds ``client_cert`` and ``client_key`` parameters for supporting client certificate authentification when connecting to Jira (https://github.com/ansible-collections/community.general/pull/9753).
|
|
@ -59,6 +59,18 @@ options:
|
||||||
- The personal access token to log-in with.
|
- The personal access token to log-in with.
|
||||||
- Mutually exclusive with O(username) and O(password).
|
- Mutually exclusive with O(username) and O(password).
|
||||||
version_added: 4.2.0
|
version_added: 4.2.0
|
||||||
|
client_cert:
|
||||||
|
type: path
|
||||||
|
description:
|
||||||
|
- Client certificate if required.
|
||||||
|
- In addition to O(username) and O(password) or O(token). Not mutually exclusive.
|
||||||
|
version_added: 10.4.0
|
||||||
|
client_key:
|
||||||
|
type: path
|
||||||
|
description:
|
||||||
|
- Client certificate key if required.
|
||||||
|
- In addition to O(username) and O(password) or O(token). Not mutually exclusive.
|
||||||
|
version_added: 10.4.0
|
||||||
|
|
||||||
project:
|
project:
|
||||||
type: str
|
type: str
|
||||||
|
@ -446,6 +458,23 @@ EXAMPLES = r"""
|
||||||
operation: attach
|
operation: attach
|
||||||
attachment:
|
attachment:
|
||||||
filename: topsecretreport.xlsx
|
filename: topsecretreport.xlsx
|
||||||
|
|
||||||
|
# Use username, password and client certificate authentification
|
||||||
|
- name: Create an issue
|
||||||
|
community.general.jira:
|
||||||
|
uri: '{{ server }}'
|
||||||
|
username: '{{ user }}'
|
||||||
|
password: '{{ pass }}'
|
||||||
|
client_cert: '{{ path/to/client-cert }}'
|
||||||
|
client_key: '{{ path/to/client-key }}'
|
||||||
|
|
||||||
|
# Use token and client certificate authentification
|
||||||
|
- name: Create an issue
|
||||||
|
community.general.jira:
|
||||||
|
uri: '{{ server }}'
|
||||||
|
token: '{{ token }}'
|
||||||
|
client_cert: '{{ path/to/client-cert }}'
|
||||||
|
client_key: '{{ path/to/client-key }}'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
@ -480,6 +509,8 @@ class JIRA(StateModuleHelper):
|
||||||
username=dict(type='str'),
|
username=dict(type='str'),
|
||||||
password=dict(type='str', no_log=True),
|
password=dict(type='str', no_log=True),
|
||||||
token=dict(type='str', no_log=True),
|
token=dict(type='str', no_log=True),
|
||||||
|
client_cert=dict(type='path'),
|
||||||
|
client_key=dict(type='path'),
|
||||||
project=dict(type='str', ),
|
project=dict(type='str', ),
|
||||||
summary=dict(type='str', ),
|
summary=dict(type='str', ),
|
||||||
description=dict(type='str', ),
|
description=dict(type='str', ),
|
||||||
|
@ -511,6 +542,7 @@ class JIRA(StateModuleHelper):
|
||||||
],
|
],
|
||||||
required_together=[
|
required_together=[
|
||||||
['username', 'password'],
|
['username', 'password'],
|
||||||
|
['client_cert', 'client_key']
|
||||||
],
|
],
|
||||||
required_one_of=[
|
required_one_of=[
|
||||||
['username', 'token'],
|
['username', 'token'],
|
||||||
|
|
Loading…
Reference in New Issue