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

proxy: add userinfo and webauthn endpoints #3755

Merged
merged 8 commits into from Nov 22, 2022
Merged

Conversation

calebdoxsey
Copy link
Contributor

@calebdoxsey calebdoxsey commented Nov 17, 2022

Summary

Add /.pomerium and /.pomerium/webauthn endpoints to the proxy service. Currently these are only handled by authenticate. With these changes they will also be available on any domain Pomerium handles.

I also moved all the common handlers to internal/handlers. (I wanted to avoid any circular references in httputil, which should be for more generic HTTP functionality)

The webauthn relying party is now derived from the request so that the origin used depends on the domain where the webauthn handlers live. As a consequence devices will now be domain-specific. I don't think a device registered on a.example.com could be used for b.example.com, but maybe this needs more testing.

Related issues

Checklist

  • reference any related issues
  • updated unit tests
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@calebdoxsey calebdoxsey added the enhancement New feature or request label Nov 17, 2022
@calebdoxsey calebdoxsey requested a review from a team as a code owner November 17, 2022 17:13
@desimone desimone added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsDiscussion labels Nov 17, 2022
@calebdoxsey
Copy link
Contributor Author

After discussion, we should attempt to use the parent top-level-domain as the origin. For example: console.example.com should use example.com as the origin. This should make it possible to re-use devices across domain names for most use cases. For cases where routes are spread across different TLDs devices will only be re-usable for the same domain. In the future we can provide the ability to customize this behavior similar to COOKIE_DOMAIN.

@coveralls
Copy link

coveralls commented Nov 18, 2022

Coverage Status

Coverage decreased (-0.6%) to 64.372% when pulling 20f3e7e on cdoxsey/proxy-user-info into 81053ac on main.

@calebdoxsey calebdoxsey removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 18, 2022
@calebdoxsey
Copy link
Contributor Author

It now uses the top-level domain name as the origin. Testing this with two routes it appears to register and authenticate existing devices properly.

@calebdoxsey
Copy link
Contributor Author

(worth mentioning, this is a breaking change, the next version of Pomerium will require devices to be re-registered because now they will be attached to a different name)

@desimone desimone added the breaking Backward incompatible change in behaviour, api or config label Nov 18, 2022
@desimone
Copy link
Contributor

Adding breaking tag so it's flagged.

Copy link
Contributor

@desimone desimone left a comment

Choose a reason for hiding this comment

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

Code LGTM, with a few small suggestions, and comments.

internal/handlers/jwks.go Outdated Show resolved Hide resolved
proxy/proxy.go Show resolved Hide resolved
internal/controlplane/http.go Show resolved Hide resolved
calebdoxsey and others added 3 commits November 21, 2022 18:04
Co-authored-by: bobby <1544881+desimone@users.noreply.github.com>
@calebdoxsey calebdoxsey merged commit c1a522c into main Nov 22, 2022
@calebdoxsey calebdoxsey deleted the cdoxsey/proxy-user-info branch November 22, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Backward incompatible change in behaviour, api or config enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants