-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: initial nitro mocking support
chore: mocking test secretes Pass test secretes using bin-mounted unencrypted file. chore: working worker and own Dockerfile Fix worker not to request TLS when connecting to redis under local testing. Provide own Dockerfile for local development that can also be used to run ipython shell. chore: ipython shell in a Docker container Initial support for running ipython shell as a docker compose service that connects to other services running locally.
- Loading branch information
Showing
33 changed files
with
711 additions
and
200 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,5 @@ prepare-*response.log | |
nitro-shim/tools/eifbuild/third_party/** | ||
nitro-image.eif | ||
bat-go-repro.tar | ||
|
||
/build/ |
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
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,37 @@ | ||
package nitro | ||
|
||
import ( | ||
"encoding/hex" | ||
"fmt" | ||
"os" | ||
"strings" | ||
) | ||
|
||
var enclaveMocking = os.Getenv("NITRO_ENCLAVE_MOCKING") != "" | ||
|
||
func EnclaveMocking() bool { | ||
return enclaveMocking | ||
} | ||
|
||
func mockTestPCR(pcrIndex int) []byte { | ||
// Create arbitrary but easily recognizable values in hex | ||
if pcrIndex < 0 || pcrIndex > 8 { | ||
panic("Invalid mocking PCR index") | ||
} | ||
testHex := fmt.Sprintf("abc%d", pcrIndex) | ||
testHex = strings.Repeat(testHex, PCRByteLength*2/4) | ||
pcr, err := hex.DecodeString(testHex) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return pcr | ||
} | ||
|
||
func ReadMockingSecretsFile(fileName string) string { | ||
dir := "payment-test/secrets/" | ||
bytes, err := os.ReadFile(dir + fileName) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return string(bytes) | ||
} |
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,5 @@ | ||
# Local files with development scretes. | ||
/secrets/ | ||
|
||
# Home in the container | ||
/container-home/ |
Oops, something went wrong.