Skip to content
Snippets Groups Projects
Commit 3764bce3 authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark
Browse files

wip

parent 3f5a04f1
No related branches found
No related tags found
2 merge requests!11Big boom integration,!6Draft: Akms ckms api implementation
Pipeline #181006 passed
...@@ -7,13 +7,11 @@ import ( ...@@ -7,13 +7,11 @@ import (
"code.fbi.h-da.de/danet/quant/ekms/internal/kms" "code.fbi.h-da.de/danet/quant/ekms/internal/kms"
) )
// Define AKMSReceiverServer.
type AKMSReceiverServer struct { type AKMSReceiverServer struct {
ekms *kms.EKMS ekms *kms.EKMS
server *http.Server server *http.Server
} }
// create NewAKMSReceiver.
func NewAKMSReceiver(port string, ekms *kms.EKMS) *AKMSReceiverServer { func NewAKMSReceiver(port string, ekms *kms.EKMS) *AKMSReceiverServer {
router := http.NewServeMux() router := http.NewServeMux()
...@@ -50,16 +48,15 @@ type KMSKeyRequest struct { ...@@ -50,16 +48,15 @@ type KMSKeyRequest struct {
} }
func ksaReqHandler(w http.ResponseWriter, r *http.Request) { func ksaReqHandler(w http.ResponseWriter, r *http.Request) {
// Parse the request body var kmsKeyRequest KMSKeyRequest
var req KMSKeyRequest err := json.NewDecoder(r.Body).Decode(&kmsKeyRequest)
err := json.NewDecoder(r.Body).Decode(&req)
if err != nil { if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest) http.Error(w, err.Error(), http.StatusBadRequest)
return return
} }
// Run go routine // Run go routine
//ekms.Stuff() //ekms.Stuff(kmsKeyRequest)
w.WriteHeader(http.StatusNoContent) w.WriteHeader(http.StatusNoContent)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment