jekyll-indico 0.4.1 → 0.4.2

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: 0dcfd6b6c484e7b1733fa6ac09b3b1835c64127f
4
- data.tar.gz: 71a26d70ac96e8a8c0b1d6110af6c9b24373680d
3
+ metadata.gz: 3ba6c0b97ed60402adc30d9f4d0c0077b7c7293b
4
+ data.tar.gz: '0322806b14154b9d0da3441ed64ff0931276736e'
5
5
  SHA512:
6
- metadata.gz: 22be7365dca3c8491af78d56164cc4b5eeffa4e969d2436792cd30ae3b2a2b79ed474198d00b9636b9fa2b9fa9bbf37b3e989b96b5026dc11faaeed010508b89
7
- data.tar.gz: eaa61758e36bf45ffd78ed807bd1acdd4e1d678a41d4c88765f057bf622391ec7bc4b90e41f5c2c72fc97637cba2581749304b59da78c76f6840b4715d0d80ea
6
+ metadata.gz: 60013b3c444d121db0b865797eb9353b47220f2b6b186f5d949aa27b7426976ad3d7914624b9cb4578a5c397a08847907b0637dd531fc47a121ef005f279061e
7
+ data.tar.gz: 82c1b136bec61c8fe09011e3a62376c39981e1195febcd70e5ae4f30e9bbc7dcaf6f77626129e2782e0f0831707231b68d6a4c84063439a21b1a0a8f0a17305d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 0.4.2
2
+
3
+ Remove broken support for classic tokens. Modern `INDICO_TOKEN` required.
4
+
1
5
  # Version 0.4.1
2
6
 
3
7
  Fix a few issues in Jekyll generator.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-indico (0.4.1)
4
+ jekyll-indico (0.4.2)
5
5
  jekyll (>= 3.8, < 5.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -20,9 +20,9 @@ indico:
20
20
  ```
21
21
 
22
22
  This plugin will automatically use an API token if your environment contains
23
- `INDICO_TOKEN`. If you use the deprecated API, this plugin will automatically
24
- sign your requests if your environment contains `INDICO_API` and
25
- `INDICO_SECRET_KEY`.
23
+ `INDICO_TOKEN`. You should generate this and replace `INDICO_API` and
24
+ `INDICO_SECRET_KEY` with it. You'll want the "Classic API" read permissions set
25
+ on it.
26
26
 
27
27
  #### Usage: installing
28
28
 
@@ -63,13 +63,17 @@ module JekyllIndico
63
63
  private
64
64
 
65
65
  # Run a block over each item in the downloaded results
66
- def download_and_iterate(base_url, indico_id, **kargs, &block)
66
+ def download_and_iterate(base_url, indico_id, **params, &block)
67
+ params[:pretty] = 'no'
67
68
  uri = URI.join(base_url, "/export/categ/#{indico_id}.json")
68
- params = build_params(**kargs)
69
69
  uri.query = URI.encode_www_form(params)
70
70
 
71
71
  req = Net::HTTP::Get.new(uri)
72
- req['Authorization'] = "Bearer #{ENV['INDICO_TOKEN']}" if ENV['INDICO_TOKEN']
72
+ if ENV['INDICO_TOKEN']
73
+ req['Authorization'] = "Bearer #{ENV['INDICO_TOKEN']}"
74
+ elsif ENV['INDICO_SECRET_KEY'] || ENV['INDICO_API']
75
+ raise Error, 'Use INDICO_TOKEN with a new-style token'
76
+ end
73
77
 
74
78
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
75
79
 
@@ -78,21 +82,5 @@ module JekyllIndico
78
82
 
79
83
  parsed['results'].each(&block)
80
84
  end
81
-
82
- # Automatically signs request if environment has INDICO_API/SECRET_KEY
83
- def build_params(**kargs)
84
- kargs[:pretty] = 'no'
85
-
86
- if ENV['INDICO_API_KEY'] && !ENV['INDICO_TOKEN']
87
- kargs[:ak] = ENV['INDICO_API_KEY']
88
- if ENV['INDICO_SECRET_KEY']
89
- kargs[:timestamp] = Time.new.to_i.to_s
90
- requeststr = join_url(indico_id, kargs)
91
- kargs[:signature] = OpenSSL::HMAC.hexdigest('SHA1', ENV['INDICO_SECRET_KEY'], requeststr)
92
- end
93
- end
94
-
95
- kargs
96
- end
97
85
  end
98
86
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllIndico
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-indico
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Schreiner