Skip to content

Proxito: use unresolved domain on middleware #9974

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

Merged
merged 9 commits into from
Feb 14, 2023
Merged

Proxito: use unresolved domain on middleware #9974

merged 9 commits into from
Feb 14, 2023

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Feb 2, 2023

  • Split the map_host_to_project into _set_request_attributes and unresolve_domain_from_request
  • Introduce the UnresolvedDomain data class to return from the unresolver.

@stsewd stsewd marked this pull request as ready for review February 2, 2023 17:15
@stsewd stsewd requested a review from a team as a code owner February 2, 2023 17:15
@stsewd stsewd requested a review from humitos February 2, 2023 17:15
@stsewd
Copy link
Member Author

stsewd commented Feb 8, 2023

ping @humitos

@stsewd stsewd requested a review from ericholscher February 9, 2023 23:01
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This looks like a much cleaner implementation. I think it looks like yet another solid step forward in making this code cleaner.

"Proxito Public Domain -> Canonical Domain Redirect.",
project_slug=project.slug,
)
request.canonicalize = constants.REDIRECT_CANONICAL_CNAME
Copy link
Member

Choose a reason for hiding this comment

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

These constants should probably be an enum as well, next refactor?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could be, but I think we could move this logic to the docs serving view, and we won't be needing those constants anymore

#9982 (comment)

@humitos
Copy link
Member

humitos commented Feb 10, 2023

This is on my list. I'll try to review it on Monday, hopefully

Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

I think we should update the name of the class and we are ready to merge 💯

@stsewd
Copy link
Member Author

stsewd commented Feb 13, 2023

I'll merge this after tomorrow's deploy (we have a pending PR that will conflict with the changes here)

@stsewd stsewd merged commit 9b44214 into main Feb 14, 2023
@stsewd stsewd deleted the refactor-proxito branch February 14, 2023 00:39
stsewd added a commit that referenced this pull request Feb 14, 2023
Make use of the unresolved domain from the request instead of each of the attributes we are setting in the request from the middleware, we aren't using any of those on .com, so we are safe removing them here.

This is on top of #9974.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants