|
|
|
@ -18,8 +18,8 @@ import ( |
|
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
|
"google.golang.org/grpc/credentials" |
|
|
|
|
"gorm.io/gorm" |
|
|
|
|
"src.whiteboxsystems.nl/DECOZO/okapidemo/certgen" |
|
|
|
|
"src.whiteboxsystems.nl/decozo/okapi" |
|
|
|
|
"src.whiteboxsystems.nl/decozo/okapidemo/cryptoutil" |
|
|
|
|
"src.whiteboxsystems.nl/decozo/okapidemo/his/model" |
|
|
|
|
"src.whiteboxsystems.nl/decozo/okapidemo/sharedmodel" |
|
|
|
|
) |
|
|
|
@ -28,7 +28,7 @@ func loadCert() *tls.Certificate { |
|
|
|
|
_, err := os.Stat("certs/client.crt") |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
_, _, certPem, keyPem, err := certgen.GenCert("whitebox", "whitebox") |
|
|
|
|
_, _, certPem, keyPem, err := cryptoutil.GenCert("whitebox", "whitebox") |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
panic(err) |
|
|
|
@ -266,7 +266,7 @@ func (srv *HISServer) Authenticate(c *gin.Context) { |
|
|
|
|
raw := "" |
|
|
|
|
method := "" |
|
|
|
|
if len(c.Request.TLS.PeerCertificates) > 0 { |
|
|
|
|
jwk, err := certgen.PublicKeyToJWK(c.Request.TLS.PeerCertificates[0].PublicKey) |
|
|
|
|
jwk, err := cryptoutil.PublicKeyToJWK(c.Request.TLS.PeerCertificates[0].PublicKey) |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
log.Printf("Error extracting public key JKW: %v", err) |
|
|
|
@ -568,7 +568,7 @@ func (srv *HISServer) GetPatient(c *gin.Context) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
f, err := os.Open(path.Join("./data/patients", patient.FileBase+".edi")) |
|
|
|
|
f, err := os.Open(path.Join("./patients", patient.FileBase+".edi")) |
|
|
|
|
if err != nil { |
|
|
|
|
c.Error(err) |
|
|
|
|
return |
|
|
|
@ -599,7 +599,7 @@ func (srv *HISServer) GetFHIRPatient(c *gin.Context) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
f, err := os.Open(path.Join("./data/patients", patient.FileBase+".fhir.json")) |
|
|
|
|
f, err := os.Open(path.Join("./patients", patient.FileBase+".fhir.json")) |
|
|
|
|
if err != nil { |
|
|
|
|
c.Error(err) |
|
|
|
|
return |
|
|
|
|