feat(net.vault): 🚧 add auth token vault#33
Merged
codedesignplus merged 1 commit intodevfrom Oct 30, 2024
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
TypeAuthenum to handle different authentication types in the Vault and refactors theVaultOptionsclass to use this new enum. Additionally, it updates theVaultClientFactoryto create clients based on the authentication type and modifies the test cases to reflect these changes. Minor updates were also made to thedocker-compose.ymland related scripts.Authentication Enhancements:
TypeAuthenum topackages/CodeDesignPlus.Net.Vault/src/CodeDesignPlus.Net.Vault.Abstractions/Options/TypeAuth.csto define different authentication types for the Vault.VaultOptionsclass to include aTypeAuthproperty that determines the authentication type based on the provided credentials.VaultClientFactoryto create clients based on theTypeAuthvalue and throw an exception if the authentication type is not defined.Validation and Exception Handling:
Validatemethod inVaultOptionsto check forTypeAuth.Noneand add a validation error if no authentication type is specified.VaultOptionsTestto validate the newTypeAuthproperty and ensure proper error handling for invalid authentication types. [1] [2]Test Enhancements:
VaultClientFactoryTestto verify client creation based on different authentication types and to handle invalid authentication scenarios. [1] [2]VaultExtensionsTestto verify the configuration builder with token-based authentication.Configuration and Script Updates:
docker-compose.ymlto changecommandtoentrypointfor better script execution. [1] [2]config.shscript to set up Vault configuration.entrypoint.shto include a greeting message and start the Vault server.credentials.jsonfor testing purposes.