forked from kryptco/kr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteam_request_protocol.go
72 lines (55 loc) · 1.93 KB
/
team_request_protocol.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package kr
import "encoding/json"
type CreateTeamRequest struct {
TeamInfo TeamInfo `json:"team_info"`
}
type TeamCheckpoint struct {
PublicKey []byte `json:"public_key"`
TeamPublicKey []byte `json:"team_public_key"`
LastBlockHash []byte `json:"last_block_hash"`
ServerEndpoints ServerEndpoints `json:"server_endpoints"`
}
type ServerEndpoints struct {
ApiHost string `json:"api_host"`
BillingHost string `json:"billing_host"`
}
type TeamOperationRequest struct {
Operation RequestableTeamOperation `json:"operation"`
}
type ReadTeamRequest struct {
PublicKey []byte `json:"public_key"`
}
type ReadToken struct {
Time *TimeToken `json:"time,omitempty"`
}
type TimeToken struct {
PublicKey []byte `json:"public_key"`
Expiration uint64 `json:"expiration"`
}
type RequestableTeamOperation struct {
DirectInvite *json.RawMessage `json:"direct_invite,omitempty"`
IndirectInvite *json.RawMessage `json:"indirect_invite,omitempty"`
CloseInvitations *json.RawMessage `json:"close_invitations,omitempty"`
Remove *json.RawMessage `json:"remove,omitempty"`
SetPolicy *Policy `json:"set_policy,omitempty"`
SetTeamInfo *TeamInfo `json:"set_team_info,omitempty"`
PinHostKey *SSHHostKey `json:"pin_host_key,omitempty"`
UnpinHostKey *SSHHostKey `json:"unpin_host_key,omitempty"`
AddLoggingEndpoint *LoggingEndpoint `json:"add_logging_endpoint,omitempty"`
RemoveLoggingEndpoint *LoggingEndpoint `json:"remove_logging_endpoint,omitempty"`
Promote *json.RawMessage `json:"promote,omitempty"`
Demote *json.RawMessage `json:"demote,omitempty"`
}
type Policy struct {
TemporaryApprovalSeconds *uint64 `json:"temporary_approval_seconds,omitempty"`
}
type TeamInfo struct {
Name string `json:"name,omitempty"`
}
type SSHHostKey struct {
Host string `json:"host"`
PublicKey []byte `json:"public_key"`
}
type LoggingEndpoint struct {
CommandEncrypted *struct{} `json:"command_encrypted,omitempty"`
}