akamai_ccu 1.1.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -18
- data/akamai_ccu.gemspec +1 -1
- data/bin/{delete → ccu_delete} +0 -0
- data/bin/{invalidate → ccu_invalidate} +0 -0
- data/lib/akamai_ccu/signer.rb +1 -2
- data/lib/akamai_ccu/version.rb +1 -1
- data/lib/akamai_ccu/wrapper.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef6a615fed6fe5ecfcc7bbbad55e90627d758e92
|
4
|
+
data.tar.gz: ec2171bc91d707dcc7ce6aabb13b1f0cb7a31016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40c29b6db01a244d61c05b586e49df2e0c6c1a044fbecb4f87cbcbf77c3ae60406e369404924cf26a21093ccc6434a1c0dab501d88f2506a02862803a8097106
|
7
|
+
data.tar.gz: '08cf6319a6ea61ea19040071d87f7f5ad2b750f6dea2c76763c0d91a801c11902152bcb13558449527392d380b191c8ef5752a1a48259815bd523c57b840fb58'
|
data/README.md
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
* [Reuse client](#reuse-client)
|
16
16
|
* [CLI](#cli)
|
17
17
|
* [Help](#help)
|
18
|
-
* [
|
19
|
-
* [
|
18
|
+
* [ccu_invalidate](#ccu_invalidate)
|
19
|
+
* [ccu_delete](#ccu_delete)
|
20
20
|
* [Overwriting options](#overwriting-options)
|
21
21
|
* [Possible issues](#possible-issues)
|
22
22
|
|
@@ -148,7 +148,7 @@ You can use the CLI by:
|
|
148
148
|
#### Help
|
149
149
|
Calling the help for the specific action:
|
150
150
|
```shell
|
151
|
-
|
151
|
+
ccu_invalidate -h
|
152
152
|
Usage: invalidate --edgerc=./.edgerc --production --cp="12345, 98765"
|
153
153
|
-e, --edgerc=EDGERC Load secret by .edgerc file
|
154
154
|
-t, --txt=TXT Load secret by TXT file
|
@@ -159,20 +159,20 @@ Usage: invalidate --edgerc=./.edgerc --production --cp="12345, 98765"
|
|
159
159
|
-h, --help Prints this help
|
160
160
|
```
|
161
161
|
|
162
|
-
####
|
162
|
+
#### ccu_invalidate
|
163
163
|
You can request for contents invalidation by calling:
|
164
164
|
```shell
|
165
|
-
|
166
|
-
|
167
|
-
|
165
|
+
ccu_invalidate --edgerc=~/.edgerc \
|
166
|
+
--url="https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.css,https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.js" \
|
167
|
+
--production
|
168
168
|
```
|
169
169
|
|
170
|
-
####
|
170
|
+
#### ccu_delete
|
171
171
|
You can request for contents deletion by calling:
|
172
172
|
```shell
|
173
|
-
|
174
|
-
|
175
|
-
|
173
|
+
ccu_delete --txt=~/tokens.txt \
|
174
|
+
--cp=12345,98765 \
|
175
|
+
--headers=Accept,Content-Length
|
176
176
|
```
|
177
177
|
|
178
178
|
#### Overwriting options
|
@@ -183,18 +183,18 @@ If multiple options for the same scope are provided, the program runs by giving
|
|
183
183
|
The `edgerc` option has always precedence over the `txt` one:
|
184
184
|
```shell
|
185
185
|
# will load secret from ~/.edgerc
|
186
|
-
|
187
|
-
|
188
|
-
|
186
|
+
ccu_invalidate --txt=~/tokens.txt \
|
187
|
+
--edgerc=~/.edgerc \
|
188
|
+
--cp=12345,98765
|
189
189
|
```
|
190
190
|
|
191
191
|
##### Content objects
|
192
192
|
The `cp` option has always precedence over the `url` one:
|
193
193
|
```shell
|
194
194
|
# will invalidate by CP code
|
195
|
-
|
196
|
-
|
197
|
-
|
195
|
+
ccu_invalidate --txt=~/tokens.txt \
|
196
|
+
--url="https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.css,https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.js" \
|
197
|
+
--cp=12345,98765
|
198
198
|
```
|
199
199
|
|
200
200
|
### Possible Issues
|
@@ -205,5 +205,5 @@ status=400; title=Bad request; detail=Invalid timestamp; request_id=2ce206fd; me
|
|
205
205
|
|
206
206
|
This happens since Akamai APIs only tolerate a clock skew of at most 30 seconds to defend against certain network attacks (described [here](https://community.akamai.com/docs/DOC-1336)).
|
207
207
|
In order to fix this annoying issue please do synchronize you server clock by:
|
208
|
-
* `NTP` if you are
|
208
|
+
* `NTP` if you are on a UX server
|
209
209
|
* `manually` versus an atomic clock site (check Internet) by using your workstation GUI
|
data/akamai_ccu.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = "https://github.com/costajob/akamai_ccu"
|
12
12
|
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|test|s|features)/}) }
|
13
13
|
s.bindir = "bin"
|
14
|
-
s.executables = %w[
|
14
|
+
s.executables = %w[ccu_invalidate ccu_delete]
|
15
15
|
s.require_paths = ["lib"]
|
16
16
|
s.license = "MIT"
|
17
17
|
s.required_ruby_version = ">= 2.2.2"
|
data/bin/{delete → ccu_delete}
RENAMED
File without changes
|
File without changes
|
data/lib/akamai_ccu/signer.rb
CHANGED
@@ -16,7 +16,7 @@ module AkamaiCCU
|
|
16
16
|
|
17
17
|
attr_reader :request
|
18
18
|
|
19
|
-
def initialize(request, secret
|
19
|
+
def initialize(request, secret, headers = [])
|
20
20
|
@request = request
|
21
21
|
@secret = secret
|
22
22
|
@headers = Array(headers)
|
@@ -24,7 +24,6 @@ module AkamaiCCU
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def call!
|
27
|
-
return unless @secret
|
28
27
|
@request[HEADER_KEY] = signed_headers
|
29
28
|
end
|
30
29
|
|
data/lib/akamai_ccu/version.rb
CHANGED
data/lib/akamai_ccu/wrapper.rb
CHANGED
@@ -10,7 +10,7 @@ module AkamaiCCU
|
|
10
10
|
Endpoint::Action.constants.each do |action|
|
11
11
|
Endpoint::Mode.constants.each do |mode|
|
12
12
|
endpoint = Endpoint.by_constants(network, action, mode)
|
13
|
-
define_method(endpoint.to_s) do |objects
|
13
|
+
define_method(endpoint.to_s) do |objects, secret, headers = [], &block|
|
14
14
|
wrapper = new(secret: secret, endpoint: endpoint, headers: headers)
|
15
15
|
block.call(wrapper) if block
|
16
16
|
wrapper.call(objects)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akamai_ccu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- costajob
|
@@ -56,8 +56,8 @@ description:
|
|
56
56
|
email:
|
57
57
|
- costajob@gmail.com
|
58
58
|
executables:
|
59
|
-
-
|
60
|
-
-
|
59
|
+
- ccu_invalidate
|
60
|
+
- ccu_delete
|
61
61
|
extensions: []
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
@@ -67,9 +67,9 @@ files:
|
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
69
69
|
- akamai_ccu.gemspec
|
70
|
+
- bin/ccu_delete
|
71
|
+
- bin/ccu_invalidate
|
70
72
|
- bin/console
|
71
|
-
- bin/delete
|
72
|
-
- bin/invalidate
|
73
73
|
- bin/setup
|
74
74
|
- lib/akamai_ccu.rb
|
75
75
|
- lib/akamai_ccu/cli.rb
|