rack-webfinger 0.1.1 → 0.2.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
2
  SHA256:
3
- metadata.gz: '036498b473fc790b017df9b69a3cdc43c5e08c61838ba6619c7bf4ee139d0beb'
4
- data.tar.gz: 845a20600df782a4884a3f50a9f2aa656c6b657dd2dc5284ec7998866958443a
3
+ metadata.gz: 541982ded51019906d304bcf762e749171accfb90858067087ab8e69959c1838
4
+ data.tar.gz: 54dfc926cdfa893418db8ad0a6d129035821c818079f41ea8ddebdebf8320ecd
5
5
  SHA512:
6
- metadata.gz: 5d932c273321dd78cfa1b53336dcc10d9701631e98b7c014d0f769eb83ef996adefb4f19c934eabcb5987bb843270f951b08ac1e823de23d94e4966fe67b1568
7
- data.tar.gz: 787165175c9d33bcf1f866f7fb8d80cda70e5c94ae696244d9bd8a4bcdd95098a68d03707c16378395b96ca9aad79e3f3f29a1e64f6fb1af3d1573ae7d3a7816
6
+ metadata.gz: 6a2aff15955cbe4281f4dd40baecd5603506b0ce05922030d2498526fcee28badd31eed7e266e3a0f067eb9c3495fa0460933147f9a3fb2f1ac1a9cde1bd2fb6
7
+ data.tar.gz: c77db30be160f31f1264c17c3fccc9c6406d84006fa252bac472b71668200c400043ff72724efe20bffb1789b0123966ef36ffd75e30924f80ac5a67dad1b73d
data/README.md CHANGED
@@ -16,7 +16,33 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
16
 
17
17
  ## Usage
18
18
 
19
- TODO: Write usage instructions here
19
+ In your `config.ru` add:
20
+
21
+ ```ruby
22
+ require 'rack/webfinger'
23
+
24
+ use Rack::Webfinger, provider
25
+ ```
26
+
27
+ `provider` must be a callable (lambda, proc, class responding to `#
28
+ call`) that takes a resource name and an array of rel filters in.
29
+ You can choose to ignore the rel filters - filtering will be done for
30
+ you.
31
+
32
+ You need to return a Hash of this format:
33
+
34
+ ```
35
+ {
36
+ aliases: ["list","of","aliases"],
37
+ links: [
38
+ { "rel": "rel url", "type": "text/html", "href": "link" }
39
+ ]
40
+ }
41
+ ```
42
+
43
+ This will be simplified, with constants for common rel values, and
44
+ defaults available.
45
+
20
46
 
21
47
  ## Development
22
48
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rack
4
4
  class Webfinger
5
- VERSION = "0.1.1"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -6,7 +6,8 @@ require_relative "webfinger/version"
6
6
 
7
7
  module Rack
8
8
  class Webfinger
9
- def initialize(data_provider)
9
+ def initialize(app, data_provider)
10
+ @app = app
10
11
  @data_provider = data_provider
11
12
  end
12
13
 
@@ -15,7 +16,10 @@ module Rack
15
16
  def call(env)
16
17
  request = Rack::Request.new(env)
17
18
 
18
- return not_found if request.path != '/.well-known/webfinger'
19
+ if request.path != '/.well-known/webfinger'
20
+ return @app.call(env) if @app
21
+ return not_found
22
+ end
19
23
 
20
24
  resource = request.params['resource']
21
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-webfinger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-27 00:00:00.000000000 Z
11
+ date: 2024-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack-test