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 +4 -4
- data/README.md +27 -1
- data/lib/rack/webfinger/version.rb +1 -1
- data/lib/rack/webfinger.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 541982ded51019906d304bcf762e749171accfb90858067087ab8e69959c1838
|
4
|
+
data.tar.gz: 54dfc926cdfa893418db8ad0a6d129035821c818079f41ea8ddebdebf8320ecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/lib/rack/webfinger.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2024-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack-test
|