mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Restore new style headers
This leads to having both the new style header and the old compatability header. Best of both worlds!
This commit is contained in:
parent
b3c264bf21
commit
e1bdbeaa5c
@ -102,6 +102,8 @@ def kv_backend(**kwargs):
|
||||
request_kwargs['verify'] = create_temporary_fifo(cacert.encode())
|
||||
|
||||
sess = requests.Session()
|
||||
sess.headers['Authorization'] = 'Bearer {}'.format(token)
|
||||
# Compatability header for older installs of Hashicorp Vault
|
||||
sess.headers['X-Vault-Token'] = token
|
||||
|
||||
if api_version == 'v2':
|
||||
@ -157,6 +159,8 @@ def ssh_backend(**kwargs):
|
||||
request_kwargs['json']['valid_principals'] = kwargs['valid_principals']
|
||||
|
||||
sess = requests.Session()
|
||||
sess.headers['Authorization'] = 'Bearer {}'.format(token)
|
||||
# Compatability header for older installs of Hashicorp Vault
|
||||
sess.headers['X-Vault-Token'] = token
|
||||
# https://www.vaultproject.io/api/secret/ssh/index.html#sign-ssh-key
|
||||
request_url = '/'.join([url, secret_path, 'sign', role]).rstrip('/')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user