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

fix: allowing domain to be added including a scheme #72

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

Skarlso
Copy link
Contributor

@Skarlso Skarlso commented Oct 19, 2023

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

  • Related Issue # (issue)
  • Closes # (issue)
  • Fixes # (issue)

Remove if not applicable

Screenshots

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🙅 no documentation needed

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Skarlso Skarlso force-pushed the fix-https-domain branch 2 times, most recently from 05c6d91 to 5f90f34 Compare October 19, 2023 12:04
Copy link
Contributor

@phoban01 phoban01 left a comment

Choose a reason for hiding this comment

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

I think this is a better approach than adding logic that would parse the domain as a url and remove the scheme.

@Skarlso
Copy link
Contributor Author

Skarlso commented Oct 19, 2023

Aye. I had to think a lot to come up with a proper way of making sure localhost and port are still allowed but https:// is not. 🤣 since there is no negative validation. So I can't say DONT ALLOW if it contains :// or something.

@Skarlso
Copy link
Contributor Author

Skarlso commented Oct 19, 2023

I just wish I could customize the error message

ka user_repository.yaml
The Repository "new-repository-3" is invalid: spec.domain: Invalid value: "https://github.com": spec.domain in body should match '^\w+(\.|:[0-9]).*$'

But I could only do that with XValidate which is weird. :D

@Skarlso Skarlso merged commit b32ae76 into main Oct 19, 2023
2 checks passed
@Skarlso Skarlso deleted the fix-https-domain branch October 19, 2023 12:41
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.

2 participants