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

Implement activedirectory.rotate_credentials and ldap.rotate_static_credentials #1161

Closed
wants to merge 7 commits into from

Conversation

hkgnobody
Copy link

usage: client.secrets.activedirectory.rotate_credentials(name,[mount_point])

@hkgnobody hkgnobody requested a review from a team as a code owner April 15, 2024 07:36
@briantist briantist added enhancement a new feature or addition secrets engines generally related to a Vault secrets engine active directory Active Directory secrets engine minor Used as part of release-drafter's version-resolver configuration labels Apr 15, 2024
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 87.75%. Comparing base (a0418e2) to head (8058eb0).
Report is 1 commits behind head on main.

❗ Current head 8058eb0 differs from pull request most recent head 5756bb4. Consider uploading reports for the commit 5756bb4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1161      +/-   ##
==========================================
- Coverage   87.80%   87.75%   -0.06%     
==========================================
  Files          67       67              
  Lines        3264     3267       +3     
==========================================
+ Hits         2866     2867       +1     
- Misses        398      400       +2     
Files Coverage Δ
hvac/api/secrets_engines/active_directory.py 39.39% <33.33%> (-0.61%) ⬇️

@Tylerlhess
Copy link
Contributor

While this is a simple endpoint call passing to the api it might be worth a simple sanity check of a test case

@hkgnobody
Copy link
Author

@Tylerlhess not sure if it is what you suggested to have.
Otherwise we can add another test to check the "last_password" after invoking rotate_credentials() is matching the "password" of the previous mocked request?

@hkgnobody hkgnobody marked this pull request as draft April 17, 2024 11:36
@hkgnobody
Copy link
Author

I made a mistake. implemented active_directory but make test case on ldap. Convert to DRAFT.

@Tylerlhess
Copy link
Contributor

@Tylerlhess not sure if it is what you suggested to have. Otherwise we can add another test to check the "last_password" after invoking rotate_credentials() is matching the "password" of the previous mocked request?

Yeah that would actually be a good test. I think of having a test, even a dumb one, is a good way to make sure that other changes don't break this function from even being called. Yes validating that it actually worked is important but even a simple test that it runs without error catches most breaking changes.

@hkgnobody
Copy link
Author

I believe the ad and ldap are very similar. That's why in the code base, they are almost identical.
Therefore i am going to implement the rotate role credentials for both modules.
Test case on expeccted status code was added for ldap, but i cannot locate the test file for AD.

@hkgnobody hkgnobody changed the title Implement activedirectory.rotate_credentials Implement activedirectory.rotate_credentials and ldap.rotate_static_credentials Apr 18, 2024
@hkgnobody hkgnobody marked this pull request as ready for review April 18, 2024 17:07
@hkgnobody
Copy link
Author

I saw the ldap part was implemented in #1163, casuing a conflict. Going to pull out my changes.

@hkgnobody hkgnobody closed this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active directory Active Directory secrets engine enhancement a new feature or addition minor Used as part of release-drafter's version-resolver configuration secrets engines generally related to a Vault secrets engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants