ipecache 0.0.4 → 0.0.5

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTBjYjQ0NmZiMWI1NTllNjdhYTNkM2YzN2JkNTBjNzc5MjliODE1NQ==
5
+ data.tar.gz: !binary |-
6
+ OGFkY2RiMmZiOTcwZDA4OGJiZmQ3MDhhZDM0YzhhODA1ZDgyYTkwZg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NDZiMGM4NjA3ZGUyYzViNzJkNTc4YmZjOWU1OWYxNzEyMzcxNzYxZGU3YTQx
10
+ NjljNzMxZGUyZWM4NjJmYzgwOGQ5MTMwNTdiMTFkYTE2Y2UwNmYwNzdjZTY1
11
+ YWRlM2Q2MmU1NGE0MjM3NmQ3MGU4OGE5NTYzOGJhNjMxYTUwNjA=
12
+ data.tar.gz: !binary |-
13
+ YTQ3OGFiNDJkZmE2YWM0YzNmZTNmNmExOTRlODA3MzNjOTQ3N2VjOTFjNmVj
14
+ ZTAwMjljN2EwYjdlN2UyYmQ3ZGRmMDIxNWJiOGJiMzU0ZWEzZmFiMzMxNTRi
15
+ NzY5MTRhYWY5ZWUyODQ4NTA1ZDk2YzYyYjIyYzNlMmU1NzZmYTk=
@@ -1,3 +1,7 @@
1
+ ## 0.0.5 (April 25, 2014)
2
+
3
+ Switched Akamai plugin to use new CCUAPI (Thanks to https://github.com/adedommelin)
4
+
1
5
  ## 0.0.1 (March 20, 2013)
2
6
 
3
7
  Initial version.
@@ -1,44 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ipecache (0.0.4)
4
+ ipecache (0.0.5)
5
5
  app_conf (>= 0.4.0)
6
6
  choice (>= 0.1.6)
7
7
  faraday_middleware (>= 0.9.0)
8
- savon (>= 2.1.0)
9
8
 
10
9
  GEM
11
10
  remote: http://rubygems.org/
12
11
  specs:
13
- akami (1.2.0)
14
- gyoku (>= 0.4.0)
15
- nokogiri (>= 1.4.0)
16
- app_conf (0.4.0)
17
- builder (3.0.0)
12
+ app_conf (0.4.1)
18
13
  choice (0.1.6)
19
- faraday (0.8.6)
20
- multipart-post (~> 1.1)
14
+ faraday (0.8.8)
15
+ multipart-post (~> 1.2.0)
21
16
  faraday_middleware (0.9.0)
22
17
  faraday (>= 0.7.4, < 0.9)
23
- gyoku (1.0.0)
24
- builder (>= 2.1.2)
25
- httpi (2.0.2)
26
- rack
27
18
  multipart-post (1.2.0)
28
- nokogiri (1.5.9)
29
- nori (2.0.4)
30
- rack (1.4.1)
31
- savon (2.1.0)
32
- akami (~> 1.2.0)
33
- builder (>= 2.1.2)
34
- gyoku (~> 1.0.0)
35
- httpi (~> 2.0.2)
36
- nokogiri (>= 1.4.0)
37
- nori (~> 2.0.3)
38
- wasabi (~> 3.0.0)
39
- wasabi (3.0.0)
40
- httpi (~> 2.0)
41
- nokogiri (>= 1.4.0)
42
19
 
43
20
  PLATFORMS
44
21
  ruby
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'ipecache'
5
- gem.version = '0.0.4'
5
+ gem.version = '0.0.5'
6
6
  gem.authors = ["Jon Cowie"]
7
7
  gem.email = 'jonlives@gmail.com'
8
8
  gem.homepage = 'https://github.com/jonlives/ipecache'
@@ -18,5 +18,4 @@ Gem::Specification.new do |gem|
18
18
  gem.add_runtime_dependency 'app_conf', '>= 0.4.0'
19
19
  gem.add_runtime_dependency 'choice', '>= 0.1.6'
20
20
  gem.add_runtime_dependency 'faraday_middleware', '>= 0.9.0'
21
- gem.add_runtime_dependency 'savon', '>= 2.1.0'
22
21
  end
@@ -7,7 +7,8 @@ module Ipecache
7
7
  hooks :cdn_purge
8
8
 
9
9
  def perform
10
- safe_require 'savon'
10
+ safe_require 'faraday_middleware'
11
+ safe_require 'json'
11
12
 
12
13
  username = config.username
13
14
  password = config.password
@@ -29,31 +30,27 @@ module Ipecache
29
30
  url = u.chomp
30
31
  plugin_puts ("Purging #{url}")
31
32
 
32
- savon_client = Savon.client({log_level: :info, log: false, convert_request_keys_to: :none, wsdl: 'https://ccuapi.akamai.com/ccuapi-axis.wsdl'})
33
- response = savon_client.call(:purge_request, xml: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
34
- <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
35
- xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"
36
- xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
37
- soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"
38
- xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
39
- <soap:Body>
40
- <purgeRequest xmlns=\"http://ccuapi.akamai.com/purge\">
41
- <name xsi:type=\"xsd:string\">#{username}</name>
42
- <pwd xsi:type=\"xsd:string\">#{password}</pwd>
43
- <network xsi:type=\"xsd:string\"></network>
44
- <opt soapenc:arrayType=\"xsd:string[2]\" xsi:type=\"soapenc:Array\">
45
- <item xsi:type=\"xsd:string\">type=arl</item>
46
- <item xsi:type=\"xsd:string\">action=remove</item>
47
- </opt>'
48
- <uri soapenc:arrayType=\"xsd:string[1]\" xsi:type=\"soapenc:Array\">
49
- <item xsi:type=\"xsd:string\">#{url}</item>
50
- </uri>
51
- </purgeRequest>
52
- </soap:Body>
53
- </soap:Envelope>")
54
- response_hash = response.to_hash
55
- if response_hash[:purge_request_response][:return][:result_msg] != "Success."
56
- plugin_puts_error(url,"An Error occured: #{response_hash[:purge_request_response][:return][:result_msg]}")
33
+ connection = Faraday::Connection.new(
34
+ {:url => "https://api.ccu.akamai.com",
35
+ :headers => { :accept => 'application/json',
36
+ :content_type => 'application/json',
37
+ :user_agent => 'Ipecache',
38
+ },
39
+ :ssl => { :verify => true }
40
+ }) do |builder|
41
+ builder.request :json
42
+ builder.basic_auth(username,password)
43
+ builder.adapter Faraday.default_adapter
44
+ end
45
+
46
+ response = connection.post("/ccu/v2/queues/default", "{\"objects\":[\"#{url}\"]}")
47
+
48
+ response_json = JSON.parse(response.body)
49
+ response_httpStatus = response_json['httpStatus']
50
+
51
+ if response_httpStatus != 201
52
+ plugin_puts_error(url,"Purge failed!")
53
+ plugin_puts response.body
57
54
  exit 1 unless continue_on_error
58
55
  else
59
56
  plugin_puts "Purge successful!"
@@ -62,4 +59,4 @@ module Ipecache
62
59
  end
63
60
  end
64
61
  end
65
- end
62
+ end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipecache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jon Cowie
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-17 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: app_conf
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: choice
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: faraday_middleware
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,27 +48,10 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: 0.9.0
62
- - !ruby/object:Gem::Dependency
63
- name: savon
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: 2.1.0
70
- type: :runtime
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: 2.1.0
78
55
  description: An extensible tool for purging urls from caches and CDNs
79
56
  email: jonlives@gmail.com
80
57
  executables:
@@ -105,27 +82,25 @@ files:
105
82
  - plugins/README.md
106
83
  homepage: https://github.com/jonlives/ipecache
107
84
  licenses: []
85
+ metadata: {}
108
86
  post_install_message:
109
87
  rdoc_options: []
110
88
  require_paths:
111
89
  - lib
112
90
  required_ruby_version: !ruby/object:Gem::Requirement
113
- none: false
114
91
  requirements:
115
92
  - - ! '>='
116
93
  - !ruby/object:Gem::Version
117
94
  version: '0'
118
95
  required_rubygems_version: !ruby/object:Gem::Requirement
119
- none: false
120
96
  requirements:
121
97
  - - ! '>='
122
98
  - !ruby/object:Gem::Version
123
99
  version: '0'
124
100
  requirements: []
125
101
  rubyforge_project:
126
- rubygems_version: 1.8.24
102
+ rubygems_version: 2.2.1
127
103
  signing_key:
128
- specification_version: 3
104
+ specification_version: 4
129
105
  summary: An extensible tool for purging urls from caches and CDNs
130
106
  test_files: []
131
- has_rdoc: