WIP: HTTP-01 solver that stores challenge tokens in FrostFS #4

Draft
potyarkin wants to merge 9 commits from potyarkin/lego:feature/http-01-frostfs-solver into tcl/http-01-frostfs-solver
Showing only changes of commit 23e60f1e98 - Show all commits

View file

@ -9,22 +9,22 @@ import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"os"
"sync"
)
// Initialize storage backend for tests
func openStorage(t *testing.T) *Storage {
const (
cid_hardcoded = "348WWfBKbS79Wbmm38MRE3oBoEDM5Ga1XXbGKGNyisDM"
endpoint_hardcoded = "grpc://localhost:8802"
)
// We will use an ephemeral key to write to publicly writable container
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
cid := os.Getenv("FROSTFS_CID") // example: 348WWfBKbS79Wbmm38MRE3oBoEDM5Ga1XXbGKGNyisDM
endpoint := os.Getenv("FROSTFS_ENDPOINT") // example: grpc://localhost:8802
if cid == "" || endpoint == "" {
t.Skipf("one or more environment variables not set: FROSTFS_ENDPOINT, FROSTFS_CID")
}
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) // TODO: using ephemeral keys for now, later read from env vars
if err != nil {
t.Fatal(err)
}
storage, err := Open(endpoint_hardcoded, cid_hardcoded, key)
storage, err := Open(endpoint, cid, key)
if err != nil {
t.Fatal(err)
}