-
-
Notifications
You must be signed in to change notification settings - Fork 99
Add support for AWS Secrets Manager #532
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
Conversation
12534c7
to
6b927c3
Compare
Not sure why the lint is failing for ruff. Locally it says everything is fine. |
6b927c3
to
74b09c0
Compare
boto3 dependency on urllib3 conflicts with requests on Python < 3.10. |
The tests failing are not related to the change |
bdc4bd0
to
2742887
Compare
Thanks @mavwolverine for this PR. I think the test failures are related to this PR's package update. Also, you need to document this new settings source and provide an example of how to use it. |
2742887
to
eefb492
Compare
Will work on the docs and sample over the weekend |
4436bba
to
dd3965d
Compare
@hramezani Hopefully this is the last time I have to rework the PR. Had to refactor it due to dependency changes in upstream and then UV changes. |
Thanks @mavwolverine for the update. I have a refactoring PR on my list to review. I will then return to this PR. You will probably need to rebase it later, and I will let you know. I also can help you if you don't have time to work |
PR Change SummaryAdded support for AWS Secrets Manager in the documentation, including usage instructions and example code.
Modified Files
How can I customize these reviews?Check out the Hyperlint AI Reviewer docs for more information on how to customize the review. If you just want to ignore it on this PR, you can add the Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add What is Hyperlint?Hyperlint is an AI agent that helps you write, edit, and maintain your documentation. Learn more about the Hyperlint AI reviewer and the checks that we can run on your documentation. |
3ab9a32
to
fa6f3a0
Compare
Finally! @hramezani please check. Thanks |
Thanks @mavwolverine for the update! This is the first PR on my list for review/merge. I will get back to it later. |
if not yaml: | ||
pytest.skip('PyYAML is not installed', allow_module_level=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need pyyaml
to be installed for this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Moto the mocking library for boto3 has a dependency on responses which imports yaml. The second tests run in ci was failing and tests won't even start.
Hence the import moto is inside try catch after trying to import yaml.
And the skip module is because it fails for the @mock_aws decorator.
@mavwolverine I am not familiar with AWS Secret Manager. is Can you explain how I can test your PR? |
class AWSSecretsManagerSettings(BaseSettings): | ||
"""AWSSecretsManager settings.""" | ||
|
||
SqlServerUser: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this field? because the alias of the next field is SqlServerUser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hramezani I kept the tests similar to Azure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need SqlServerUser: str
and we can remove it
Secret id is the secret name identifier in AWS. ![]() The key value when retrieved is returned as a json string. To test in real AWS account, login to AWS account, go to AWS Secrets Manager, add new secret. |
Thanks @mavwolverine for explaining how to test it. Please address two small comment on tests and then we can merge the PR |
Thanks @mavwolverine |
@hramezani Thanks for taking care of the changes. Got busy with work and was planning on looking into the changes over the weekend. |
Working on the unit tests