Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
key-storage-agent
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
key-storage-agent
Commits
9770a472
Commit
9770a472
authored
6 years ago
by
Gospodin Bodurov
Browse files
Options
Downloads
Plain Diff
Merge branch 'devops20-monitoring' into 'master'
Devops20 monitoring See merge request
!23
parents
fdb9b8e8
cdcfd987
No related branches found
No related tags found
2 merge requests
!23
Devops20 monitoring
,
!15
WIP: Master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+4
-1
4 additions, 1 deletion
Makefile
handler/handler.go
+8
-0
8 additions, 0 deletions
handler/handler.go
with
12 additions
and
1 deletion
Makefile
+
4
−
1
View file @
9770a472
...
...
@@ -2,6 +2,9 @@ SERVER_OUT := "bin/server"
PKG
:=
"code.vereign.com/code/key-storage-agent"
SERVER_PKG_BUILD
:=
"
${
PKG
}
"
PKG_LIST
:=
$(
shell go list
${
PKG
}
/... |
grep
-v
/vendor/
)
BRANCH
:=
$(
shell git branch |
grep
\*
|
cut
-d
' '
-f2
)
COMMIT
:=
$(
shell git branch | git describe
--always
--long
--dirty
)
VER
:=
$(
BRANCH
)
.
$(
COMMIT
)
.PHONY
:
all api server
...
...
@@ -10,7 +13,7 @@ all: server
dep
:
##
Get the dependencies
dep ensure
server
:
dep
##
Build the binary file for server
@
go build
-i
-v
-o
$(
SERVER_OUT
)
$(
SERVER_PKG_BUILD
)
@
go build
-ldflags
=
"-X code.vereign.com/code/key-storage-agent/handler.version=
$(
VER
)
"
-i
-v
-o
$(
SERVER_OUT
)
$(
SERVER_PKG_BUILD
)
clean
:
##
Remove previous builds
@
rm
$(
SERVER_OUT
)
...
...
This diff is collapsed.
Click to expand it.
handler/handler.go
+
8
−
0
View file @
9770a472
...
...
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package
handler
import
(
"fmt"
"io/ioutil"
"strings"
...
...
@@ -43,6 +44,8 @@ type KeyStorageServerImpl struct {
MaxMessageSize
int
}
var
version
=
"undefined"
func
(
s
*
KeyStorageServerImpl
)
CreateAuthentication
(
ctx
context
.
Context
)
*
authentication
.
Authentication
{
if
md
,
ok
:=
metadata
.
FromIncomingContext
(
ctx
);
ok
{
uuid
:=
strings
.
Join
(
md
[
"uuid"
],
""
)
...
...
@@ -194,3 +197,8 @@ func (s *KeyStorageServerImpl) ReserveKeyUUID(ctx context.Context, in *api.Reser
return
reserveKeyUUIDResponse
,
nil
}
func
(
s
*
KeyStorageServerImpl
)
GetVersionKSA
(
ctx
context
.
Context
,
in
*
api
.
GetVersionKSAMessage
)
(
*
api
.
GetVersionKSAResponseMessage
,
error
)
{
fmt
.
Println
(
"Version: "
+
version
)
return
&
api
.
GetVersionKSAResponseMessage
{
Version
:
version
,
Errors
:
""
},
nil
}
\ No newline at end of file
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