Skip to content

Commit 2f99cbe

Browse files
authored
fix: retrieve vault entries by ID to ensure permission for secret access (#9)
1 parent 15002d2 commit 2f99cbe

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.github/workflows/galaxy_publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Publish to Ansible Galaxy
22

33
on:
44
release:
5+
types: published
56
workflow_dispatch:
67

78
jobs:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Use the following playbook to authenticate with DVLS and fetch every secrets fro
8989
server_base_url: "https://example.yourcompany.com"
9090
app_key: "{{ lookup('env', 'DVLS_APP_KEY') }}"
9191
app_secret: "{{ lookup('env', 'DVLS_APP_SECRET') }}"
92-
register: server
92+
register: server
9393
9494
- name: Fetch URI
9595
debug:

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace: devolutions
22
name: dvls
3-
version: 1.1.0
3+
version: 1.1.1
44
readme: README.md
55
authors:
66
- Danny Bédard <[email protected]>

plugins/modules/fetch_secrets.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ def run_module():
145145
entry = get_vault_entry(server_base_url, token, vault_id, secret_id)
146146
fetched_secrets[secret_name] = entry['data']
147147
else:
148-
for entry in entries:
149-
entry_name = entry['name']
148+
for secret in entries:
149+
entry_name = secret['name']
150+
entry = get_vault_entry(server_base_url, token, vault_id, secret['id'])
150151
fetched_secrets[entry_name] = entry['data']
151152

152153
result = fetched_secrets

0 commit comments

Comments
 (0)