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

Support for ldap secret engine, static and dynamic roles #333

Merged
merged 4 commits into from
Sep 8, 2024

Conversation

protonyx
Copy link
Contributor

Fixes a type mismatch bug with the existing LDAP secret engine implementation. Adds full support for static and dynamic roles in the LDAP secret engine.

Vault API Docs: https://developer.hashicorp.com/vault/api-docs/v1.13.x/secret/ldap

also fixes a bug with an incorrect JsonConverter attribute on StaticCredentials.RotationPeriod
Copy link
Collaborator

@konidev20 konidev20 left a comment

Choose a reason for hiding this comment

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

IMO we should distinguish between Static and Dynamic roles explicitly. It provides for an easier experience while looking for methods.


namespace VaultSharp.V1.SecretsEngines.OpenLDAP
{
public class Role
Copy link
Collaborator

Choose a reason for hiding this comment

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

Recommendation to rename this class to DynamicRole, and to also add the documentation similar to StaticRole.


namespace VaultSharp.V1.SecretsEngines.OpenLDAP
{
public class LdapCredentials : UsernamePasswordCredentials
Copy link
Collaborator

Choose a reason for hiding this comment

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

Recommendation to rename the class to LDAPCredentials instead of LdapCredentials ensuring that abbreviations are consistent.

/// more details. This field may optionally be provided as a base64 encoded string.
/// </remarks>
[JsonPropertyName("creation_ldif")]
public string CreationLdif { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Recommendation to capitalise all instances of Ldif with LDIF since it is an abbreviation.

@protonyx
Copy link
Contributor Author

I agree with all suggestions, though I was following the conventions in the database secret engine so it might be worth revisiting as well.

I also noticed that the LDAP secret engine is referenced as OpenLDAP in the code, which no longer aligns with the Hashicorp documentation. Should that be modified as well?

@konidev20
Copy link
Collaborator

I also noticed that the LDAP secret engine is referenced as OpenLDAP in the code, which no longer aligns with the Hashicorp documentation. Should that be modified as well?

Hey, I guess we must not, since it would affect backward compatibility. We need to check with @rajanadar on this. The process is to mark it as a breaking change, but I'm not sure whether it will go in a patch or a major release.

@protonyx
Copy link
Contributor Author

Any additional feedback for this PR?

Copy link
Owner

@rajanadar rajanadar left a comment

Choose a reason for hiding this comment

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

thanks

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.

3 participants