Merged
Conversation
Railway template lookup endpoints reject authenticated requests, so use a public GraphQL client for template detail and template search requests. Add a regression test so add --database keeps working for logged-in users.
Keep the postgres auth fix focused by removing the stray npm lockfile and the unrelated API token handling change from this PR.
Collaborator
|
Hello, thank you for the PR. Could you update your description to include the original issue with the code and how your changes fix it? |
Contributor
Author
|
Hey @brody192 just did, feel free to take a look. Not a very big open source/Rust dev so open to any input! |
samaybar
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use unauthenticated GraphQL client for public template metadata lookups
Description
Summary
This PR separates public template metadata reads from authenticated project operations by introducing a dedicated public GraphQL client path.
GQLClient::new_public()for requests that should not include auth headers.build_client()helper.deployflow (fetch_and_create)deploy_templatesearch_templatesWhy
Template listing/detail endpoints are public and do not require user/project credentials. Sending auth headers to those calls is unnecessary and increases token exposure risk. This change aligns with least-privilege behavior by only attaching credentials where required.
Testing
src/client.rs:public_client_can_query_templates_without_auth_headersauthorizationheader is sent.id,name, andserializedConfighandling).Manual verification (recommended)
search_templatesanddeploy_templateto confirm public lookup + authenticated deploy behavior remains correct.