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
3b1e6b28
Commit
3b1e6b28
authored
1 year ago
by
Neil-Jocelyn Schark
Browse files
Options
Downloads
Patches
Plain Diff
Ckms akms v2
See merge request
!46
parent
073d7694
No related branches found
No related tags found
1 merge request
!46
Ckms akms v2
Pipeline
#186797
passed
1 year ago
Stage: build
Stage: code-quality
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/configure-and-run-docker-playground.sh
+5
-9
5 additions, 9 deletions
config/configure-and-run-docker-playground.sh
ekms/internal/akmsCkmsServer/akmsCkmsServer.go
+10
-7
10 additions, 7 deletions
ekms/internal/akmsCkmsServer/akmsCkmsServer.go
with
15 additions
and
16 deletions
config/configure-and-run-docker-playground.sh
+
5
−
9
View file @
3b1e6b28
...
...
@@ -14,28 +14,24 @@ gnmic -a "172.100.20.10:7030" -u admin -p admin --insecure -e JSON_IETF set --up
sleep
2
# initiating a key request from kms01
curl
-X
POST
-H
"Content-Type: application/json"
-d
'{
"
local
_CKMS_ID": "172.100.20.13:50910",
"
receiving
_CKMS_ID": "172.100.20.13:50910",
"request_ID": "request_ID-1234",
"key_properties": [
{
"key_properties": {
"number": 1,
"key_length": 256,
"timeout": 20,
"TTL": 24
}
]
}'
'http://172.100.20.10:9696/api/v1/keys/ksa_key_req'
# initiating a key request from kms04
curl
-X
POST
-H
"Content-Type: application/json"
-d
'{
"
local
_CKMS_ID": "172.100.20.10:50910",
"
receiving
_CKMS_ID": "172.100.20.10:50910",
"request_ID": "request_ID-1234",
"key_properties": [
{
"number": 5,
"key_properties": {
"number": 1,
"key_length": 256,
"timeout": 20,
"TTL": 24
}
]
}'
'http://172.100.20.13:9696/api/v1/keys/ksa_key_req'
This diff is collapsed.
Click to expand it.
ekms/internal/akmsCkmsServer/akmsCkmsServer.go
+
10
−
7
View file @
3b1e6b28
...
...
@@ -43,9 +43,9 @@ type KeyProperties struct {
}
type
KMSKeyRequest
struct
{
Local
CKMSID
string
`json:"
local
_CKMS_ID"`
RequestID
string
`json:"request_ID"`
KeyProperties
[]
KeyProperties
`json:"key_properties"`
Receiving
CKMSID
string
`json:"
receiving
_CKMS_ID"`
RequestID
string
`json:"request_ID"`
KeyProperties
KeyProperties
`json:"key_properties"`
}
func
ksaReqHandler
(
ekms
*
kms
.
EKMS
)
http
.
HandlerFunc
{
...
...
@@ -58,11 +58,14 @@ func ksaReqHandler(ekms *kms.EKMS) http.HandlerFunc {
return
}
logrus
.
Infof
(
"received KSA key request for
local
CKMS %s, request ID %s, and key properties %v"
,
kmsKeyRequest
.
Local
CKMSID
,
kmsKeyRequest
.
RequestID
,
kmsKeyRequest
.
KeyProperties
)
logrus
.
Infof
(
"received KSA key request for
receiving
CKMS %s, request ID %s, and key properties %v"
,
kmsKeyRequest
.
Receiving
CKMSID
,
kmsKeyRequest
.
RequestID
,
kmsKeyRequest
.
KeyProperties
)
for
_
,
keyProperties
:=
range
kmsKeyRequest
.
KeyProperties
{
go
ekms
.
GenerateAndSendKSAKey
(
kmsKeyRequest
.
LocalCKMSID
,
kmsKeyRequest
.
RequestID
,
keyProperties
.
Number
)
//nolint:errcheck
err
=
ekms
.
GenerateAndSendKSAKey
(
kmsKeyRequest
.
ReceivingCKMSID
,
kmsKeyRequest
.
RequestID
,
kmsKeyRequest
.
KeyProperties
.
Number
)
//nolint:errcheck
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusInternalServerError
)
logrus
.
Errorf
(
"error generating and sending KSA key: %s"
,
err
)
return
}
logrus
.
Info
(
"requested all keys"
)
...
...
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