Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ACL policies #480

Merged
merged 7 commits into from
Jun 25, 2024
Merged

Conversation

mleneveut
Copy link
Contributor

Fixes: #476

@mleneveut
Copy link
Contributor Author

Needs hvac >= 2.1.0

@@ -133,7 +133,7 @@ def hashivault_write(module):
returned_data = client.secrets.kv.v2.create_or_update_secret(mount_point=mount_point, cas=cas,
path=secret, secret=write_data)
else:
returned_data = client.write(secret_path, **write_data)
returned_data = client.write_data(secret_path, **write_data)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this required for hvac 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's a breaking change of 2.0.0 : https://github.com/hvac/hvac/blob/main/CHANGELOG.md#200

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged that, might fix this

@@ -133,7 +133,7 @@ def hashivault_write(module):
returned_data = client.secrets.kv.v2.create_or_update_secret(mount_point=mount_point, cas=cas,
path=secret, secret=write_data)
else:
returned_data = client.write(secret_path, **write_data)
returned_data = client.write_data(secret_path, **write_data)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -133,7 +133,7 @@ def hashivault_write(module):
returned_data = client.secrets.kv.v2.create_or_update_secret(mount_point=mount_point, cas=cas,
path=secret, secret=write_data)
else:
returned_data = client.write(secret_path, **write_data)
returned_data = client.write_data(secret_path, **write_data)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TerryHowe
Copy link
Owner

Looks like get bogus policy is failing now for some reason

@mleneveut
Copy link
Contributor Author

@TerryHowe I fixed the test, as hvac returns an InvalidPath exception if the ACL policy doesn't exist :

    try:
        policy = client.sys.read_acl_policy(name)
        policy = policy.get('data', policy).get('policy', policy)
    except InvalidPath as e:
        policy = None

@TerryHowe TerryHowe merged commit 2939d4e into TerryHowe:main Jun 25, 2024
3 checks passed
@TerryHowe
Copy link
Owner

This and jwt modules release in 5.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support of hvac create_or_update_acl_policy
2 participants