smartvpn-http-hooks 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +5 -10
- data/lib/api/activation.rb +9 -7
- data/smartvpn-http-hooks.gemspec +1 -1
- data/spec/lib/api/activation_spec.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adbca499440e873ba306b23d15700c510aa66736
|
4
|
+
data.tar.gz: beffd5f61de8b1915eeaf58ad01a3e1d612237a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0649906a93e371782375c1000605026943272a1a3db47b7e3aacd9718b876b559bf63a936e6f053f2c1f6827975e7351d196fcbcca5e55ff5374132f12264e26'
|
7
|
+
data.tar.gz: 467cb4e9e95d09ceb0a77e93445ecaeabe155a0d296001bc0e03e91bcc870a0c4061125f104e1afd9055ad458f0b9702278ed36fa338333de14766fb910d687f
|
data/.env
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,17 +10,12 @@ The main purpose of this gem - is to interact with remote API, located at billin
|
|
10
10
|
|
11
11
|
This allows to authenticate user, track his connects/disconnects, apply hooks on connect/disconnect.
|
12
12
|
|
13
|
-
|
13
|
+
## Installation
|
14
14
|
|
15
|
-
|
15
|
+
It is assumed, that the gem is installed directly to VPS/docker image with OpenVPN server. So the preferred solution is to install it directly to the system, without `bundler` tool usage.
|
16
16
|
|
17
|
-
|
18
|
-
* Automatic routing of TOR sites through TOR router
|
19
|
-
* Applying selected proxy for all HTTP traffic of specific user
|
17
|
+
`gem install smartvpn-http-hooks`
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
This is OpenSource, Free software. You may use it anyway you want. It is provided AS IS.
|
24
|
-
|
25
|
-
Check out LICENSE file for more info.
|
19
|
+
## Usage
|
26
20
|
|
21
|
+
TBD
|
data/lib/api/activation.rb
CHANGED
@@ -40,13 +40,11 @@ module Api
|
|
40
40
|
|
41
41
|
def data
|
42
42
|
{
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
client_crt: client_crt,
|
49
|
-
client_key: client_key
|
43
|
+
secret_token: secret_token,
|
44
|
+
hostname: hostname,
|
45
|
+
server_crt: server_crt,
|
46
|
+
client_crt: client_crt,
|
47
|
+
client_key: client_key
|
50
48
|
}
|
51
49
|
end
|
52
50
|
|
@@ -66,6 +64,10 @@ module Api
|
|
66
64
|
"activate"
|
67
65
|
end
|
68
66
|
|
67
|
+
def secret_token
|
68
|
+
ENV['SECRET_TOKEN']
|
69
|
+
end
|
70
|
+
|
69
71
|
def read_pki(file)
|
70
72
|
File.read("#{PKI_PATH}/#{file}")
|
71
73
|
end
|
data/smartvpn-http-hooks.gemspec
CHANGED
@@ -24,10 +24,11 @@ describe Api::Activation do
|
|
24
24
|
before do
|
25
25
|
stub_request(:post, 'api.smartvpn.biz/api/activate')
|
26
26
|
.with(body: {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
secret_token: ENV['SECRET_TOKEN'],
|
28
|
+
hostname: ENV['HOSTNAME'],
|
29
|
+
server_crt: 'crt content',
|
30
|
+
client_crt: 'client crt content',
|
31
|
+
client_key: 'client key content'
|
31
32
|
}
|
32
33
|
)
|
33
34
|
end
|