-
Notifications
You must be signed in to change notification settings - Fork 1
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
collab #1
base: master
Are you sure you want to change the base?
collab #1
Conversation
smoketest.py
Outdated
# Ensure that URL is valid and PAT is well formed | ||
# TO DO | ||
if ((target[0:8] == "https://") and (target[-4] == ".") and (target[-3:].isalnum())): | ||
if ((len(pat) == 40) and (pat[0:4] == 'ghp_') and (pat[5:40].isalnum())): |
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'm wondering if we should just wrap this in get_pat_user()
. We're going to have variable length/format PATs as GHES hasn't implemented the new format (ghp_
) in all versions.
We're enforcing the existence of a PAT as an argument, but I'm wondering if the best validation would be seeing if we can actually auth with this... maybe we could throw a ValueError
if we fail to pull the username there?
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 added a check along these lines ^ at https://github.com/maclarel/ghes-smoketest/blob/master/smoketest.py#L54. Definitely open to recommendations for improvements on this.
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.
ah that works then, I didn't think about previous versions. Typically I prefer to do validation locally rather than throwing it at a URL but since it's variable that's definitely the right path!
in classic developer fashion the first thing i did was not on the list of things to do 😂