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

feat: Support basic auth #3061

Merged
merged 3 commits into from
May 3, 2024
Merged

feat: Support basic auth #3061

merged 3 commits into from
May 3, 2024

Conversation

mikeldking
Copy link
Contributor

Changes the url for graphql so that basic auth can be properly initialized

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 2, 2024
@@ -189,6 +189,7 @@ def _get_pid_file() -> Path:

# If the host is "::", the convention is to bind to all interfaces. However, uvicorn
# does not support this directly unless the host is set to None.
display_host = host
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@anticorrelator this was broken I think

Comment on lines +12 to +14
const graphQLPath =
`${window.location.protocol}//${window.location.host}${getSanitizedPath(window.Config.basename)}` +
"/graphql";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is needed because basic auth comes in as http://{user}:{pass}asdfas.com but this needs to be stripped from the graphQL path

Comment on lines 192 to 195
display_host = host
if ":" in host:
# format IPv6 hosts in brackets
display_host = f"[{host}]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Was mypy not catching this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we are merging without checking CI?

Copy link
Contributor

Choose a reason for hiding this comment

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

Must be.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels May 3, 2024
@@ -250,7 +251,7 @@ def _get_pid_file() -> Path:
initial_spans=fixture_spans,
initial_evaluations=fixture_evals,
)
server = Server(config=Config(app, host=host, port=port))
server = Server(config=Config(app, host=host, port=port)) # type: ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

filed an issue @anticorrelator - this seems strange to force a none type in here: #3062

Copy link
Contributor

@RogerHYang RogerHYang May 3, 2024

Choose a reason for hiding this comment

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

Here's the context behind this solution that Dustin had found: encode/uvicorn#1529 (reply in thread)

Copy link
Contributor

Choose a reason for hiding this comment

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

@anticorrelator could we add a comment linking this issue?

@mikeldking mikeldking merged commit 3202256 into sql May 3, 2024
12 checks passed
@mikeldking mikeldking deleted the support-basic-auth branch May 3, 2024 00:14
RogerHYang pushed a commit that referenced this pull request May 3, 2024
* feat: add the ability to use basic auth

* mypy

* force fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants