Skip to content

Implementated global validation of domain strings #638

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

Merged
merged 9 commits into from
Apr 1, 2024

Conversation

CyberAustin
Copy link
Contributor

Should close #626 and provide a basic sanity check for all providers, agnostic of provider specific requirements.

Copy link
Owner

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 😉
A few changes to be made though 🤔

@CyberAustin
Copy link
Contributor Author

CyberAustin commented Feb 8, 2024

Ugh. Can't run linters or devcontainer in Replit. Have to fix this later at home.

JK. Forgot GitHub codespaces was a thing.

@CyberAustin CyberAustin requested a review from qdm12 February 8, 2024 12:32
@CyberAustin
Copy link
Contributor Author

I don't know why the linter is failing in GitHub Actions because it passes in the dev container. Anyway, ready for review.

@CyberAustin CyberAustin requested a review from qdm12 February 8, 2024 14:40
Copy link
Owner

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Nice 👍 💯

Now, we need to add a check the domain isn't "" for the providers actually using the domain parameter. Most of them do, but there are 2-3 exceptions (like duckdns, goip). So that would be edits in each of the provider subpackage within internal/provider/providers

@CyberAustin
Copy link
Contributor Author

Now, we need to add a check the domain isn't "" for the providers actually using the domain parameter. Most of them do, but there are 2-3 exceptions (like duckdns, goip). So that would be edits in each of the provider subpackage within internal/provider/providers

I'm not sure what you're asking here. Could you explain it a different way.

@qdm12 qdm12 force-pushed the master branch 2 times, most recently from bed663a to 6a6b1a8 Compare February 13, 2024 10:42
@CyberAustin CyberAustin requested a review from qdm12 February 14, 2024 09:25
@qdm12
Copy link
Owner

qdm12 commented Feb 14, 2024

We need to add a check in most providers that the domain is not empty "". Because in the current "above layer" check, we check the domain is empty (🆗) or valid (🆗), but some providers require a non-empty domain (most except a few).

For example in

add a case to check the domain is not empty:

case p.domain == "":
    return fmt.Errorf("%w", errors.ErrDomainNotSet)

@CyberAustin
Copy link
Contributor Author

Should be good now. Please take a look @qdm12

Copy link
Owner

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Thanks!
Positive is it does it in 3 lines for all providers except the two weird ones
Negative side is it it adds coupling in the code, but oh well that's fine this time 😉

Just rebase/fix the go.mod dependency diff and I'll merge, thanks! 🎖️

@CyberAustin CyberAustin requested a review from qdm12 February 29, 2024 17:06
@CyberAustin CyberAustin requested a review from qdm12 March 1, 2024 17:22
@qdm12 qdm12 force-pushed the global_val branch 2 times, most recently from e2e86c4 to 0734391 Compare April 1, 2024 12:32
… a need to add a check in every provider's individual package.
@qdm12 qdm12 merged commit b31d848 into qdm12:master Apr 1, 2024
3 checks passed
@CyberAustin CyberAustin deleted the global_val branch April 1, 2024 14:30
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.

Maintenance: validate domain strings for all providers
2 participants