Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
quant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
quant
Commits
19b4c3bc
Verified
Commit
19b4c3bc
authored
6 months ago
by
Malte Bauch
Browse files
Options
Downloads
Patches
Plain Diff
Change endpoint from setKeyStore to set_key_store
parent
297957be
No related branches found
No related tags found
No related merge requests found
Pipeline
#228614
passed
6 months ago
Stage: build
Stage: build-integration-test
Stage: test
Stage: analyze
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docker-compose.yml
+133
-127
133 additions, 127 deletions
docker-compose.yml
goKMS/qkdnManager/server.go
+13
-20
13 additions, 20 deletions
goKMS/qkdnManager/server.go
with
146 additions
and
147 deletions
docker-compose.yml
+
133
−
127
View file @
19b4c3bc
services
:
services
:
kms01
:
kms01
:
image
:
gokms
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms01.yaml"
]
command
:
volumes
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms01.yaml"
]
-
./config/goKMS/example01.yaml:/tmp/kms/config/kms01.yaml
volumes
:
-
./artifacts/ssl:/ssl
-
./config/goKMS/example01.yaml:/tmp/kms/config/kms01.yaml
ports
:
-
./artifacts/ssl:/ssl
-
"
127.0.0.1:4401:1337"
ports
:
-
"
127.0.0.1:9696:9696"
-
"
127.0.0.1:4401:1337"
-
"
127.0.0.1:9696:9696"
kms02
:
image
:
gokms
kms02
:
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms02.yaml"
]
image
:
gokms
volumes
:
command
:
-
./config/goKMS/example02.yaml:/tmp/kms/config/kms02.yaml
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms02.yaml"
]
-
./artifacts/ssl:/ssl
volumes
:
ports
:
-
./config/goKMS/example02.yaml:/tmp/kms/config/kms02.yaml
-
"
127.0.0.1:4402:1337"
-
./artifacts/ssl:/ssl
ports
:
kms03
:
-
"
127.0.0.1:4402:1337"
image
:
gokms
-
"
127.0.0.1:8090:8090"
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms03.yaml"
]
-
"
127.0.0.1:7030:7030"
volumes
:
-
./config/goKMS/example03.yaml:/tmp/kms/config/kms03.yaml
kms03
:
-
./artifacts/ssl:/ssl
image
:
gokms
ports
:
command
:
-
"
127.0.0.1:4403:1337"
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms03.yaml"
]
volumes
:
kms04
:
-
./config/goKMS/example03.yaml:/tmp/kms/config/kms03.yaml
image
:
gokms
-
./artifacts/ssl:/ssl
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms04.yaml"
]
ports
:
volumes
:
-
"
127.0.0.1:4403:1337"
-
./config/goKMS/example04.yaml:/tmp/kms/config/kms04.yaml
-
./artifacts/ssl:/ssl
kms04
:
ports
:
image
:
gokms
-
"
127.0.0.1:4404:1337"
command
:
-
"
127.0.0.1:9697:9696"
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms04.yaml"
]
volumes
:
qlayer01
:
-
./config/goKMS/example04.yaml:/tmp/kms/config/kms04.yaml
image
:
quantumlayer
-
./artifacts/ssl:/ssl
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer01.yaml"
]
ports
:
volumes
:
-
"
127.0.0.1:4404:1337"
-
./config/quantumlayer/example01.yaml:/tmp/quantumlayer/config/quantumlayer01.yaml
-
"
127.0.0.1:9697:9696"
qlayer02
:
qlayer01
:
image
:
quantumlayer
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer02.yaml"
]
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer01.yaml"
]
volumes
:
volumes
:
-
./config/quantumlayer/example02.yaml:/tmp/quantumlayer/config/quantumlayer02.yaml
-
./config/quantumlayer/example01.yaml:/tmp/quantumlayer/config/quantumlayer01.yaml
qlayer03
:
qlayer02
:
image
:
quantumlayer
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer03.yaml"
]
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer02.yaml"
]
volumes
:
volumes
:
-
./config/quantumlayer/example03.yaml:/tmp/quantumlayer/config/quantumlayer03.yaml
-
./config/quantumlayer/example02.yaml:/tmp/quantumlayer/config/quantumlayer02.yaml
qlayer04
:
qlayer03
:
image
:
quantumlayer
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer04.yaml"
]
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer03.yaml"
]
volumes
:
volumes
:
-
./config/quantumlayer/example04.yaml:/tmp/quantumlayer/config/quantumlayer04.yaml
-
./config/quantumlayer/example03.yaml:/tmp/quantumlayer/config/quantumlayer03.yaml
qlayer05
:
qlayer04
:
image
:
quantumlayer
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer05.yaml"
]
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer04.yaml"
]
volumes
:
volumes
:
-
./config/quantumlayer/example05.yaml:/tmp/quantumlayer/config/quantumlayer05.yaml
-
./config/quantumlayer/example04.yaml:/tmp/quantumlayer/config/quantumlayer04.yaml
qlayer06
:
qlayer05
:
image
:
quantumlayer
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer06.yaml"
]
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer05.yaml"
]
volumes
:
volumes
:
-
./config/quantumlayer/example06.yaml:/tmp/quantumlayer/config/quantumlayer06.yaml
-
./config/quantumlayer/example05.yaml:/tmp/quantumlayer/config/quantumlayer05.yaml
qlayer07
:
qlayer06
:
image
:
quantumlayer
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer07.yaml"
]
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer06.yaml"
]
volumes
:
volumes
:
-
./config/quantumlayer/example07.yaml:/tmp/quantumlayer/config/quantumlayer07.yaml
-
./config/quantumlayer/example06.yaml:/tmp/quantumlayer/config/quantumlayer06.yaml
qlayer08
:
qlayer07
:
image
:
quantumlayer
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer08.yaml"
]
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer07.yaml"
]
volumes
:
volumes
:
-
./config/quantumlayer/example08.yaml:/tmp/quantumlayer/config/quantumlayer08.yaml
-
./config/quantumlayer/example07.yaml:/tmp/quantumlayer/config/quantumlayer07.yaml
akms-receiver01
:
qlayer08
:
image
:
akms-simulator
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer08.yaml"
]
akms-receiver02
:
volumes
:
image
:
akms-simulator
-
./config/quantumlayer/example08.yaml:/tmp/quantumlayer/config/quantumlayer08.yaml
qkdn-controller
:
akms-receiver01
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller:qkdn-main
image
:
akms-simulator
volumes
:
-
./config/controller/qkdn-gosdn.toml:/app/configs/qkdn-gosdn.toml
akms-receiver02
:
-
./config/controller/gNMISubscriptions.txt:/app/configs/gNMISubscriptions.txt
image
:
akms-simulator
command
:
--config ./configs/qkdn-gosdn.toml
ports
:
qkdn-controller
:
-
"
127.0.0.1:55055:55055"
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller:qkdn-main
environment
:
volumes
:
GOSDN_ADMIN_PASSWORD
:
TestPassword
-
./config/controller/qkdn-gosdn.toml:/app/configs/qkdn-gosdn.toml
-
./config/controller/gNMISubscriptions.txt:/app/configs/gNMISubscriptions.txt
gosdnc
:
command
:
--config ./configs/qkdn-gosdn.toml
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/gosdnc:qkdn-main
ports
:
volumes
:
-
"
127.0.0.1:55055:55055"
-
./config/controller/add_devices.sh:/scripts/add_devices.sh
environment
:
entrypoint
:
[
"
/scripts/add_devices.sh"
]
GOSDN_ADMIN_PASSWORD
:
TestPassword
plugin-registry
:
gosdnc
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/plugin-registry:qkdn-main
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/gosdnc:qkdn-main
volumes
:
mongo
:
-
./config/controller/add_devices.sh:/scripts/add_devices.sh
image
:
mongo:7
entrypoint
:
[
"
/scripts/add_devices.sh"
]
environment
:
MONGO_INITDB_ROOT_USERNAME
:
root
plugin-registry
:
MONGO_INITDB_ROOT_PASSWORD
:
example
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/plugin-registry:qkdn-main
rabbitmq
:
mongo
:
image
:
rabbitmq:3-management
image
:
mongo:7
environment
:
routing-app
:
MONGO_INITDB_ROOT_USERNAME
:
root
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/routing-app:qkdn-main
MONGO_INITDB_ROOT_PASSWORD
:
example
entrypoint
:
[
"
./start_ra_sleep.sh"
]
volumes
:
rabbitmq
:
-
./config/controller/start_ra_sleep.sh:/app/start_ra_sleep.sh
image
:
rabbitmq:3-management
-
./config/controller/routing-config.yaml:/new/routing-config.yaml
routing-app
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/routing-app:qkdn-main
entrypoint
:
[
"
./start_ra_sleep.sh"
]
volumes
:
-
./config/controller/start_ra_sleep.sh:/app/start_ra_sleep.sh
-
./config/controller/routing-config.yaml:/new/routing-config.yaml
This diff is collapsed.
Click to expand it.
goKMS/qkdnManager/server.go
+
13
−
20
View file @
19b4c3bc
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
"code.fbi.h-da.de/danet/quant/goKMS/config"
"code.fbi.h-da.de/danet/quant/goKMS/config"
"code.fbi.h-da.de/danet/quant/goKMS/kms"
"code.fbi.h-da.de/danet/quant/goKMS/kms"
"code.fbi.h-da.de/danet/quant/goKMS/kms/peers"
"github.com/google/uuid"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
)
)
...
@@ -27,7 +26,7 @@ var endpoints = map[string]string{
...
@@ -27,7 +26,7 @@ var endpoints = map[string]string{
qkdInterface
:
"/qkdInterface"
,
qkdInterface
:
"/qkdInterface"
,
interCKMSInterface
:
"/interCKMSInterface"
,
interCKMSInterface
:
"/interCKMSInterface"
,
akmsInterface
:
"/akmsInterface"
,
akmsInterface
:
"/akmsInterface"
,
setKeyStore
:
"/set
KeyS
tore"
,
setKeyStore
:
"/set
_key_s
tore"
,
}
}
type
QkdnManagerServer
struct
{
type
QkdnManagerServer
struct
{
...
@@ -182,23 +181,21 @@ func (qs *QkdnManagerServer) handleHttpAkmsInterface(w http.ResponseWriter, r *h
...
@@ -182,23 +181,21 @@ func (qs *QkdnManagerServer) handleHttpAkmsInterface(w http.ResponseWriter, r *h
func
(
qs
*
QkdnManagerServer
)
handleSetKeyStore
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
(
qs
*
QkdnManagerServer
)
handleSetKeyStore
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
logrus
.
Debugf
(
"Handler for SetKeyStore got request from: %s"
,
r
.
RemoteAddr
)
logrus
.
Debugf
(
"Handler for SetKeyStore got request from: %s"
,
r
.
RemoteAddr
)
err
:=
r
.
ParseForm
()
var
parsedRequest
struct
{
if
err
!=
nil
{
KeyFillLevel
int
`json:"key_fill_level"`
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
PeerIDs
[]
string
`json:"peer_ids"`
r
et
urn
F
et
ch
bool
`json:"fetch"`
}
}
keyFillLevel
:=
r
.
Form
.
Get
(
"KeyFillLevel"
)
err
:=
json
.
NewDecoder
(
r
.
Body
)
.
Decode
(
&
parsedRequest
)
peerIDs
,
ok
:=
r
.
Form
[
"PeerIds"
]
if
err
!=
nil
{
if
!
ok
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
fmt
.
Sprintf
(
"No peer IDs provided."
),
http
.
StatusBadRequest
)
return
return
}
}
fetch
:=
r
.
Form
.
Get
(
"Fetch"
)
logrus
.
Debugf
(
"KeyFillLevel: %
s
, PeerIDs: %v, Fetch: %
s
"
,
keyFillLevel
,
peerIDs
,
f
etch
)
logrus
.
Debugf
(
"KeyFillLevel: %
d
, PeerIDs: %v, Fetch: %
t
"
,
parsedRequest
.
KeyFillLevel
,
parsedRequest
.
PeerIDs
,
parsedRequest
.
F
etch
)
for
_
,
peerID
:=
range
peerIDs
{
for
_
,
peerID
:=
range
p
arsedRequest
.
P
eerIDs
{
peerUUID
,
err
:=
uuid
.
Parse
(
peerID
)
peerUUID
,
err
:=
uuid
.
Parse
(
peerID
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
...
@@ -209,17 +206,13 @@ func (qs *QkdnManagerServer) handleSetKeyStore(w http.ResponseWriter, r *http.Re
...
@@ -209,17 +206,13 @@ func (qs *QkdnManagerServer) handleSetKeyStore(w http.ResponseWriter, r *http.Re
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
return
return
}
}
eqm
,
ok
:=
peer
.
QuantumModule
()
.
(
*
peers
.
ETSI014HTTPQuantumModule
)
eqm
:=
peer
.
QuantumModule
()
if
!
ok
{
if
parsedRequest
.
Fetch
==
true
{
http
.
Error
(
w
,
fmt
.
Sprintf
(
"QuantumModule is not of Type ETSI014"
),
http
.
StatusBadRequest
)
return
}
if
fetch
==
"true"
{
if
err
:=
eqm
.
Initialize
();
err
!=
nil
{
if
err
:=
eqm
.
Initialize
();
err
!=
nil
{
http
.
Error
(
w
,
fmt
.
Sprintf
(
"Failed to restart fetching for quantum module of peer: %s"
,
peerID
),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
fmt
.
Sprintf
(
"Failed to restart fetching for quantum module of peer: %s"
,
peerID
),
http
.
StatusBadRequest
)
return
return
}
}
}
else
if
f
etch
==
"
false
"
{
}
else
if
parsedRequest
.
F
etch
==
false
{
eqm
.
SetActive
(
false
)
eqm
.
SetActive
(
false
)
if
err
:=
peer
.
ResetKeyStore
(
qs
.
kms
.
GetID
()
.
String
());
err
!=
nil
{
if
err
:=
peer
.
ResetKeyStore
(
qs
.
kms
.
GetID
()
.
String
());
err
!=
nil
{
eqm
.
SetActive
(
true
)
eqm
.
SetActive
(
true
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment