ovpnmcgen.rb 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46fbf55958e663b0d989719e018d03c02e09a5ba
4
- data.tar.gz: c8c37d5b2ed29586c50e35fbf4de216ec2a72d77
3
+ metadata.gz: 6ef44c3fa31e42f64bd986012e60ee32cb6ebb2f
4
+ data.tar.gz: 66afa4c68f2d00f6d2b502402ade0397cf5981d8
5
5
  SHA512:
6
- metadata.gz: 1590088cd9aee76d9334e554d68aae6daafd97b0eb4d109403af03dbbf40972690c82fac0b30b15f7ed2942d382cf117f970b43f49622e00136ab5b5e6ae963e
7
- data.tar.gz: a611b7db6ed827eca83605df6087bbcf1754b87865fbdd4eda0bf012ab42f5a7fe6c8b10e451e7c16873d699e1f04c7efb3687036ff26bb80d8082458709988c
6
+ metadata.gz: 3f4ba7bb60994c9cd443617b0ec24d5e8ebef7b53dd3cf28aae74475f12ca12c01dad9d2954bd199868272cabadc1170b906ef26307625b613f08090e64ccf09
7
+ data.tar.gz: 3a3f40a2d17f28f25683e37d51a15c732937768b5d8a540c44c996740d445b44ae66b0a98c72d2893fc59508706451d50e5e70566196f244fc8eec57b12ed7dd
data/ChangeLog CHANGED
@@ -1,6 +1,11 @@
1
- = 0.4.0 / 2014-05-04
1
+ = 0.4.1 / 2014-05-07
2
+ * Bugfix: SSIDs specified as a string in configfile now correctly output
3
+ as arrays. (#a9e638)
4
+
5
+ = 0.4.0 / 2014-05-07
2
6
  * VoD rules in `--[un]trusted-ssids` to also use `InterfaceTypeMatch`.
3
- * Added support for configuration persistance, via ENV or ~/.ovpnmcgen.rb.yml or `--config` flag.
7
+ * Added support for configuration persistance, via ENV or
8
+ ~/.ovpnmcgen.rb.yml or `--config` flag.
4
9
 
5
10
  = 0.3.0 / 2014-05-04
6
11
  * Documentation updates.
data/README.md CHANGED
@@ -70,6 +70,17 @@ Option flags can be set using environment variables or placed into a YAML format
70
70
 
71
71
  Note: Only for YAML configuration files and environment variables, flags with hyphens (-) are replaced with underscores (_), i.e. `--trusted-ssids safe` should be `trusted_ssids: safe`.
72
72
 
73
+ Sample:
74
+
75
+ ```
76
+ untrusted_ssids: [dangerous1, dangerous2]
77
+ trusted_ssids: [trust]
78
+ host: vpn.example.com
79
+ cafile: /etc/openvpn/ca.crt
80
+ tafile: /etc/openvpn/ta.key
81
+ url_probe: https://vpn.example.com/canVPN.php
82
+ ```
83
+
73
84
  ### Security Levels
74
85
 
75
86
  There are three different security levels to choose from, 'paranoid', 'high' (default), and 'medium'. The algorithm illustrated above is for 'high'.
@@ -35,6 +35,35 @@ Feature: Generate Functionality with Configuration File
35
35
  Then the output should contain "error: "
36
36
  And the output should not contain "error: Host"
37
37
 
38
+ Scenario: Single SSIDs specified should appear as an array in the output.
39
+ Given a file named ".ovpnmcgen.rb.yml" with:
40
+ """
41
+ trusted_ssids: trust
42
+ """
43
+ When I run `ovpnmcgen.rb g --host aruba.cucumber.org --cafile ca.crt --p12file p12file.p12 cucumber aruba`
44
+ Then the output should match:
45
+ """
46
+ <key>SSIDMatch</key>
47
+ \s*<array>
48
+ \s*<string>trust</string>
49
+ \s*</array>
50
+ """
51
+
52
+ Scenario: Multiple SSIDs specified should appear as an array in the output.
53
+ Given a file named ".ovpnmcgen.rb.yml" with:
54
+ """
55
+ trusted_ssids: [trust1, trust2]
56
+ """
57
+ When I run `ovpnmcgen.rb g --host aruba.cucumber.org --cafile ca.crt --p12file p12file.p12 cucumber aruba`
58
+ Then the output should match:
59
+ """
60
+ <key>SSIDMatch</key>
61
+ \s*<array>
62
+ \s*<string>trust1</string>
63
+ \s*<string>trust2</string>
64
+ \s*</array>
65
+ """
66
+
38
67
  Scenario: Flags should override configuration file options.
39
68
  Given a file named ".ovpnmcgen.rb.yml" with:
40
69
  """
@@ -10,8 +10,6 @@ module Ovpnmcgen
10
10
  @@config = AppConfiguration.new filename do
11
11
  prefix 'og'
12
12
  end
13
-
14
- # @@config = AppConfiguration[:ovpnmcgen]
15
13
  end
16
14
 
17
15
  def config
@@ -1,4 +1,4 @@
1
1
  module Ovpnmcgen
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  SUMMARY = "An OpenVPN iOS Configuration Profile (.mobileconfig) Utility"
4
4
  end
data/lib/ovpnmcgen.rb CHANGED
@@ -18,6 +18,10 @@ module Ovpnmcgen
18
18
  trusted_ssids = inputs[:trusted_ssids] || false
19
19
  untrusted_ssids = inputs[:untrusted_ssids] || false
20
20
 
21
+ # Ensure [un]trusted_ssids are Arrays.
22
+ trusted_ssids = Array(trusted_ssids) if trusted_ssids
23
+ untrusted_ssids = Array(untrusted_ssids) if untrusted_ssids
24
+
21
25
  begin
22
26
  ca_cert = File.readlines(inputs[:cafile]).map { |x| x.chomp }.join('\n')
23
27
  rescue Errno::ENOENT
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ovpnmcgen.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronald Ip