mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-01 04:24:38 -04:00
AB#2512 Config secrets via env var & config refactoring (#544)
* refactor measurements to use consistent types and less byte pushing * refactor: only rely on a single multierr dependency * extend config creation with envar support * document changes Signed-off-by: Fabian Kammel <fk@edgeless.systems>
This commit is contained in:
parent
80a801629e
commit
bb76a4e4c8
42 changed files with 932 additions and 791 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/attestation/measurements"
|
||||
"github.com/edgelesssys/constellation/v2/internal/logger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -20,7 +21,7 @@ import (
|
|||
type Server struct {
|
||||
log *logger.Logger
|
||||
server http.Server
|
||||
measurements map[uint32][]byte
|
||||
measurements measurements.M
|
||||
done chan<- struct{}
|
||||
}
|
||||
|
||||
|
@ -72,7 +73,7 @@ func (s *Server) logPCRs(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
// unmarshal the request body into a map of PCRs
|
||||
var pcrs map[uint32][]byte
|
||||
var pcrs measurements.M
|
||||
if err := json.NewDecoder(r.Body).Decode(&pcrs); err != nil {
|
||||
log.With(zap.Error(err)).Errorf("Failed to read request body")
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
|
@ -89,6 +90,6 @@ func (s *Server) logPCRs(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
// GetMeasurements returns the static measurements for QEMU environment.
|
||||
func (s *Server) GetMeasurements() map[uint32][]byte {
|
||||
func (s *Server) GetMeasurements() measurements.M {
|
||||
return s.measurements
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue