run black: Add support for Kubernetes authentication method in Hashicorp Vault secret lookup

This commit is contained in:
liortamary 2022-02-26 18:33:36 +02:00
parent dd99a25db0
commit b870659fd9
2 changed files with 7 additions and 9 deletions

View File

@ -60,9 +60,7 @@ base_inputs = {
'type': 'string',
'multiline': False,
'default': 'approle',
'help_text': _(
'The Authentication path to use if one isn\'t provided in the metadata when linking to an input field. Defaults to \'approle\''
),
'help_text': _('The Authentication path to use if one isn\'t provided in the metadata when linking to an input field. Defaults to \'approle\''),
},
],
'metadata': [

View File

@ -14,12 +14,12 @@ def test_imported_azure_cloud_sdk_vars():
def test_hashivault_approle_auth():
kwargs = {
'role_id': 'the_role_id',
'secret_id': 'the_secret_id',
'role_id': 'the_role_id',
'secret_id': 'the_secret_id',
}
expected_res = {
'role_id': 'the_role_id',
'secret_id': 'the_secret_id',
'role_id': 'the_role_id',
'secret_id': 'the_secret_id',
}
res = hashivault.approle_auth(**kwargs)
assert res == expected_res
@ -27,7 +27,7 @@ def test_hashivault_approle_auth():
def test_hashivault_kubernetes_auth():
kwargs = {
'kubernetes_role': 'the_kubernetes_role',
'kubernetes_role': 'the_kubernetes_role',
}
expected_res = {
'role': 'the_kubernetes_role',
@ -42,7 +42,7 @@ def test_hashivault_kubernetes_auth():
def test_hashivault_handle_auth_token():
kwargs = {
'token': 'the_token',
'token': 'the_token',
}
token = hashivault.handle_auth(**kwargs)
assert token == kwargs['token']