/
requests.go
45 lines (37 loc) · 1.07 KB
/
requests.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
package api
import (
"github.com/evilsocket/shieldwall/database"
"github.com/evilsocket/shieldwall/firewall"
)
type UserRegisterRequest struct {
Email string `json:"email"`
Password string `json:"password"`
}
type UserUpdateRequest struct {
NewPassword string `json:"password"`
Use2FA bool `json:"use_2fa"`
}
type UserLoginRequest struct {
Email string `json:"email"`
Password string `json:"password"`
}
type UserResponse struct {
Token string `json:"token"`
User *database.User `json:"data"`
Address string `json:"address"`
}
type Step2Request struct {
Code string `json:"code"`
}
type AgentCreationRequest struct {
Name string `json:"name"`
Rules []*firewall.Rule `json:"rules"`
AlertAfter uint `json:"alert_after"`
AlertPeriod uint `json:"alert_period"`
}
type AgentUpdateRequest struct {
Name string `json:"name"`
Rules []*firewall.Rule `json:"rules"`
AlertAfter uint `json:"alert_after"`
AlertPeriod uint `json:"alert_period"`
}