Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(#19314, #15700): allow
ssh
/altssh
subdomains in repo URLs to match webhook payload #21227base: master
Are you sure you want to change the base?
fix(#19314, #15700): allow
ssh
/altssh
subdomains in repo URLs to match webhook payload #21227Changes from 9 commits
671ed99
750c0a9
71d126f
5ed35ea
2f46cc4
453ad46
9678a96
b5647ce
1312173
7ba7cb3
c8c7abd
5e7658c
eb518a1
5131354
2b9d884
a3c50a5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
These regexes seem different from the previous ones.
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.
Correct, there are subtle differences.
The previous
Application
webhook web URL regex was:Which broke down to:
http://
,https://
,username@
,ssh://
, orssh://username@
(whereusername
is the RFC 3986 pattern defined elsewhere in the file)regexp.QuoteMeta()
:port
or nothingregexp.QuoteMeta()
(which might be empty).git
extensionThe previous
ApplicationSet
webhook web URL regex was:Which differed from the
Application
one in that:regexp.QuoteMeta()
.In the new common web URL regex used by both webhooks:
https?
URLs.)altssh
orssh
subdomain is allowed. (This fixes Webhooks not compatible with alternative SSH addressing schemes #19314 to allow for SSH-over-443 alternatives.)regexp.QuoteMeta()
. (This doesn’t fix any reported issue that I’m aware of, but prevents edge cases of hostname/path values containing anything that would have otherwise been interpreted as regex syntax.)The previous
ApplicationSet
webhook API URL regex was:(Basically the same as the web URL regex, but no path or extension.)
The new API URL regex has the same benefits as listed above for the new web URL regex (except for the
altssh
/ssh
subdomain allowance since these URLs will never have that).