-
Notifications
You must be signed in to change notification settings - Fork 84
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
Hide token/key from casual inspection #675
Merged
+136
−15
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8088d1a
Hide token/key from casual inspection
hadley fb5f8fa
Fix think-o
hadley a71839a
Redact certificate in servers(); add news bullet
hadley c138c6d
Don't always have certificate column
hadley af39290
Ensure certificates are strings, not factors
hadley 126bd04
Fix typo
hadley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# secrets are hidden from casual inspection | ||
|
||
Code | ||
accountInfo("john")$private_key | ||
Output | ||
[1] "THISIS... (redacted)" | ||
Code | ||
accountInfo("susan")$secret | ||
Output | ||
[1] "THIS I... (redacted)" | ||
Code | ||
str(accountInfo("john")) | ||
Output | ||
List of 5 | ||
$ username : chr "john" | ||
$ accountId : chr "userId" | ||
$ token : chr "token" | ||
$ server : chr "example.com" | ||
$ private_key: THISIS... (redacted) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# servers() redacts the certificate | ||
|
||
Code | ||
servers() | ||
Output | ||
name url certificate | ||
1 cert_test_a https://localhost:4567/ -----B... (redacted) | ||
2 shinyapps.io https://api.shinyapps.io/v1 Amazon... (redacted) | ||
3 posit.cloud https://api.shinyapps.io/v1 Amazon... (redacted) | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
test_that("servers() redacts the certificate", { | ||
local_temp_config() | ||
|
||
# add a server with a sample certificate | ||
addServer( | ||
url = "https://localhost:4567/", | ||
name = "cert_test_a", | ||
certificate = test_path("certs/sample.crt"), | ||
quiet = TRUE | ||
) | ||
expect_snapshot(servers()) | ||
}) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
rsconnect::accounts
need the same adjustment?This adjusts responses from the package API and should be included in NEWS.md.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accounts()
just includesname
andserver
— did you meanservers()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that the
certificates
field inservers()
is actually secret, but it is very long, so redacting it is a service to the user.