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
5ee77e8d
Verified
Commit
5ee77e8d
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
#228616
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 @
5ee77e8d
services
:
kms01
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms01.yaml"
]
volumes
:
-
./config/goKMS/example01.yaml:/tmp/kms/config/kms01.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4401:1337"
-
"
127.0.0.1:9696:9696"
kms02
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms02.yaml"
]
volumes
:
-
./config/goKMS/example02.yaml:/tmp/kms/config/kms02.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4402:1337"
kms03
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms03.yaml"
]
volumes
:
-
./config/goKMS/example03.yaml:/tmp/kms/config/kms03.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4403:1337"
kms04
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms04.yaml"
]
volumes
:
-
./config/goKMS/example04.yaml:/tmp/kms/config/kms04.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4404:1337"
-
"
127.0.0.1:9697:9696"
qlayer01
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer01.yaml"
]
volumes
:
-
./config/quantumlayer/example01.yaml:/tmp/quantumlayer/config/quantumlayer01.yaml
qlayer02
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer02.yaml"
]
volumes
:
-
./config/quantumlayer/example02.yaml:/tmp/quantumlayer/config/quantumlayer02.yaml
qlayer03
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer03.yaml"
]
volumes
:
-
./config/quantumlayer/example03.yaml:/tmp/quantumlayer/config/quantumlayer03.yaml
qlayer04
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer04.yaml"
]
volumes
:
-
./config/quantumlayer/example04.yaml:/tmp/quantumlayer/config/quantumlayer04.yaml
qlayer05
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer05.yaml"
]
volumes
:
-
./config/quantumlayer/example05.yaml:/tmp/quantumlayer/config/quantumlayer05.yaml
qlayer06
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer06.yaml"
]
volumes
:
-
./config/quantumlayer/example06.yaml:/tmp/quantumlayer/config/quantumlayer06.yaml
qlayer07
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer07.yaml"
]
volumes
:
-
./config/quantumlayer/example07.yaml:/tmp/quantumlayer/config/quantumlayer07.yaml
qlayer08
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer08.yaml"
]
volumes
:
-
./config/quantumlayer/example08.yaml:/tmp/quantumlayer/config/quantumlayer08.yaml
akms-receiver01
:
image
:
akms-simulator
akms-receiver02
:
image
:
akms-simulator
qkdn-controller
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller:qkdn-main
volumes
:
-
./config/controller/qkdn-gosdn.toml:/app/configs/qkdn-gosdn.toml
-
./config/controller/gNMISubscriptions.txt:/app/configs/gNMISubscriptions.txt
command
:
--config ./configs/qkdn-gosdn.toml
ports
:
-
"
127.0.0.1:55055:55055"
environment
:
GOSDN_ADMIN_PASSWORD
:
TestPassword
gosdnc
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/gosdnc:qkdn-main
volumes
:
-
./config/controller/add_devices.sh:/scripts/add_devices.sh
entrypoint
:
[
"
/scripts/add_devices.sh"
]
plugin-registry
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/plugin-registry:qkdn-main
mongo
:
image
:
mongo:7
environment
:
MONGO_INITDB_ROOT_USERNAME
:
root
MONGO_INITDB_ROOT_PASSWORD
:
example
rabbitmq
:
image
:
rabbitmq:3-management
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
kms01
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms01.yaml"
]
volumes
:
-
./config/goKMS/example01.yaml:/tmp/kms/config/kms01.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4401:1337"
-
"
127.0.0.1:9696:9696"
kms02
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms02.yaml"
]
volumes
:
-
./config/goKMS/example02.yaml:/tmp/kms/config/kms02.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4402:1337"
-
"
127.0.0.1:8090:8090"
-
"
127.0.0.1:7030:7030"
kms03
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms03.yaml"
]
volumes
:
-
./config/goKMS/example03.yaml:/tmp/kms/config/kms03.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4403:1337"
kms04
:
image
:
gokms
command
:
[
"
--log"
,
"
debug"
,
"
--kms_config"
,
"
/tmp/kms/config/kms04.yaml"
]
volumes
:
-
./config/goKMS/example04.yaml:/tmp/kms/config/kms04.yaml
-
./artifacts/ssl:/ssl
ports
:
-
"
127.0.0.1:4404:1337"
-
"
127.0.0.1:9697:9696"
qlayer01
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer01.yaml"
]
volumes
:
-
./config/quantumlayer/example01.yaml:/tmp/quantumlayer/config/quantumlayer01.yaml
qlayer02
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer02.yaml"
]
volumes
:
-
./config/quantumlayer/example02.yaml:/tmp/quantumlayer/config/quantumlayer02.yaml
qlayer03
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer03.yaml"
]
volumes
:
-
./config/quantumlayer/example03.yaml:/tmp/quantumlayer/config/quantumlayer03.yaml
qlayer04
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer04.yaml"
]
volumes
:
-
./config/quantumlayer/example04.yaml:/tmp/quantumlayer/config/quantumlayer04.yaml
qlayer05
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer05.yaml"
]
volumes
:
-
./config/quantumlayer/example05.yaml:/tmp/quantumlayer/config/quantumlayer05.yaml
qlayer06
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer06.yaml"
]
volumes
:
-
./config/quantumlayer/example06.yaml:/tmp/quantumlayer/config/quantumlayer06.yaml
qlayer07
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer07.yaml"
]
volumes
:
-
./config/quantumlayer/example07.yaml:/tmp/quantumlayer/config/quantumlayer07.yaml
qlayer08
:
image
:
quantumlayer
command
:
[
"
--config"
,
"
/tmp/quantumlayer/config/quantumlayer08.yaml"
]
volumes
:
-
./config/quantumlayer/example08.yaml:/tmp/quantumlayer/config/quantumlayer08.yaml
akms-receiver01
:
image
:
akms-simulator
akms-receiver02
:
image
:
akms-simulator
qkdn-controller
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller:qkdn-main
volumes
:
-
./config/controller/qkdn-gosdn.toml:/app/configs/qkdn-gosdn.toml
-
./config/controller/gNMISubscriptions.txt:/app/configs/gNMISubscriptions.txt
command
:
--config ./configs/qkdn-gosdn.toml
ports
:
-
"
127.0.0.1:55055:55055"
environment
:
GOSDN_ADMIN_PASSWORD
:
TestPassword
gosdnc
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/gosdnc:qkdn-main
volumes
:
-
./config/controller/add_devices.sh:/scripts/add_devices.sh
entrypoint
:
[
"
/scripts/add_devices.sh"
]
plugin-registry
:
image
:
registry.code.fbi.h-da.de/demoquandt/qkdn-controller/plugin-registry:qkdn-main
mongo
:
image
:
mongo:7
environment
:
MONGO_INITDB_ROOT_USERNAME
:
root
MONGO_INITDB_ROOT_PASSWORD
:
example
rabbitmq
:
image
:
rabbitmq:3-management
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 @
5ee77e8d
...
...
@@ -9,7 +9,6 @@ import (
"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/peers"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
)
...
...
@@ -27,7 +26,7 @@ var endpoints = map[string]string{
qkdInterface
:
"/qkdInterface"
,
interCKMSInterface
:
"/interCKMSInterface"
,
akmsInterface
:
"/akmsInterface"
,
setKeyStore
:
"/set
KeyS
tore"
,
setKeyStore
:
"/set
_key_s
tore"
,
}
type
QkdnManagerServer
struct
{
...
...
@@ -182,23 +181,21 @@ func (qs *QkdnManagerServer) handleHttpAkmsInterface(w http.ResponseWriter, r *h
func
(
qs
*
QkdnManagerServer
)
handleSetKeyStore
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
logrus
.
Debugf
(
"Handler for SetKeyStore got request from: %s"
,
r
.
RemoteAddr
)
err
:=
r
.
ParseForm
()
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
r
et
urn
var
parsedRequest
struct
{
KeyFillLevel
int
`json:"key_fill_level"`
PeerIDs
[]
string
`json:"peer_ids"`
F
et
ch
bool
`json:"fetch"`
}
keyFillLevel
:=
r
.
Form
.
Get
(
"KeyFillLevel"
)
peerIDs
,
ok
:=
r
.
Form
[
"PeerIds"
]
if
!
ok
{
http
.
Error
(
w
,
fmt
.
Sprintf
(
"No peer IDs provided."
),
http
.
StatusBadRequest
)
err
:=
json
.
NewDecoder
(
r
.
Body
)
.
Decode
(
&
parsedRequest
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
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
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
...
...
@@ -209,17 +206,13 @@ func (qs *QkdnManagerServer) handleSetKeyStore(w http.ResponseWriter, r *http.Re
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
return
}
eqm
,
ok
:=
peer
.
QuantumModule
()
.
(
*
peers
.
ETSI014HTTPQuantumModule
)
if
!
ok
{
http
.
Error
(
w
,
fmt
.
Sprintf
(
"QuantumModule is not of Type ETSI014"
),
http
.
StatusBadRequest
)
return
}
if
fetch
==
"true"
{
eqm
:=
peer
.
QuantumModule
()
if
parsedRequest
.
Fetch
==
true
{
if
err
:=
eqm
.
Initialize
();
err
!=
nil
{
http
.
Error
(
w
,
fmt
.
Sprintf
(
"Failed to restart fetching for quantum module of peer: %s"
,
peerID
),
http
.
StatusBadRequest
)
return
}
}
else
if
f
etch
==
"
false
"
{
}
else
if
parsedRequest
.
F
etch
==
false
{
eqm
.
SetActive
(
false
)
if
err
:=
peer
.
ResetKeyStore
(
qs
.
kms
.
GetID
()
.
String
());
err
!=
nil
{
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