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

collab #1

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

collab #1

wants to merge 5 commits into from

Conversation

turnintoabat
Copy link
Collaborator

in classic developer fashion the first thing i did was not on the list of things to do 😂

smoketest.py Outdated Show resolved Hide resolved
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())):
Copy link
Owner

@maclarel maclarel Nov 17, 2021

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?

Copy link
Owner

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.

Copy link
Collaborator Author

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!

smoketest.py Show resolved Hide resolved
Base automatically changed from refactor_1 to master November 17, 2021 22:00
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