micropub-server-rails 0.1.3 → 0.1.4

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: f12fe8b38f09c8a000d0786d8ffba9a534699c0d
4
- data.tar.gz: 1abb0c60e179df042075f07d9ddab12824759410
3
+ metadata.gz: 00f8d5e92e1544532202c472d40698702c949908
4
+ data.tar.gz: 83985b66020fbb74467a53508b71381c9fbce073
5
5
  SHA512:
6
- metadata.gz: 388fb7685ff270fef7e514b0c0da9739af1de5eeea7c62eb1ab64bd29125ada1e164f9067258c48863fc7383ab67c9113d45bdbcd8d3181c3922fb5fa35de309
7
- data.tar.gz: 937316f298888fbeb396ccea9fc6125856957937bccad59f7d00c36685d32451a45067eb73f85e568d6b092f8f7053055cef8c07f3330c6c6b1a672a1eb1338f
6
+ metadata.gz: bd1fd80e419513f3b7a6c47b6f82c76564afb270945af0061bc71e04627ace990327a4d60fc030e29f19e80f7de04cc9b0fb1d81866c5a5a6e6b6ae23f1c2348
7
+ data.tar.gz: 58fcadb1e3495fb391a0a9df949a20279fdc1acba0f768989a491ade763b76bd2d0b8b8a327b83805bef248072e953ebd3782b1b8381d18361b0fe9ae6581a94
@@ -13,9 +13,9 @@ module Micropub::Server::Rails
13
13
  end
14
14
 
15
15
  def call(env)
16
- @env = env
17
16
  if env["PATH_INFO"] == "/micropub"
18
- token = Micropub::Token.new(auth_token)
17
+ token = Micropub::Token.new(auth_token(env))
18
+ puts token.inspect
19
19
  if token.valid?
20
20
  response
21
21
  else
@@ -26,15 +26,9 @@ module Micropub::Server::Rails
26
26
  end
27
27
  end
28
28
 
29
- def env
30
- @env
31
- end
32
-
33
- def auth_token
34
- @auth_token ||= begin
35
- input = env["HTTP_AUTHORIZATION"] || params[:access_token] || ""
36
- input.split("Bearer ").last
37
- end
29
+ def auth_token(env)
30
+ input = env["HTTP_AUTHORIZATION"] || request(env).params[:access_token] || ""
31
+ input.split("Bearer ").last
38
32
  end
39
33
 
40
34
  def response
@@ -45,12 +39,8 @@ module Micropub::Server::Rails
45
39
  [401, {}, [""]]
46
40
  end
47
41
 
48
- def request
49
- @request ||= Rack::Request.new(env)
50
- end
51
-
52
- def params
53
- request.params
42
+ def request(env)
43
+ Rack::Request.new(env)
54
44
  end
55
45
 
56
46
  def headers
@@ -1,7 +1,7 @@
1
1
  module Micropub
2
2
  module Server
3
3
  module Rails
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micropub-server-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Becker