Просмотр исходного кода

Update golangci-lint to 1.40.1

tags/v2.1.0^2
9seconds 5 лет назад
Родитель
Сommit
e1864377c2

+ 1
- 1
.github/workflows/ci.yaml Просмотреть файл

70
       - name: Run linter
70
       - name: Run linter
71
         uses: golangci/golangci-lint-action@v2
71
         uses: golangci/golangci-lint-action@v2
72
         with:
72
         with:
73
-          version: v1.39.0
73
+          version: v1.40.1
74
 
74
 
75
   docker:
75
   docker:
76
     name: Docker
76
     name: Docker

+ 1
- 1
Makefile Просмотреть файл

2
 IMAGE_NAME   := mtg
2
 IMAGE_NAME   := mtg
3
 APP_NAME     := $(IMAGE_NAME)
3
 APP_NAME     := $(IMAGE_NAME)
4
 
4
 
5
-GOLANGCI_LINT_VERSION := v1.39.0
5
+GOLANGCI_LINT_VERSION := v1.40.1
6
 
6
 
7
 VERSION_GO         := $(shell go version)
7
 VERSION_GO         := $(shell go version)
8
 VERSION_DATE       := $(shell date -Ru)
8
 VERSION_DATE       := $(shell date -Ru)

+ 4
- 4
internal/cli/access.go Просмотреть файл

26
 type accessResponseURLs struct {
26
 type accessResponseURLs struct {
27
 	IP        net.IP `json:"ip"`
27
 	IP        net.IP `json:"ip"`
28
 	Port      uint   `json:"port"`
28
 	Port      uint   `json:"port"`
29
-	TgURL     string `json:"tg_url"`
30
-	TgQrCode  string `json:"tg_qrcode"`
31
-	TmeURL    string `json:"tme_url"`
32
-	TmeQrCode string `json:"tme_qrcode"`
29
+	TgURL     string `json:"tg_url"`     // nolint: tagliatelle
30
+	TgQrCode  string `json:"tg_qrcode"`  // nolint: tagliatelle
31
+	TmeURL    string `json:"tme_url"`    // nolint: tagliatelle
32
+	TmeQrCode string `json:"tme_qrcode"` // nolint: tagliatelle
33
 }
33
 }
34
 
34
 
35
 type Access struct {
35
 type Access struct {

+ 32
- 32
internal/config/config.go Просмотреть файл

12
 type Config struct {
12
 type Config struct {
13
 	Debug                bool          `json:"debug"`
13
 	Debug                bool          `json:"debug"`
14
 	Secret               mtglib.Secret `json:"secret"`
14
 	Secret               mtglib.Secret `json:"secret"`
15
-	BindTo               TypeHostPort  `json:"bind-to"`
16
-	TCPBuffer            TypeBytes     `json:"tcp-buffer"`
17
-	PreferIP             TypePreferIP  `json:"prefer-ip"`
18
-	DomainFrontingPort   TypePort      `json:"domain-fronting-port"`
19
-	TolerateTimeSkewness TypeDuration  `json:"tolerate-time-skewness"`
15
+	BindTo               TypeHostPort  `json:"bindTo"`
16
+	TCPBuffer            TypeBytes     `json:"tcpBuffer"`
17
+	PreferIP             TypePreferIP  `json:"preferIp"`
18
+	DomainFrontingPort   TypePort      `json:"domainFrontingPort"`
19
+	TolerateTimeSkewness TypeDuration  `json:"tolerateTimeSkewness"`
20
 	Concurrency          uint          `json:"concurrency"`
20
 	Concurrency          uint          `json:"concurrency"`
21
 	Defense              struct {
21
 	Defense              struct {
22
 		AntiReplay struct {
22
 		AntiReplay struct {
23
 			Enabled   bool          `json:"enabled"`
23
 			Enabled   bool          `json:"enabled"`
24
-			MaxSize   TypeBytes     `json:"max-size"`
25
-			ErrorRate TypeErrorRate `json:"error-rate"`
26
-		} `json:"anti-replay"`
24
+			MaxSize   TypeBytes     `json:"maxSize"`
25
+			ErrorRate TypeErrorRate `json:"errorRate"`
26
+		} `json:"antiReplay"`
27
 		Blocklist struct {
27
 		Blocklist struct {
28
 			Enabled             bool               `json:"enabled"`
28
 			Enabled             bool               `json:"enabled"`
29
-			DownloadConcurrency uint               `json:"download-concurrency"`
29
+			DownloadConcurrency uint               `json:"downloadConcurrency"`
30
 			URLs                []TypeBlocklistURI `json:"urls"`
30
 			URLs                []TypeBlocklistURI `json:"urls"`
31
-			UpdateEach          TypeDuration       `json:"update-each"`
31
+			UpdateEach          TypeDuration       `json:"updateEach"`
32
 		} `json:"blocklist"`
32
 		} `json:"blocklist"`
33
 	} `json:"defense"`
33
 	} `json:"defense"`
34
 	Network struct {
34
 	Network struct {
37
 			HTTP TypeDuration `json:"http"`
37
 			HTTP TypeDuration `json:"http"`
38
 			Idle TypeDuration `json:"idle"`
38
 			Idle TypeDuration `json:"idle"`
39
 		} `json:"timeout"`
39
 		} `json:"timeout"`
40
-		DOHIP   TypeIP    `json:"doh-ip"`
40
+		DOHIP   TypeIP    `json:"dohIp"`
41
 		Proxies []TypeURL `json:"proxies"`
41
 		Proxies []TypeURL `json:"proxies"`
42
 	} `json:"network"`
42
 	} `json:"network"`
43
 	Stats struct {
43
 	Stats struct {
44
 		StatsD struct {
44
 		StatsD struct {
45
 			Enabled      bool                `json:"enabled"`
45
 			Enabled      bool                `json:"enabled"`
46
 			Address      TypeHostPort        `json:"address"`
46
 			Address      TypeHostPort        `json:"address"`
47
-			MetricPrefix TypeMetricPrefix    `json:"metric-prefix"`
48
-			TagFormat    TypeStatsdTagFormat `json:"tag-format"`
47
+			MetricPrefix TypeMetricPrefix    `json:"metricPrefix"`
48
+			TagFormat    TypeStatsdTagFormat `json:"tagFormat"`
49
 		} `json:"statsd"`
49
 		} `json:"statsd"`
50
 		Prometheus struct {
50
 		Prometheus struct {
51
 			Enabled      bool             `json:"enabled"`
51
 			Enabled      bool             `json:"enabled"`
52
-			BindTo       TypeHostPort     `json:"bind-to"`
53
-			HTTPPath     TypeHTTPPath     `json:"http-path"`
54
-			MetricPrefix TypeMetricPrefix `json:"metric-prefix"`
52
+			BindTo       TypeHostPort     `json:"bindTo"`
53
+			HTTPPath     TypeHTTPPath     `json:"httpPath"`
54
+			MetricPrefix TypeMetricPrefix `json:"metricPrefix"`
55
 		} `json:"prometheus"`
55
 		} `json:"prometheus"`
56
 	} `json:"stats"`
56
 	} `json:"stats"`
57
 }
57
 }
84
 type configRaw struct {
84
 type configRaw struct {
85
 	Debug                bool   `toml:"debug" json:"debug,omitempty"`
85
 	Debug                bool   `toml:"debug" json:"debug,omitempty"`
86
 	Secret               string `toml:"secret" json:"secret"`
86
 	Secret               string `toml:"secret" json:"secret"`
87
-	BindTo               string `toml:"bind-to" json:"bind-to"`
88
-	TCPBuffer            string `toml:"tcp-buffer" json:"tcp-buffer,omitempty"`
89
-	PreferIP             string `toml:"prefer-ip" json:"prefer-ip,omitempty"`
90
-	DomainFrontingPort   uint   `toml:"domain-fronting-port" json:"domain-fronting-port,omitempty"`
91
-	TolerateTimeSkewness string `toml:"tolerate-time-skewness" json:"tolerate-time-skewness,omitempty"`
87
+	BindTo               string `toml:"bind-to" json:"bindTo"`
88
+	TCPBuffer            string `toml:"tcp-buffer" json:"tcpBuffer,omitempty"`
89
+	PreferIP             string `toml:"prefer-ip" json:"preferIp,omitempty"`
90
+	DomainFrontingPort   uint   `toml:"domain-fronting-port" json:"domainFrontingPort,omitempty"`
91
+	TolerateTimeSkewness string `toml:"tolerate-time-skewness" json:"tolerateTimeSkewness,omitempty"`
92
 	Concurrency          uint   `toml:"concurrency" json:"concurrency,omitempty"`
92
 	Concurrency          uint   `toml:"concurrency" json:"concurrency,omitempty"`
93
 	Defense              struct {
93
 	Defense              struct {
94
 		AntiReplay struct {
94
 		AntiReplay struct {
95
 			Enabled   bool    `toml:"enabled" json:"enabled,omitempty"`
95
 			Enabled   bool    `toml:"enabled" json:"enabled,omitempty"`
96
-			MaxSize   string  `toml:"max-size" json:"max-size,omitempty"`
97
-			ErrorRate float64 `toml:"error-rate" json:"error-rate,omitempty"`
98
-		} `toml:"anti-replay" json:"anti-replay,omitempty"`
96
+			MaxSize   string  `toml:"max-size" json:"maxSize,omitempty"`
97
+			ErrorRate float64 `toml:"error-rate" json:"errorRate,omitempty"`
98
+		} `toml:"anti-replay" json:"antiReplay,omitempty"`
99
 		Blocklist struct {
99
 		Blocklist struct {
100
 			Enabled             bool     `toml:"enabled" json:"enabled,omitempty"`
100
 			Enabled             bool     `toml:"enabled" json:"enabled,omitempty"`
101
-			DownloadConcurrency uint     `toml:"download-concurrency" json:"download-concurrency,omitempty"`
101
+			DownloadConcurrency uint     `toml:"download-concurrency" json:"downloadConcurrency,omitempty"`
102
 			URLs                []string `toml:"urls" json:"urls,omitempty"`
102
 			URLs                []string `toml:"urls" json:"urls,omitempty"`
103
-			UpdateEach          string   `toml:"update-each" json:"update-each,omitempty"`
103
+			UpdateEach          string   `toml:"update-each" json:"updateEach,omitempty"`
104
 		} `toml:"blocklist" json:"blocklist,omitempty"`
104
 		} `toml:"blocklist" json:"blocklist,omitempty"`
105
 	} `toml:"defense" json:"defense,omitempty"`
105
 	} `toml:"defense" json:"defense,omitempty"`
106
 	Network struct {
106
 	Network struct {
109
 			HTTP string `toml:"http" json:"http,omitempty"`
109
 			HTTP string `toml:"http" json:"http,omitempty"`
110
 			Idle string `toml:"idle" json:"idle,omitempty"`
110
 			Idle string `toml:"idle" json:"idle,omitempty"`
111
 		} `toml:"timeout" json:"timeout,omitempty"`
111
 		} `toml:"timeout" json:"timeout,omitempty"`
112
-		DOHIP   string   `toml:"doh-ip" json:"doh-ip,omitempty"`
112
+		DOHIP   string   `toml:"doh-ip" json:"dohIp,omitempty"`
113
 		Proxies []string `toml:"proxies" json:"proxies,omitempty"`
113
 		Proxies []string `toml:"proxies" json:"proxies,omitempty"`
114
 	} `toml:"network" json:"network,omitempty"`
114
 	} `toml:"network" json:"network,omitempty"`
115
 	Stats struct {
115
 	Stats struct {
116
 		StatsD struct {
116
 		StatsD struct {
117
 			Enabled      bool   `toml:"enabled" json:"enabled,omitempty"`
117
 			Enabled      bool   `toml:"enabled" json:"enabled,omitempty"`
118
 			Address      string `toml:"address" json:"address,omitempty"`
118
 			Address      string `toml:"address" json:"address,omitempty"`
119
-			MetricPrefix string `toml:"metric-prefix" json:"metric-prefix,omitempty"`
120
-			TagFormat    string `toml:"tag-format" json:"tag-format,omitempty"`
119
+			MetricPrefix string `toml:"metric-prefix" json:"metricPrefix,omitempty"`
120
+			TagFormat    string `toml:"tag-format" json:"tagFormat,omitempty"`
121
 		} `toml:"statsd" json:"statsd,omitempty"`
121
 		} `toml:"statsd" json:"statsd,omitempty"`
122
 		Prometheus struct {
122
 		Prometheus struct {
123
 			Enabled      bool   `toml:"enabled" json:"enabled,omitempty"`
123
 			Enabled      bool   `toml:"enabled" json:"enabled,omitempty"`
124
-			BindTo       string `toml:"bind-to" json:"bind-to,omitempty"`
125
-			HTTPPath     string `toml:"http-path" json:"http-path,omitempty"`
126
-			MetricPrefix string `toml:"metric-prefix" json:"metric-prefix,omitempty"`
124
+			BindTo       string `toml:"bind-to" json:"bindTo,omitempty"`
125
+			HTTPPath     string `toml:"http-path" json:"httpPath,omitempty"`
126
+			MetricPrefix string `toml:"metric-prefix" json:"metricPrefix,omitempty"`
127
 		} `toml:"prometheus" json:"prometheus,omitempty"`
127
 		} `toml:"prometheus" json:"prometheus,omitempty"`
128
 	} `toml:"stats" json:"stats,omitempty"`
128
 	} `toml:"stats" json:"stats,omitempty"`
129
 }
129
 }

+ 13
- 2
internal/config/type_prefer_ip.go Просмотреть файл

6
 )
6
 )
7
 
7
 
8
 const (
8
 const (
9
+	// TypePreferIPPreferIPv4 states that you prefer to use IPv4 addresses
10
+	// but IPv6 is also possible.
9
 	TypePreferIPPreferIPv4 = "prefer-ipv4"
11
 	TypePreferIPPreferIPv4 = "prefer-ipv4"
12
+
13
+	// TypePreferIPPreferIPv6 states that you prefer to use IPv6 addresses
14
+	// but IPv4 is also possible.
10
 	TypePreferIPPreferIPv6 = "prefer-ipv6"
15
 	TypePreferIPPreferIPv6 = "prefer-ipv6"
11
-	TypePreferOnlyIPv4     = "only-ipv4"
12
-	TypePreferOnlyIPv6     = "only-ipv6"
16
+
17
+	// TypePreferOnlyIPv4 states that you prefer to use IPv4 addresses
18
+	// only.
19
+	TypePreferOnlyIPv4 = "only-ipv4"
20
+
21
+	// TypePreferOnlyIPv6 states that you prefer to use IPv6 addresses
22
+	// only.
23
+	TypePreferOnlyIPv6 = "only-ipv6"
13
 )
24
 )
14
 
25
 
15
 type TypePreferIP struct {
26
 type TypePreferIP struct {

+ 9
- 1
internal/config/type_statsd_tag_format.go Просмотреть файл

6
 )
6
 )
7
 
7
 
8
 const (
8
 const (
9
+	// TypeStatsdTagFormatInfluxdb defines a tag format compatible with
10
+	// InfluxDB.
9
 	TypeStatsdTagFormatInfluxdb = "influxdb"
11
 	TypeStatsdTagFormatInfluxdb = "influxdb"
10
-	TypeStatsdTagFormatDatadog  = "datadog"
12
+
13
+	// TypeStatsdTagFormatDatadog defines a tag format compatible with
14
+	// DataDog.
15
+	TypeStatsdTagFormatDatadog = "datadog"
16
+
17
+	// TypeStatsdTagFormatGraphite defines a tag format compatible with
18
+	// Graphite.
11
 	TypeStatsdTagFormatGraphite = "graphite"
19
 	TypeStatsdTagFormatGraphite = "graphite"
12
 )
20
 )
13
 
21
 

+ 2
- 2
mtglib/internal/faketls/client_hello_test.go Просмотреть файл

18
 type ClientHelloSnapshot struct {
18
 type ClientHelloSnapshot struct {
19
 	Time        int    `json:"time"`
19
 	Time        int    `json:"time"`
20
 	Random      string `json:"random"`
20
 	Random      string `json:"random"`
21
-	SessionID   string `json:"session-id"`
21
+	SessionID   string `json:"sessionId"`
22
 	Host        string `json:"host"`
22
 	Host        string `json:"host"`
23
-	CipherSuite int    `json:"cipher-suite"`
23
+	CipherSuite int    `json:"cipherSuite"`
24
 	Full        string `json:"full"`
24
 	Full        string `json:"full"`
25
 }
25
 }
26
 
26
 

+ 22
- 4
mtglib/internal/faketls/init.go Просмотреть файл

6
 )
6
 )
7
 
7
 
8
 const (
8
 const (
9
+	// RandomLen defines a size of the random digest in TLS Hellos.
9
 	RandomLen = 32
10
 	RandomLen = 32
10
 
11
 
11
-	ClientHelloRandomOffset    = 6
12
+	// ClientHelloRandomOffset is an offset in ClientHello record where
13
+	// random digest is started.
14
+	ClientHelloRandomOffset = 6
15
+
16
+	// ClientHelloSessionIDOffset is an offset in ClientHello record where
17
+	// SessionID is started.
12
 	ClientHelloSessionIDOffset = ClientHelloRandomOffset + RandomLen
18
 	ClientHelloSessionIDOffset = ClientHelloRandomOffset + RandomLen
13
-	ClientHelloMinLen          = 4
14
 
19
 
20
+	// ClientHelloMinLen is a minimal possible length of
21
+	// ClientHello record.
22
+	ClientHelloMinLen = 4
23
+
24
+	// WelcomePacketRandomOffset is an offset of random in ServerHello
25
+	// packet (including record envelope).
15
 	WelcomePacketRandomOffset = 11
26
 	WelcomePacketRandomOffset = 11
16
 
27
 
28
+	// HandshakeTypeClient is a value representing a client handshake.
17
 	HandshakeTypeClient = 0x01
29
 	HandshakeTypeClient = 0x01
30
+
31
+	// HandshakeTypeServer is a value representing a server handshake.
18
 	HandshakeTypeServer = 0x02
32
 	HandshakeTypeServer = 0x02
19
 
33
 
34
+	// ChangeCipherValue is a value representing a change cipher
35
+	// specification record.
20
 	ChangeCipherValue = 0x01
36
 	ChangeCipherValue = 0x01
21
 
37
 
38
+	// ExtensionSNI is a value for TLS extension 'SNI'.
22
 	ExtensionSNI = 0x00
39
 	ExtensionSNI = 0x00
23
 )
40
 )
24
 
41
 
25
 var (
42
 var (
26
-	ErrBadDigest        = errors.New("bad digest")
27
-	ErrAntiReplayAttack = errors.New("antireplay attack was detected")
43
+	// ErrBadDigest is returned if given TLS Client Hello mismatches with a
44
+	// derived one.
45
+	ErrBadDigest = errors.New("bad digest")
28
 
46
 
29
 	serverHelloSuffix = []byte{
47
 	serverHelloSuffix = []byte{
30
 		0x00,       // no compression
48
 		0x00,       // no compression

+ 18
- 2
mtglib/internal/faketls/record/init.go Просмотреть файл

7
 type Type uint8
7
 type Type uint8
8
 
8
 
9
 const (
9
 const (
10
+	// TypeChangeCipherSpec defines a byte value of the TLS record when a
11
+	// peer wants to change a specifications of the chosen cipher.
10
 	TypeChangeCipherSpec Type = 0x14
12
 	TypeChangeCipherSpec Type = 0x14
11
-	TypeHandshake        Type = 0x16
12
-	TypeApplicationData  Type = 0x17
13
+
14
+	// TypeHandshake defines a byte value of the TLS record when a peer
15
+	// initiates a new TLS connection and wants to make a handshake
16
+	// ceremony.
17
+	TypeHandshake Type = 0x16
18
+
19
+	// TypeApplicationData defines a byte value of the TLS record when a
20
+	// peer sends an user data, not a control frames.
21
+	TypeApplicationData Type = 0x17
13
 )
22
 )
14
 
23
 
15
 func (t Type) String() string {
24
 func (t Type) String() string {
37
 type Version uint16
46
 type Version uint16
38
 
47
 
39
 const (
48
 const (
49
+	// Version10 defines a TLS1.0.
40
 	Version10 Version = 769 // 0x03 0x01
50
 	Version10 Version = 769 // 0x03 0x01
51
+
52
+	// Version11 defines a TLS1.1.
41
 	Version11 Version = 770 // 0x03 0x02
53
 	Version11 Version = 770 // 0x03 0x02
54
+
55
+	// Version12 defines a TLS1.2.
42
 	Version12 Version = 771 // 0x03 0x03
56
 	Version12 Version = 771 // 0x03 0x03
57
+
58
+	// Version13 defines a TLS1.3.
43
 	Version13 Version = 772 // 0x03 0x04
59
 	Version13 Version = 772 // 0x03 0x04
44
 )
60
 )
45
 
61
 

+ 2
- 2
mtglib/internal/faketls/testdata/client-hello-bad-fa2e46cdb33e2a1b.json Просмотреть файл

1
 {
1
 {
2
   "time": 1617181365,
2
   "time": 1617181365,
3
   "random": "XvCPc3aAbHbhRLv0kUmy6BfPZOGvsused5/HNsKXEPs=",
3
   "random": "XvCPc3aAbHbhRLv0kUmy6BfPZOGvsused5/HNsKXEPs=",
4
-  "session-id": "St2BZ2uHMFn3B2trD1jfdtpjoJOOg6JBeLhFcyCMCq4=",
4
+  "sessionId": "St2BZ2uHMFn3B2trD1jfdtpjoJOOg6JBeLhFcyCMCq4=",
5
   "host": "storage.googleapis.com",
5
   "host": "storage.googleapis.com",
6
-  "cipher-suite": 4867,
6
+  "cipherSuite": 4867,
7
   "full": "AQAB/AMDXvCPc3aAbHbhRLv0kUmy6BfPZOGvsused5/HNsKXEPsgSt2BZ2uHMFn3B2trD1jfdtpjoJOOg6JBeLhFcyCACq4ANBMDEwETAsAswCvAJMAjwArACcypwDDAL8AowCfAFMATzKgAnQCcAD0APAA1AC/ACMASAAoBAAF//wEAAQAAAAAbABkAABZzdG9yYWdlLmdvb2dsZWFwaXMuY29tABcAAAANABgAFgQDCAQEAQUDAgMIBQgFBQEIBgYBAgEABQAFANAAAAAzdAAAABIAAAAQADAALgJoM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A="
8
 }
8
 }

+ 3
- 3
mtglib/internal/faketls/testdata/client-hello-ok-19dfe38384b9884b.json Просмотреть файл

1
 {
1
 {
2
   "time": 1617181365,
2
   "time": 1617181365,
3
   "random": "XvCPc3aAbHbhRLv0kUmy6BfPZOGvsused5/HNsKXEPs=",
3
   "random": "XvCPc3aAbHbhRLv0kUmy6BfPZOGvsused5/HNsKXEPs=",
4
-  "session-id": "St2BZ2uHMFn3B2trD1jfdtpjoJOOg6JBeLhFcyCMCq4=",
4
+  "sessionId": "St2BZ2uHMFn3B2trD1jfdtpjoJOOg6JBeLhFcyCMCq4=",
5
   "host": "storage.googleapis.com",
5
   "host": "storage.googleapis.com",
6
-  "cipher-suite": 4867,
6
+  "cipherSuite": 4867,
7
   "full": "AQAB/AMDXvCPc3aAbHbhRLv0kUmy6BfPZOGvsused5/HNsKXEPsgSt2BZ2uHMFn3B2trD1jfdtpjoJOOg6JBeLhFcyCMCq4ANBMDEwETAsAswCvAJMAjwArACcypwDDAL8AowCfAFMATzKgAnQCcAD0APAA1AC/ACMASAAoBAAF//wEAAQAAAAAbABkAABZzdG9yYWdlLmdvb2dsZWFwaXMuY29tABcAAAANABgAFgQDCAQEAQUDAgMIBQgFBQEIBgYBAgEABQAFAQAAAAAzdAAAABIAAAAQADAALgJoMgVoMi0xNgVoMi0xNQVoMi0xNAhzcGR5LzMuMQZzcGR5LzMIaHR0cC8xLjEACwACAQAAMwAmACQAHQAgB/7oLx9JElIALsLJS91H2QNyU1H0osKwIUelVndsLyIALQACAQEAKwAJCAMEAwMDAgMBAAoACgAIAB0AFwAYABkAFQChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
7
   "full": "AQAB/AMDXvCPc3aAbHbhRLv0kUmy6BfPZOGvsused5/HNsKXEPsgSt2BZ2uHMFn3B2trD1jfdtpjoJOOg6JBeLhFcyCMCq4ANBMDEwETAsAswCvAJMAjwArACcypwDDAL8AowCfAFMATzKgAnQCcAD0APAA1AC/ACMASAAoBAAF//wEAAQAAAAAbABkAABZzdG9yYWdlLmdvb2dsZWFwaXMuY29tABcAAAANABgAFgQDCAQEAQUDAgMIBQgFBQEIBgYBAgEABQAFAQAAAAAzdAAAABIAAAAQADAALgJoMgVoMi0xNgVoMi0xNQVoMi0xNAhzcGR5LzMuMQZzcGR5LzMIaHR0cC8xLjEACwACAQAAMwAmACQAHQAgB/7oLx9JElIALsLJS91H2QNyU1H0osKwIUelVndsLyIALQACAQEAKwAJCAMEAwMDAgMBAAoACgAIAB0AFwAYABkAFQChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
8
-}
8
+}

+ 3
- 3
mtglib/internal/faketls/testdata/client-hello-ok-48f8a72a56f3174a.json Просмотреть файл

1
 {
1
 {
2
   "time": 1617181352,
2
   "time": 1617181352,
3
   "random": "oYEu33jl+zQbUKMtQbV1OHB0gXIM2y2aq9iY0QX12os=",
3
   "random": "oYEu33jl+zQbUKMtQbV1OHB0gXIM2y2aq9iY0QX12os=",
4
-  "session-id": "FGqA3ZFYrSlj//xl7lammNn64K9/MK2mQ3HJUGvP+8g=",
4
+  "sessionId": "FGqA3ZFYrSlj//xl7lammNn64K9/MK2mQ3HJUGvP+8g=",
5
   "host": "storage.googleapis.com",
5
   "host": "storage.googleapis.com",
6
-  "cipher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AMwAmACQAHQAga6CocpFP8Qd4YCFR9pkaCr97po2ALj0P5nI9Nnb3UWMALQACAQEAKwAJCAMEAwMDAgMBAAoACgAIAB0AFwAYABkAFQChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
8
-}
8
+}

+ 3
- 3
mtglib/internal/faketls/testdata/client-hello-ok-651054256093c6cd.json Просмотреть файл

1
 {
1
 {
2
   "time": 1617181352,
2
   "time": 1617181352,
3
   "random": "5V5sSprk/tFIgy+x1BeKNGhLlFkqfggLpgN7GYOA1ro=",
3
   "random": "5V5sSprk/tFIgy+x1BeKNGhLlFkqfggLpgN7GYOA1ro=",
4
-  "session-id": "jxr4d6PXPDk+Lwx3WUp9wvj8TGlOxEdrRJ0ydyJ9+H8=",
4
+  "sessionId": "jxr4d6PXPDk+Lwx3WUp9wvj8TGlOxEdrRJ0ydyJ9+H8=",
5
   "host": "storage.googleapis.com",
5
   "host": "storage.googleapis.com",
6
-  "cipher-suite": 4867,
6
+  "cipherSuite": 4867,
7
   "full": "AQAB/AMD5V5sSprk/tFIgy+x1BeKNGhLlFkqfggLpgN7GYOA1rogjxr4d6PXPDk+Lwx3WUp9wvj8TGlOxEdrRJ0ydyJ9+H8ANBMDEwETAsAswCvAJMAjwArACcypwDDAL8AowCfAFMATzKgAnQCcAD0APAA1AC/ACMASAAoBAAF//wEAAQAAAAAbABkAABZzdG9yYWdlLmdvb2dsZWFwaXMuY29tABcAAAANABgAFgQDCAQEAQUDAgMIBQgFBQEIBgYBAgEABQAFAQAAAAAzdAAAABIAAAAQADAALgJoMgVoMi0xNgVoMi0xNQVoMi0xNAhzcGR5LzMuMQ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mtglib/internal/faketls/testdata/client-hello-ok-79d01ef18a9d2621.json Просмотреть файл

1
 {
1
 {
2
   "time": 1617181365,
2
   "time": 1617181365,
3
   "random": "8xljlOhkDlkafEF5vu3e1r3fWvh8AX548wC3hLZ3szQ=",
3
   "random": "8xljlOhkDlkafEF5vu3e1r3fWvh8AX548wC3hLZ3szQ=",
4
-  "session-id": "00uvDYKnFyZFKyf3HlLwWGCOyeHsPFiU5UZ+Fs5pDAU=",
4
+  "sessionId": "00uvDYKnFyZFKyf3HlLwWGCOyeHsPFiU5UZ+Fs5pDAU=",
5
   "host": "storage.googleapis.com",
5
   "host": "storage.googleapis.com",
6
-  "cipher-suite": 4867,
6
+  "cipherSuite": 4867,
7
   "full": "AQAB/AMD8xljlOhkDlkafEF5vu3e1r3fWvh8AX548wC3hLZ3szQg00uvDYKnFyZFKyf3HlLwWGCOyeHsPFiU5UZ+Fs5pDAUANBMDEwETAsAswCvAJMAjwArACcypwDDAL8AowCfAFMATzKgAnQCcAD0APAA1AC/ACMASAAoBAAF//wEAAQAAAAAbABkAABZzdG9yYWdlLmdvb2dsZWFwaXMuY29tABcAAAANABgAFgQDCAQEAQUDAgMIBQgFBQEIBgYBAgEABQAFAQAAAAAzdAAAABIAAAAQADAALgJoMgVoMi0xNgVoMi0xNQVoMi0xNAhzcGR5LzMuMQZzcGR5LzMIaHR0cC8xLjEACwACAQAAMwAmACQAHQAg/9P7140NtKzjyDwBf99mOy1+FjRPAPHTNQ9WxHOKpV4ALQACAQEAKwAJCAMEAwMDAgMBAAoACgAIAB0AFwAYABkAFQChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
7
   "full": "AQAB/AMD8xljlOhkDlkafEF5vu3e1r3fWvh8AX548wC3hLZ3szQg00uvDYKnFyZFKyf3HlLwWGCOyeHsPFiU5UZ+Fs5pDAUANBMDEwETAsAswCvAJMAjwArACcypwDDAL8AowCfAFMATzKgAnQCcAD0APAA1AC/ACMASAAoBAAF//wEAAQAAAAAbABkAABZzdG9yYWdlLmdvb2dsZWFwaXMuY29tABcAAAANABgAFgQDCAQEAQUDAgMIBQgFBQEIBgYBAgEABQAFAQAAAAAzdAAAABIAAAAQADAALgJoMgVoMi0xNgVoMi0xNQVoMi0xNAhzcGR5LzMuMQZzcGR5LzMIaHR0cC8xLjEACwACAQAAMwAmACQAHQAg/9P7140NtKzjyDwBf99mOy1+FjRPAPHTNQ9WxHOKpV4ALQACAQEAKwAJCAMEAwMDAgMBAAoACgAIAB0AFwAYABkAFQChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
8
-}
8
+}

+ 3
- 3
mtglib/internal/faketls/testdata/client-hello-ok-7a5569f05b118145.json Просмотреть файл

1
 {
1
 {
2
   "time": 1617181352,
2
   "time": 1617181352,
3
   "random": "zja3MLZ8WGSfsQRtPV75+tY6gbK3zKPi1Sy7SBBafg4=",
3
   "random": "zja3MLZ8WGSfsQRtPV75+tY6gbK3zKPi1Sy7SBBafg4=",
4
-  "session-id": "qPut2yMqXa9zGLII/872SQ3d4Tfqo0uoDb7tpkRfBnA=",
4
+  "sessionId": "qPut2yMqXa9zGLII/872SQ3d4Tfqo0uoDb7tpkRfBnA=",
5
   "host": "storage.googleapis.com",
5
   "host": "storage.googleapis.com",
6
-  "cipher-suite": 4867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MwAmACQAHQAgXviLRAqAYJ8xOLdlcsUhldI4Xl0g/s9+y2Qrd8raPEgALQACAQEAKwAJCAMEAwMDAgMBAAoACgAIAB0AFwAYABkAFQChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
8
-}
8
+}

+ 2
- 0
mtglib/internal/obfuscated2/handshake_frame.go Просмотреть файл

1
 package obfuscated2
1
 package obfuscated2
2
 
2
 
3
 const (
3
 const (
4
+	// DefaultDC defines a number of the default DC to use. This value used
5
+	// only if a value from obfuscated2 handshake frame is 0 (default).
4
 	DefaultDC = 2
6
 	DefaultDC = 2
5
 
7
 
6
 	handshakeFrameLen = 64
8
 	handshakeFrameLen = 64

+ 1
- 1
mtglib/proxy_test.go Просмотреть файл

166
 
166
 
167
 	jsonStruct := struct {
167
 	jsonStruct := struct {
168
 		Headers struct {
168
 		Headers struct {
169
-			TraceID string `json:"X-Amzn-Trace-Id"`
169
+			TraceID string `json:"X-Amzn-Trace-Id"` // nolint: tagliatelle
170
 		} `json:"headers"`
170
 		} `json:"headers"`
171
 	}{}
171
 	}{}
172
 
172
 

+ 1
- 1
mtglib/secret.go Просмотреть файл

56
 	return nil, nil
56
 	return nil, nil
57
 }
57
 }
58
 
58
 
59
-// MarshalText is to support text.Unmarshaller interface.
59
+// UnmarshalText is to support text.Unmarshaller interface.
60
 func (s *Secret) UnmarshalText(data []byte) error {
60
 func (s *Secret) UnmarshalText(data []byte) error {
61
 	text := string(data)
61
 	text := string(data)
62
 	if text == "" {
62
 	if text == "" {

+ 8
- 2
network/init.go Просмотреть файл

53
 	//
53
 	//
54
 	// When circuit breaker is closed, it clears an error states each
54
 	// When circuit breaker is closed, it clears an error states each
55
 	// ProxyDialerResetFailuresTimeout.
55
 	// ProxyDialerResetFailuresTimeout.
56
-	ProxyDialerOpenThreshold        = 5
57
-	ProxyDialerHalfOpenTimeout      = time.Minute
56
+	ProxyDialerOpenThreshold = 5
57
+
58
+	// ProxyDialerHalfOpenTimeout defines a halfopen timeout for circuit
59
+	// breaker.
60
+	ProxyDialerHalfOpenTimeout = time.Minute
61
+
62
+	// ProxyDialerResetFailuresTimeout defines a timeout for resetting a
63
+	// failure.
58
 	ProxyDialerResetFailuresTimeout = 10 * time.Second
64
 	ProxyDialerResetFailuresTimeout = 10 * time.Second
59
 
65
 
60
 	// DefaultDOHHostname defines a default IP address for DOH host.
66
 	// DefaultDOHHostname defines a default IP address for DOH host.

+ 2
- 2
network/network_test.go Просмотреть файл

42
 
42
 
43
 	jsonStruct := struct {
43
 	jsonStruct := struct {
44
 		Headers struct {
44
 		Headers struct {
45
-			UserAgent []string `json:"User-Agent"`
45
+			UserAgent []string `json:"User-Agent"` // nolint: tagliatelle
46
 		} `json:"headers"`
46
 		} `json:"headers"`
47
 	}{}
47
 	}{}
48
 
48
 
67
 
67
 
68
 	jsonStruct := struct {
68
 	jsonStruct := struct {
69
 		Headers struct {
69
 		Headers struct {
70
-			UserAgent string `json:"User-Agent"`
70
+			UserAgent string `json:"User-Agent"` // nolint: tagliatelle
71
 		} `json:"headers"`
71
 		} `json:"headers"`
72
 	}{}
72
 	}{}
73
 
73
 

+ 13
- 3
stats/init.go Просмотреть файл

90
 	MetricReplayAttacks = "replay_attacks"
90
 	MetricReplayAttacks = "replay_attacks"
91
 
91
 
92
 	// TagIPFamily defines a name of the 'ip_family' tag and all values.
92
 	// TagIPFamily defines a name of the 'ip_family' tag and all values.
93
-	TagIPFamily     = "ip_family"
93
+	TagIPFamily = "ip_family"
94
+
95
+	// TagIPFamilyIPv4 defines a value of 'ip_family' of IPv4.
94
 	TagIPFamilyIPv4 = "ipv4"
96
 	TagIPFamilyIPv4 = "ipv4"
97
+
98
+	// TagIPFamilyIPv6 defines a value of 'ip_family' of IPv6.
95
 	TagIPFamilyIPv6 = "ipv6"
99
 	TagIPFamilyIPv6 = "ipv6"
96
 
100
 
97
 	// TagTelegramIP defines a name of the 'telegram_ip' tag.
101
 	// TagTelegramIP defines a name of the 'telegram_ip' tag.
101
 	TagDC = "dc"
105
 	TagDC = "dc"
102
 
106
 
103
 	// TagDirection defines a name of the 'direction' tag.
107
 	// TagDirection defines a name of the 'direction' tag.
104
-	TagDirection           = "direction"
105
-	TagDirectionToClient   = "to_client"
108
+	TagDirection = "direction"
109
+
110
+	// TagDirectionToClient defines that traffic is sent from Telegram to a
111
+	// client.
112
+	TagDirectionToClient = "to_client"
113
+
114
+	// TagDirectionFromClient defines that traffic is sent from a client to
115
+	// Telegram.
106
 	TagDirectionFromClient = "from_client"
116
 	TagDirectionFromClient = "from_client"
107
 )
117
 )

Загрузка…
Отмена
Сохранить