-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for Secret Store client keys
This lets clients create a client key for local encryption of secrets before uploading to the Fastly API. This bumps the minimum required Go version to 1.18 and introduces `golang.org/x/crypto` as a dependency.
- Loading branch information
Showing
10 changed files
with
369 additions
and
15 deletions.
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
40 changes: 40 additions & 0 deletions
40
fastly/fixtures/secret_store/TestClient_CreateSecret_clientEncryption/create_client_key.yaml
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,40 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- FastlyGo/7.1.0 (+github.com/fastly/go-fastly; go1.19.5) | ||
url: https://api.fastly.com/resources/stores/secret/client-key | ||
method: POST | ||
response: | ||
body: | | ||
{ | ||
"public_key": "CUBQitcJt9a4Vqem5vPYubm/jjZ6Inqr4gr/6aJukSc=", | ||
"signature": "8ajkjOwcsUIQRS1Blsoqk3vL4gelCh1rqYZATzLGXumFB2VNCFhTgMzmV6ypPQ6VJcdtbUr/fEvGtHfagNH4DA==", | ||
"expires_at": "2023-02-03T22:36:31.563174Z" | ||
} | ||
headers: | ||
Access-Control-Allow-Headers: | ||
- Content-Type, Fastly-Key | ||
Access-Control-Allow-Methods: | ||
- PUT, POST, GET, OPTIONS, DELETE | ||
Access-Control-Allow-Origin: | ||
- '*' | ||
Content-Length: | ||
- "221" | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Fri, 03 Feb 2023 22:26:31 GMT | ||
Fastly-Trace-Id: | ||
- vIOfYP6o8Rj6SVaJ2HkeQv | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
41 changes: 41 additions & 0 deletions
41
fastly/fixtures/secret_store/TestClient_CreateSecret_clientEncryption/create_secret.yaml
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,41 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: | | ||
{"name":"TestClient_CreateSecret_clientEncryption","secret":"cRol5IDLTry79axbRcblj0+JLrEuEPdfN715c6C7cADybGL+34DotXLX9IKgsx2Et7nfBFLxUtPlsoLNyMzUBg==","client_key":"CUBQitcJt9a4Vqem5vPYubm/jjZ6Inqr4gr/6aJukSc="} | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- FastlyGo/7.1.0 (+github.com/fastly/go-fastly; go1.19.5) | ||
url: https://api.fastly.com/resources/stores/secret/gyxBrAO5eUjZMNwb3z93gn/secrets | ||
method: POST | ||
response: | ||
body: | | ||
{ | ||
"name": "TestClient_CreateSecret_clientEncryption", | ||
"digest": "5W22wlDwhwa7dZ4y1+2ZbIZxDVibHHKordZCehpYvak=", | ||
"created_at": "2023-02-03T22:26:31Z" | ||
} | ||
headers: | ||
Access-Control-Allow-Headers: | ||
- Content-Type, Fastly-Key | ||
Access-Control-Allow-Methods: | ||
- PUT, POST, GET, OPTIONS, DELETE | ||
Access-Control-Allow-Origin: | ||
- '*' | ||
Content-Length: | ||
- "157" | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Fri, 03 Feb 2023 22:26:31 GMT | ||
Fastly-Trace-Id: | ||
- nRfqFSFUBgKtWbp0VaFINo | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
41 changes: 41 additions & 0 deletions
41
fastly/fixtures/secret_store/TestClient_CreateSecret_clientEncryption/create_store_00.yaml
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,41 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: | | ||
{"name":"TestClient_CreateSecret_clientEncryption-00"} | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- FastlyGo/7.1.0 (+github.com/fastly/go-fastly; go1.19.5) | ||
url: https://api.fastly.com/resources/stores/secret | ||
method: POST | ||
response: | ||
body: | | ||
{ | ||
"id": "gyxBrAO5eUjZMNwb3z93gn", | ||
"name": "TestClient_CreateSecret_clientEncryption-00", | ||
"created_at": "2023-02-03T22:26:29Z" | ||
} | ||
headers: | ||
Access-Control-Allow-Headers: | ||
- Content-Type, Fastly-Key | ||
Access-Control-Allow-Methods: | ||
- PUT, POST, GET, OPTIONS, DELETE | ||
Access-Control-Allow-Origin: | ||
- '*' | ||
Content-Length: | ||
- "134" | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Fri, 03 Feb 2023 22:26:31 GMT | ||
Fastly-Trace-Id: | ||
- 3MNCmQuMyIl0ToFR25GtOK | ||
status: 201 Created | ||
code: 201 | ||
duration: "" |
31 changes: 31 additions & 0 deletions
31
fastly/fixtures/secret_store/TestClient_CreateSecret_clientEncryption/delete_store_00.yaml
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,31 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- FastlyGo/7.1.0 (+github.com/fastly/go-fastly; go1.19.5) | ||
url: https://api.fastly.com/resources/stores/secret/gyxBrAO5eUjZMNwb3z93gn | ||
method: DELETE | ||
response: | ||
body: "" | ||
headers: | ||
Access-Control-Allow-Headers: | ||
- Content-Type, Fastly-Key | ||
Access-Control-Allow-Methods: | ||
- PUT, POST, GET, OPTIONS, DELETE | ||
Access-Control-Allow-Origin: | ||
- '*' | ||
Date: | ||
- Fri, 03 Feb 2023 22:26:31 GMT | ||
Fastly-Trace-Id: | ||
- c7kZMF2OBn2WeFQ9qV6TQY | ||
status: 204 No Content | ||
code: 204 | ||
duration: "" |
42 changes: 42 additions & 0 deletions
42
fastly/fixtures/secret_store/TestClient_CreateSecret_clientEncryption/get_signing_key.yaml
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,42 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- FastlyGo/7.1.0 (+github.com/fastly/go-fastly; go1.19.5) | ||
url: https://api.fastly.com/resources/stores/secret/signing-key | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"signing_key": "3Tb5p7bVMKg8TrhtmjB73d+A99yVNLR1Tfi+YwJTMw0=" | ||
} | ||
headers: | ||
Access-Control-Allow-Headers: | ||
- Content-Type, Fastly-Key | ||
Access-Control-Allow-Methods: | ||
- PUT, POST, GET, OPTIONS, DELETE | ||
Access-Control-Allow-Origin: | ||
- '*' | ||
Content-Length: | ||
- "68" | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Fri, 03 Feb 2023 22:26:31 GMT | ||
Etag: | ||
- '"c2b40427846401e6a808f1a43a809a65770df02c49b3fc30aacf98e3aec0d515"' | ||
Fastly-Trace-Id: | ||
- wylcGg8FFv5zudofQ3PdXf | ||
Surrogate-Control: | ||
- max-age=86400, stale-if-error=86400 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
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
Oops, something went wrong.