Repository navigation
Conversation
With no source off Connect, trajectory_read() sent CONNECT_API_KEY to the server a project's deployment record names, so a cloned project could choose where the key goes. When CONNECT_SERVER is set and the record names another server, both readers now refuse before any request and point at the content URL. A GUID source already prefers CONNECT_SERVER to the record.
A record whose server adds a query to CONNECT_SERVER's passed the check in Python, since the server key dropped the query. The key now keeps everything after the host.
Python's key dropped an empty query, and R's lowercased a query that follows the host. Both keys now take everything after the host as written.
Contributor
|
Preview deployed to Connect ( Deployed from commit 4732f54. |
Contributor
|
Preview deployed to Connect ( Deployed from commit 4732f54. |
Contributor
|
Preview root: https://posit-dev.github.io/commons/pr-550/ Python site preview: https://posit-dev.github.io/commons/pr-550/py/ Built from the latest commit on this branch. The R links in it point at the published R site, which no pull request rebuilds. |
A deployment record may send CONNECT_API_KEY only to CONNECT_SERVER or, when that is unset, to a Connect server registered with the package's deploy tool, for GUID sources too. With several records, the newest trusted one is read. The refusal says to set CONNECT_SERVER and CONNECT_API_KEY for the record's server instead of suggesting a content URL. connect-source.json pins the new cases, including a tab in the host.
Neither server in an ambiguous rsconnect-python record need be trusted, so the message now says to set CONNECT_SERVER and CONNECT_API_KEY for one of them, as the untrusted-record refusal does.
CONNECT_SERVER cannot pick between rsconnect-python entries whose server URLs differ only in form, so the error asks for a content GUID instead.
A GUID source reads the ambiguous record again unless CONNECT_SERVER is set, so the GUID alone does not resolve it.
This branch has not been deployed
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.
This PR makes
trajectory_read()sendCONNECT_API_KEYto the server in a project's deployment record only when that server is trusted, so a cloned project cannot choose where your key goes. A server is trusted when it isCONNECT_SERVER, or, whenCONNECT_SERVERis unset, when it is a Connect server you registered with rsconnect. The read refuses any other record before it sends a request.Agent-written details
source, and when a GUIDsourcetakes its server from the record. On Connect itself and for a URL source, nothing changes.CONNECT_SERVERandCONNECT_API_KEYfor that server. It suggests no URL to pass assource, because the current key would be sent with it. In Python, the error for an rsconnect-python record with several deployments thatCONNECT_SERVERcannot choose between also no longer suggests a URL.servers.jsonin Python, andrsconnect::accounts()in R. A server registered only with the other tool is refused untilCONNECT_SERVERis set. R without rsconnect installed refuses every record whenCONNECT_SERVERis unset.https://xandhttps://x:443are different servers. Both keys now keep a query as written.null_deployment,guid_serverandrecord_searchsections of the shared fixture.R changes
trajectory_read()now refuses a project's rsconnect record whose server is not trusted, before it sends the API key there. WithCONNECT_SERVERset, the record must name that server. With it unset, the record must name a server inrsconnect::accounts(), where before any record's server was used. The same rule applies when a GUID source takes its server from the record, and with several records the newest trusted one is used ahead of a newer untrusted one. The change has a NEWS bullet.CONNECT_API_KEYwas sentCONNECT_SERVERor, with that unset, a registered servertrajectory-read.RCONNECT_SERVERtrajectory-read.Rdeployment_server_key()lowercased a query that followed the host directlytrajectory-read.R