-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservices.go
93 lines (87 loc) · 1.95 KB
/
services.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package main
import "encoding/json"
var SupportedServices = []ServiceType{
{
Kind: "misp",
Type: []string{"md5", "sha1", "sha256", "sha512", "ipv4", "ipv6", "email", "url", "domain", "filepath", "filename"},
RouteMap: make([]RouteMap, 0),
},
{
Kind: "deepfry",
Type: []string{"ipv4", "ipv6"},
RouteMap: make([]RouteMap, 0),
},
{
Kind: "virustotal",
Type: []string{"md5", "sha1", "sha256", "sha512", "ipv4", "ipv6", "url", "domain", "filepath", "filename"},
RouteMap: []RouteMap{
{
Type: "md5",
Route: "files",
},
{
Type: "sha1",
Route: "files",
},
{
Type: "sha256",
Route: "files",
},
{
Type: "sha512",
Route: "files",
},
{
Type: "ipv4",
Route: "ip_addresses",
},
{
Type: "ipv6",
Route: "ip_addresses",
},
{
Type: "url",
Route: "urls",
},
{
Type: "domain",
Route: "domains",
},
{
Type: "filepath",
Route: "files",
},
{
Type: "filename",
Route: "files",
},
},
},
}
type ServiceType struct {
UploadService bool `json:"upload_service"`
Expires int `json:"expires"`
Secret string `json:"secret"`
Selected bool `json:"selected"`
Insecure bool `json:"insecure"`
Name string `json:"name"`
URL string `json:"url"`
RateLimited bool `json:"rate_limited"`
MaxRequests int `json:"max_requests"`
RefillRate int `json:"refill_rate"`
AuthType string `json:"auth_type"`
Key string `json:"key"`
Kind string `json:"kind"`
Type []string `json:"type"`
RouteMap []RouteMap `json:"route_map"`
}
type RouteMap struct {
Type string `json:"type"`
Route string `json:"route"`
}
func (s *ServiceType) MarshalBinary() ([]byte, error) {
return json.Marshal(s)
}
func (s *ServiceType) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, s)
}