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

Updates routes for port mapping #1394

Merged
merged 11 commits into from
May 15, 2024
Merged

Updates routes for port mapping #1394

merged 11 commits into from
May 15, 2024

Conversation

ZPain8464
Copy link
Contributor

@ZPain8464 ZPain8464 commented May 13, 2024

Resolves #1381.

@calebdoxsey this is a WIP because I've added a Zero screenshot. For now, I'd like a review for the docs. i can remove the screenshot and tab for v0.26, and wait until we're ready to release Zero.

I also need to document the Kubernetes configuration for this.

Copy link

netlify bot commented May 13, 2024

Deploy Preview for pomerium-docs ready!

Name Link
🔨 Latest commit cc8fa1f
🔍 Latest deploy log https://app.netlify.com/sites/pomerium-docs/deploys/66450472aef8040008c5df91
😎 Deploy Preview https://deploy-preview-1394--pomerium-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ZPain8464 ZPain8464 removed the request for review from kenjenkins May 14, 2024 15:18
https://www.example.com:18443
```

If you disable this runtime flag and _do not_ specify a port in the From URL, Pomerium will only match this route if the incoming request _does not_ specify a port, _or_ the request specifies port `:443`.
Copy link
Contributor

Choose a reason for hiding this comment

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

it's the port that the server listens on, which is by default 443

@ZPain8464 ZPain8464 marked this pull request as ready for review May 14, 2024 18:41
@ZPain8464 ZPain8464 requested a review from a team as a code owner May 14, 2024 18:41
@ZPain8464 ZPain8464 requested review from cmo-pomerium and calebdoxsey and removed request for a team May 14, 2024 18:41
Copy link
Contributor

@calebdoxsey calebdoxsey left a comment

Choose a reason for hiding this comment

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

lgtm

The `URL` must contain a **scheme** and **hostname** and cannot contain a path.
The From URL must contain a **scheme** and **hostname**. It can't contain a path.

### Port mapping behavior
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might want to stick with the phrase "port matching" here. According to wikipedia "port mapping" has a meaning in the context of NAT, which is something unrelated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -16,21 +17,62 @@ import TabItem from '@theme/TabItem';

## Summary

**From** is the externally accessible URL for the proxied request.
The **From** route is the externally accessible URL for a proxied HTTP request.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should use the phrase "From route." A route must have both a from URL and a to URL. There aren't "from routes" or "to routes".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So a "route" consists of a From and To URL. I agree here. I thought it made sense to distinguish which one of these we're referring to. "From route" could be "From URL".

content/docs/reference/routes/from.mdx Outdated Show resolved Hide resolved

:::note

You can disable this behavior with the [**Match Any Incoming Port**](/docs/reference/runtime-flags) runtime flag.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest moving this to the bottom of the section, so it doesn't interrupt the explanation + examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


:::note

Only secure schemes (`https` and `tcp+https`) are supported.
When defining a From route, you must use `https` or `tcp+https`. Pomerium only supports secure schemes.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest moving this note up, so it stays together with the sentence "The From URL must contain a scheme and hostname".

Or, it might make sense to remove the :::note callout and add this directly to that paragraph:

The From URL must contain a scheme and hostname. It can't contain a path. The scheme must be https or tcp+https.


:::

<Tabs>
<TabItem value="zero" label="Zero">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if we keep this change in a separate PR it may make things easier when cutting the v0.26 docs site branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I'll remove and add in a separate PR.

@ZPain8464 ZPain8464 merged commit 2fc8a0e into main May 15, 2024
8 checks passed
@ZPain8464 ZPain8464 deleted the zpain/routes-port-matching branch May 15, 2024 19:24
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.

Document port matching for matching routes
3 participants