Skip to content

Commit 7663aa1

Browse files
committed
Added common model
1 parent 5fd09c2 commit 7663aa1

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/st2projects/ssh-sentinel-core
2+
3+
go 1.18

model/key_sign_request.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package model
2+
3+
type KeySignRequest struct {
4+
Username string `json:"username"`
5+
APIKey string `json:"api_key"`
6+
Principals []string `json:"principals"`
7+
Key string `json:"key"`
8+
}

model/key_sign_response.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package model
2+
3+
type KeySignResponse struct {
4+
Success bool `json:"success"`
5+
Message any `json:"message"`
6+
SignedKey string `json:"signedKey"`
7+
NotBefore uint64 `json:"notBefore"`
8+
NotAfter uint64 `json:"notAfter"`
9+
}
10+
11+
func NewKeySignResponse(success bool, message any) *KeySignResponse {
12+
return &KeySignResponse{
13+
success,
14+
message,
15+
"",
16+
0,
17+
0}
18+
}

0 commit comments

Comments
 (0)