apipie-bindings 0.2.3 → 0.3.0

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
- SHA1:
3
- metadata.gz: cba70830484b6ca1a333960396c8a1aedb62a80f
4
- data.tar.gz: eec92707c91acd40998a7cec3c4457dc19d7695b
2
+ SHA256:
3
+ metadata.gz: 89d947a65424dc154dcc7fe08ffe8c7d18f5286643d9e1c4616070f7f814e8ef
4
+ data.tar.gz: 18d9c689d6d3f4a5a2b25020f3cc80337ebaa7b674fd6fba5e3d2df1b8dabf36
5
5
  SHA512:
6
- metadata.gz: 270a782b88c787f507f026fd46afa3948382dcc53fa8317cfa2d8aafce956d796732c5f85e32273bbd6c02bb79b4ba3caa76d6f02a18cdf0bf29d1f2cd2a0077
7
- data.tar.gz: 7dd9be1af27f58078c8bb3710de370438c6c11003b2340845d597fcf7c7f04e5ae7e761ef07281b0ad230401469c4bbff9ba4e22cdc5d41389ce021d147a8448
6
+ metadata.gz: a7e133869cf290c0b38fbabf434b2208734c4e539a19adaae994cd947642052be747a9123e50ba58d8dec0a93dbceed144235a0895fc72381dae1e2f1fc8a94d
7
+ data.tar.gz: 481a7f9fa959a0ca1670b76496f709c1126d7342c31acca8c764ad0f04f4b6a42b72018ff9c6bd7c4fcbc29c734a3596621c23a68b986b159410386c8ccb0d76
@@ -1,5 +1,9 @@
1
1
  Release notes
2
2
  =============
3
+ ### 0.3.0 (2019-10-25)
4
+ * Add token based auth mechanism ([PR #77](https://github.com/Apipie/apipie-bindings/pull/77))
5
+ * Throw malformed examples ([PR #78](https://github.com/Apipie/apipie-bindings/pull/78))
6
+
3
7
  ### 0.2.3 (2019-01-16)
4
8
  * Remove error log output from specs ([PR #76](https://github.com/Apipie/apipie-bindings/pull/76))
5
9
  * Update apidoc_cache_name apidoc ([PR #74](https://github.com/Apipie/apipie-bindings/pull/74))
@@ -41,7 +41,7 @@ module ApipieBindings
41
41
  def examples
42
42
  apidoc[:examples].map do |example|
43
43
  ApipieBindings::Example.parse(example)
44
- end
44
+ end.compact
45
45
  end
46
46
 
47
47
  def find_route(params={})
@@ -1,3 +1,4 @@
1
1
  require 'apipie_bindings/authenticators/basic_auth'
2
2
  require 'apipie_bindings/authenticators/credentials_legacy'
3
3
  require 'apipie_bindings/authenticators/oauth'
4
+ require 'apipie_bindings/authenticators/token_auth'
@@ -0,0 +1,15 @@
1
+ require 'apipie_bindings/authenticators/base'
2
+
3
+ module ApipieBindings
4
+ module Authenticators
5
+ class TokenAuth < Base
6
+ def initialize(token)
7
+ @token = token
8
+ end
9
+
10
+ def authenticate(req, token)
11
+ req['Authorization'] = "Bearer #{@token}"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -14,7 +14,7 @@ module ApipieBindings
14
14
 
15
15
  def self.parse(example)
16
16
  prep = /(\w+)\ ([^\n]*)\n?(.*)?\n(\d+)\n(.*)/m.match(example)
17
- new(*prep[1..5])
17
+ new(*prep[1..5]) if prep
18
18
  end
19
19
  end
20
20
 
@@ -1,5 +1,5 @@
1
1
  module ApipieBindings
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.2.3'
3
+ @version ||= Gem::Version.new '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apipie-bindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Bačovský
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-16 00:00:00.000000000 Z
11
+ date: 2019-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -185,6 +185,7 @@ files:
185
185
  - lib/apipie_bindings/authenticators/basic_auth.rb
186
186
  - lib/apipie_bindings/authenticators/credentials_legacy.rb
187
187
  - lib/apipie_bindings/authenticators/oauth.rb
188
+ - lib/apipie_bindings/authenticators/token_auth.rb
188
189
  - lib/apipie_bindings/credentials.rb
189
190
  - lib/apipie_bindings/example.rb
190
191
  - lib/apipie_bindings/exceptions.rb
@@ -256,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
257
  version: '0'
257
258
  requirements: []
258
259
  rubyforge_project:
259
- rubygems_version: 2.6.14.1
260
+ rubygems_version: 2.7.10
260
261
  signing_key:
261
262
  specification_version: 4
262
263
  summary: The Ruby bindings for Apipie documented APIs