-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise an error if a secret is redacted while log is in verbose.
- Loading branch information
Showing
19 changed files
with
102 additions
and
32 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
integration/hurl/tests_failed/secret.err → ...ation/hurl/tests_failed/assert_secret.err
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
integration/hurl/tests_failed/secret.ps1 → ...ation/hurl/tests_failed/assert_secret.ps1
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Set-StrictMode -Version latest | ||
$ErrorActionPreference = 'Stop' | ||
|
||
hurl --secret name=Alice tests_failed/secret.hurl | ||
hurl --secret name=Alice tests_failed/assert_secret.hurl |
File renamed without changes.
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,4 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
hurl --secret name=Alice tests_failed/assert_secret.hurl |
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
error: Readonly secret | ||
--> tests_failed/secret_errors.hurl:6:11 | ||
| | ||
| GET http://localhost:8000/hello | ||
| ... | ||
6 | variable: name=a_public_value | ||
| ^^^^^^^^^^^^^^^^^^^ secret 'name' can't be reassigned | ||
| | ||
|
||
error: Invalid secret type | ||
--> tests_failed/secret_errors.hurl:13:1 | ||
| | ||
| GET http://localhost:8000/hello | ||
| ... | ||
13 | token1: header "Date" toDate "%a, %d %b %Y %H:%M:%S GMT%Z" redact | ||
| ^^^^^^ secret must be string, actual value is <date> | ||
| | ||
|
||
* ------------------------------------------------------------------------------ | ||
* Executing entry 3 | ||
* | ||
* Entry options: | ||
* verbose: true | ||
error: Invalid redacted secret | ||
--> tests_failed/secret_errors.hurl:22:1 | ||
| | ||
22 | token2: header "Date" redact | ||
| ^^^^^^ redacted secret not authorized in verbose | ||
| | ||
|
File renamed without changes.
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,22 @@ | ||
# We check that variable can't override secret because a secret becoming | ||
# a public variable will leak it previous secret value. | ||
GET http://localhost:8000/hello | ||
x-header: a_secret_value | ||
[Options] | ||
variable: name=a_public_value | ||
HTTP 200 | ||
|
||
# Secrets must be strings | ||
GET http://localhost:8000/hello | ||
HTTP 200 | ||
[Captures] | ||
token1: header "Date" toDate "%a, %d %b %Y %H:%M:%S GMT%Z" redact | ||
|
||
|
||
# Entries that created new secrets with `redact` can't be log in normal mode (vs --test mode) | ||
GET http://localhost:8000/hello | ||
[Options] | ||
verbose: true | ||
HTTP 200 | ||
[Captures] | ||
token2: header "Date" redact |
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,4 @@ | ||
Set-StrictMode -Version latest | ||
$ErrorActionPreference = 'Stop' | ||
|
||
hurl --continue-on-error --secret name=a_secret_value tests_failed/secret_errors.hurl |
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,4 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
hurl --continue-on-error --secret name=a_secret_value tests_failed/secret_errors.hurl |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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