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 alternate AWS auth options (#77) #87

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

imnotbrandon
Copy link
Contributor

Resolves #77.

If --aws-access-key-id and --aws-access-key-secret are not provided on the command-line, it allows boto3 to source the credentials itself.

This also enhances the argument parsing by allowing providers to decide whether options are required or not. Options are required by default, but can be made non-required by giving them a default value in the function signature:

def fetch_domains(aws_access_key_id=None, aws_access_key_secret=None, **args):

@SimonGurney
Copy link
Contributor

Thanks for doing the proper fix here, rather than a temp solution.

I think we need to validate in the provider that either both are none, or both are provided. A condition with just one is problematic.

@imnotbrandon
Copy link
Contributor Author

Thanks for doing the proper fix here, rather than a temp solution.

I think we need to validate in the provider that either both are none, or both are provided. A condition with just one is problematic.

Surprisingly it was the path of least resistance!
Agreed... having a validation framework is useful in general (eg. ensuring params are in the correct format)

@SimonGurney
Copy link
Contributor

I think we should also have an indicator on the help as to whether the parameter is mandatory or not. In this case they would be optional, and other providers they would be mandatory.

This then paves the way for us to add params for selecting a single zone id in aws or cloudflare.

@imnotbrandon
Copy link
Contributor Author

I've put in some basic validation for now. I think that implementing full-blown validation framework is out of the scope of this feature request as other providers will need to be modified.

@sonarcloud
Copy link

sonarcloud bot commented Aug 10, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@SimonGurney SimonGurney left a comment

Choose a reason for hiding this comment

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

Nice work

@imnotbrandon imnotbrandon merged commit 40c687a into main Aug 10, 2022
@imnotbrandon imnotbrandon deleted the feature/aws-auto branch August 10, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let boto3 source credentials
2 participants