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

repospec: support ssh urls with ssh certificates #4986

Merged

Conversation

KnVerey
Copy link
Contributor

@KnVerey KnVerey commented Jan 18, 2023

Closes #4741

With all the work we've put into RepoSpec lately, this is now much easier to do.

Copying that PR's description:

Organizations that use a custom SSH Certificate Authority with GitHub
Enterprise Cloud will have a host that starts with org-12345@ instead
of git@. This removes the hard-coded git@ in the repo spec parsing
for a regexp match on a valid username instead.

E.g. now it will be able to parse specs like org-12345@github.com:someOrg/someRepo/README.md?ref=someBranch.

Docs for the SSH Certificate feature are here: https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities#about-ssh-urls-with-ssh-certificates

We can see in the git documentation that the username segment is universally valid for the ssh protocol and the scp-like format: https://git-scm.com/docs/git-fetch#_git_urls. We could validate against it being used with other protocols, but falling back on the leave-validation-to-git stance, I'm inclined not to. (Yes, this is a reversal of my stance on the original PR. I've learned a lot about RepoSpec in the interim!)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 18, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KnVerey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 18, 2023
@KnVerey
Copy link
Contributor Author

KnVerey commented Jan 18, 2023

FYI @mightyguava

Copy link
Contributor

@natasha41575 natasha41575 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2023
@k8s-ci-robot k8s-ci-robot merged commit a69092c into kubernetes-sigs:master Jan 20, 2023
@mightyguava
Copy link
Contributor

Thank you @KnVerey for getting this through! I really appreciate it. This'll be really helpful to us.

@KnVerey KnVerey deleted the repospec_custom_usernames branch January 24, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants