ios_config 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -105,6 +105,47 @@ identifier
105
105
  description
106
106
  ```
107
107
 
108
+ #### AirPlay
109
+
110
+ ```ruby
111
+ payload = IOSConfig::Payload::AirPlay.new(parameters).build
112
+ ```
113
+
114
+ Available parameters:
115
+
116
+ ```ruby
117
+ whitelist # array of DeviceIDs
118
+ passwords # array of dictionaries with keys :device_name and :password
119
+ ```
120
+
121
+ #### AirPrint
122
+
123
+ ```ruby
124
+ payload = IOSConfig::Payload::AirPrint.new(parameters).build
125
+ ```
126
+
127
+ Available parameters:
128
+
129
+ ```ruby
130
+ airprint # array of dictionaries with keys :ip_address and :resource_path
131
+ ```
132
+
133
+ #### Single Sign-On Account
134
+
135
+ ```ruby
136
+ payload = IOSConfig::Payload::SingleSignOnAccount.new(parameters).build
137
+ ```
138
+
139
+ Available parameters:
140
+
141
+ ```ruby
142
+ name
143
+ principal_name,
144
+ realm,
145
+ url_prefix_matches, # array of strings
146
+ app_identifier_matches # array of strings
147
+ ```
148
+
108
149
  #### VPN
109
150
 
110
151
  ```ruby
@@ -147,11 +188,20 @@ Available parameters:
147
188
 
148
189
  ```ruby
149
190
  ssid
150
- hidden_network # true, false
151
- auto_join # true, fase
152
- encryption_type # :wep, :wpa, :any, :none
191
+ hidden_network # true false
192
+ auto_join # true false
193
+ encryption_type # wep wpa any none
194
+ is_hotspot # true false
195
+ domain_name
196
+ hessid
197
+ service_provider_roaming_enabled # true false
198
+ roaming_consortium_ois # array of strings
199
+ nai_realm_names # array of strings
200
+ mcc_and_mncs # array of strings
201
+ displayed_operator_name
153
202
  password
154
- proxy_type # :none, :manual, :auto
203
+ priority # integer
204
+ proxy_type # none manual auto
155
205
  proxy_server
156
206
  proxy_port
157
207
  proxy_username
@@ -0,0 +1,35 @@
1
+ module IOSConfig
2
+ module Payload
3
+ class AirPlay < Base
4
+
5
+ attr_accessor :whitelist, # array of DeviceIDs
6
+ :passwords # array of dictionaries with keys :device_name and :password
7
+
8
+ private
9
+
10
+ def payload_type
11
+ "com.apple.airplay"
12
+ end
13
+
14
+ def payload_version
15
+ 0
16
+ end
17
+
18
+ def payload
19
+ p = {}
20
+
21
+ if self.whitelist
22
+ p['Whitelist'] = self.whitelist.collect { |i| { 'DeviceID' => i } }
23
+ end
24
+
25
+ if self.passwords
26
+ p['Passwords'] = self.passwords.collect { |i| { 'DeviceName' => i[:device_name],
27
+ 'Password' => i[:password] }}
28
+ end
29
+
30
+ p
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,26 @@
1
+ module IOSConfig
2
+ module Payload
3
+ class AirPrint < Base
4
+
5
+ attr_accessor :airprint # array of dictionaries with keys :ip_address and :resource_path
6
+
7
+ private
8
+
9
+ def payload_type
10
+ "com.apple.airprint"
11
+ end
12
+
13
+ def payload
14
+ p = {}
15
+
16
+ if self.airprint
17
+ p['AirPrint'] = self.airprint.collect { |i| { 'IPAddress' => i[:ip_address],
18
+ 'ResourcePath' => i[:resource_path] }}
19
+ end
20
+
21
+ p
22
+ end
23
+
24
+ end
25
+ end
26
+ end
@@ -23,7 +23,7 @@ module IOSConfig
23
23
 
24
24
  def build
25
25
  p = { 'PayloadType' => payload_type,
26
- 'PayloadVersion' => 1,
26
+ 'PayloadVersion' => payload_version,
27
27
  'PayloadUUID' => @uuid,
28
28
  'PayloadIdentifier' => @identifier,
29
29
  'PayloadDescription' => @description }
@@ -37,6 +37,10 @@ module IOSConfig
37
37
  raise NotImplementedError
38
38
  end
39
39
 
40
+ def payload_version
41
+ 1
42
+ end
43
+
40
44
  end
41
45
  end
42
46
  end
@@ -0,0 +1,30 @@
1
+ module IOSConfig
2
+ module Payload
3
+ class SingleSignOnAccount < Base
4
+
5
+ attr_accessor :name,
6
+ :principal_name,
7
+ :realm,
8
+ :url_prefix_matches, # array of strings
9
+ :app_identifier_matches # array of strings
10
+
11
+ private
12
+
13
+ def payload_type
14
+ "com.apple.sso"
15
+ end
16
+
17
+ def payload
18
+ p = { 'Name' => @name,
19
+ 'Kerberos' => { 'Realm' => @realm } }
20
+
21
+ p['Kerberos']['PrincipalName'] = @principal_name if @principal_name
22
+ p['Kerberos']['URLPrefixMatches'] = @url_prefix_matches if @url_prefix_matches
23
+ p['Kerberos']['AppIdentifierMatches'] = @app_identifier_matches if @app_identifier_matches
24
+
25
+ p
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,78 @@
1
+ module IOSConfig
2
+ module Payload
3
+ class WiFi < Base
4
+
5
+ ENCRYPTION_TYPES = { :wep => 'WEP',
6
+ :wpa => 'WPA',
7
+ :any => 'Any',
8
+ :none => 'None' }
9
+
10
+ attr_accessor :ssid,
11
+ :hidden_network, # true, false
12
+ :auto_join, # true, false
13
+ :encryption_type, # :wep, :wpa, :any, :none
14
+ :is_hotspot, # true, false
15
+ :domain_name,
16
+ :hessid,
17
+ :service_provider_roaming_enabled, # true, false
18
+ :roaming_consortium_ois, # array of strings
19
+ :nai_realm_names, # array of strings
20
+ :mcc_and_mncs, # array of strings
21
+ :displayed_operator_name,
22
+ :password,
23
+ :priority, # integer
24
+ :proxy_type, # :none, :manual, :auto
25
+ :proxy_server,
26
+ :proxy_port,
27
+ :proxy_username,
28
+ :proxy_password,
29
+ :proxy_url
30
+
31
+ private
32
+
33
+ def payload_type
34
+ "com.apple.wifi.managed"
35
+ end
36
+
37
+ def payload
38
+ p = { 'EncryptionType' => ENCRYPTION_TYPES[@encryption_type] }
39
+
40
+
41
+ p['AutoJoin'] = @auto_join unless @auto_join.nil?
42
+ p['HIDDEN_NETWORK'] = @hidden_network unless @hidden_network.nil?
43
+ p['SSID_STR'] = @ssid unless @ssid.nil?
44
+
45
+ p['Password'] = @password unless @password.nil?
46
+ p['Priority'] = @priority unless @priority.nil?
47
+
48
+ # Hotspot 2.0
49
+
50
+ p['IsHotspot'] = @is_hotspot unless @is_hotspot.nil?
51
+ p['DomainName'] = @domain_name unless @domain_name.nil?
52
+ p['HESSID'] = @hessid unless @hessid.nil?
53
+ p['ServiceProviderRoamingEnabled'] = @service_provider_roaming_enabled unless @service_provider_roaming_enabled.nil?
54
+ p['RoamingConsortiumOIs'] = @roaming_consortium_ois unless @roaming_consortium_ois.nil?
55
+ p['NAIRealmNames'] = @nai_realm_names unless nai_realm_names.nil?
56
+ p['MCCAndMNCs'] = @mcc_and_mncs unless @mcc_and_mncs.nil?
57
+ p['DisplayedOperatorName'] = @displayed_operator_name unless @displayed_operator_name.nil?
58
+
59
+ # Proxy
60
+
61
+ p['ProxyType'] = @proxy_type.to_s.capitalize unless @proxy_type.nil?
62
+
63
+ case @proxy_type
64
+ when :manual
65
+ p.merge! ({ 'ProxyServer' => @proxy_server,
66
+ 'ProxyServerPort' => @proxy_port })
67
+ p['ProxyUsername'] = @proxy_username unless @proxy_username.nil?
68
+ p['ProxyPassword'] = @proxy_password unless @proxy_password.nil?
69
+ when :auto
70
+ p['ProxyPACURL'] = @proxy_url
71
+ end
72
+
73
+ p
74
+ end
75
+
76
+ end
77
+ end
78
+ end
@@ -1,3 +1,3 @@
1
1
  module IOSConfig
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.1"
3
3
  end
data/lib/ios_config.rb CHANGED
@@ -2,5 +2,8 @@ require 'core_ext/string'
2
2
  require 'ios_config/version'
3
3
  require 'ios_config/profile'
4
4
  require 'ios_config/payload/base'
5
+ require 'ios_config/payload/air_play'
6
+ require 'ios_config/payload/air_print'
7
+ require 'ios_config/payload/single_sign_on_account'
5
8
  require 'ios_config/payload/vpn'
6
- require 'ios_config/payload/wifi'
9
+ require 'ios_config/payload/wi_fi'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ios_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-20 00:00:00.000000000 Z
12
+ date: 2013-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: CFPropertyList
@@ -77,9 +77,12 @@ files:
77
77
  - lib/core_ext/string.rb
78
78
  - lib/ios_config.rb
79
79
  - lib/ios_config/.DS_Store
80
+ - lib/ios_config/payload/air_play.rb
81
+ - lib/ios_config/payload/air_print.rb
80
82
  - lib/ios_config/payload/base.rb
83
+ - lib/ios_config/payload/single_sign_on_account.rb
81
84
  - lib/ios_config/payload/vpn.rb
82
- - lib/ios_config/payload/wifi.rb
85
+ - lib/ios_config/payload/wi_fi.rb
83
86
  - lib/ios_config/profile.rb
84
87
  - lib/ios_config/version.rb
85
88
  homepage: https://github.com/tboyko/ios_config
@@ -97,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
100
  version: '0'
98
101
  segments:
99
102
  - 0
100
- hash: -1983829186131355413
103
+ hash: -3042753201997631584
101
104
  required_rubygems_version: !ruby/object:Gem::Requirement
102
105
  none: false
103
106
  requirements:
@@ -106,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
109
  version: '0'
107
110
  segments:
108
111
  - 0
109
- hash: -1983829186131355413
112
+ hash: -3042753201997631584
110
113
  requirements: []
111
114
  rubyforge_project:
112
115
  rubygems_version: 1.8.24
@@ -1,54 +0,0 @@
1
- module IOSConfig
2
- module Payload
3
- class WiFi < Base
4
-
5
- ENCRYPTION_TYPES = { :wep => 'WEP',
6
- :wpa => 'WPA',
7
- :any => 'Any',
8
- :none => 'None' }
9
-
10
- attr_accessor :ssid,
11
- :hidden_network, # true, false
12
- :auto_join, # true, false
13
- :encryption_type, # :wep, :wpa, :any, :none
14
- :password,
15
- :proxy_type, # :none, :manual, :auto
16
- :proxy_server,
17
- :proxy_port,
18
- :proxy_username,
19
- :proxy_password,
20
- :proxy_url
21
-
22
- private
23
-
24
- def payload_type
25
- "com.apple.wifi.managed"
26
- end
27
-
28
- def payload
29
- p = { 'SSID_STR' => @ssid,
30
- 'HIDDEN_NETWORK' => @hidden_network,
31
- 'AutoJoin' => @auto_join,
32
- 'EncryptionType' => ENCRYPTION_TYPES[@encryption_type],
33
- 'ProxyType' => @proxy_type.to_s.capitalize }
34
-
35
- p['Password'] = @password unless @password.blank?
36
-
37
- # Proxy
38
-
39
- case @proxy_type
40
- when :manual
41
- p.merge! ({ 'ProxyServer' => @proxy_server,
42
- 'ProxyServerPort' => @proxy_port })
43
- p['ProxyUsername'] = @proxy_username unless @proxy_username.blank?
44
- p['ProxyPassword'] = @proxy_password unless @proxy_password.blank?
45
- when :auto
46
- p['ProxyPACURL'] = @proxy_url
47
- end
48
-
49
- p
50
- end
51
-
52
- end
53
- end
54
- end