indieweb-endpoints 7.1.0 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/CONTRIBUTING.md +3 -3
- data/README.md +3 -3
- data/lib/indieweb/endpoints/client.rb +5 -4
- data/lib/indieweb/endpoints/parser.rb +1 -0
- data/lib/indieweb/endpoints/response_headers_parser.rb +1 -1
- data/lib/indieweb/endpoints/version.rb +1 -1
- data/lib/indieweb/endpoints.rb +6 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2f8e43786e217e42c08df7c1aeec438bd56aa9156d431c49bb8163216b6df7
|
4
|
+
data.tar.gz: 8336092d579bee80500f14a0f278e584c70d20f5bd51cf46012e080fc64af944
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56fa47965f839f37ce65fb1d2d3445265c66b865d2d85486b45f3306b6e5c13b1e4c98d301f2507ebe72ed279e2dc5e1449c891fdbc4a6746ff9ca088f8b621d
|
7
|
+
data.tar.gz: 320cfd2300bf0ae34d69031bb78eaabf0526105b5ed761f9c6f607585047ee81a72a347e9998cd06f366e636321d1ac32f345b1017ed8d634aa0620d65145a28
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.2.0 / 2022-10-04
|
4
|
+
|
5
|
+
- Add support for `indieauth-metadata` endpoint (35cc950)
|
6
|
+
- Switch from pry-byebug to Ruby's debug gem (7ad8925)
|
7
|
+
- Update development Ruby version to 2.6.10 (f105752)
|
8
|
+
|
3
9
|
## 7.1.0 / 2022-03-08
|
4
10
|
|
5
11
|
- Refactor gem code (eba8115)
|
data/CONTRIBUTING.md
CHANGED
@@ -8,9 +8,9 @@ There are a couple ways you can help improve indieweb-endpoints-ruby:
|
|
8
8
|
|
9
9
|
## Getting Started
|
10
10
|
|
11
|
-
indieweb-endpoints-ruby is developed using Ruby 2.6.
|
11
|
+
indieweb-endpoints-ruby is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/indieweb/indieweb-endpoints-ruby/actions).
|
12
12
|
|
13
|
-
Before making changes to indieweb-endpoints-ruby, you'll want to install Ruby 2.6.
|
13
|
+
Before making changes to indieweb-endpoints-ruby, you'll want to install Ruby 2.6.10. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.6.10 using your method of choice, install the project's gems by running:
|
14
14
|
|
15
15
|
```sh
|
16
16
|
bundle install
|
@@ -22,7 +22,7 @@ bundle install
|
|
22
22
|
1. Install development dependencies as outlined above.
|
23
23
|
1. Create a feature branch for the code changes you're looking to make: `git checkout -b my-new-feature`.
|
24
24
|
1. _Write some code!_
|
25
|
-
1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `
|
25
|
+
1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `bundle exec rspec`.
|
26
26
|
1. Commit your changes: `git commit -am 'Add some new feature or fix some issue'`. _(See [this excellent article](https://chris.beams.io/posts/git-commit/) for tips on writing useful Git commit messages.)_
|
27
27
|
1. Push the branch to your fork: `git push -u origin my-new-feature`.
|
28
28
|
1. Create a new [pull request][pulls] and we'll review your changes.
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
Before installing and using indieweb-endpoints-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.6 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
|
20
20
|
|
21
|
-
indieweb-endpoints-ruby is developed using Ruby 2.6.
|
21
|
+
indieweb-endpoints-ruby is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/indieweb/indieweb-endpoints-ruby/actions).
|
22
22
|
|
23
23
|
## Installation
|
24
24
|
|
@@ -46,7 +46,7 @@ With indieweb-endpoints-ruby added to your project's `Gemfile` and installed, yo
|
|
46
46
|
require 'indieweb/endpoints'
|
47
47
|
|
48
48
|
IndieWeb::Endpoints.get('https://aaronparecki.com')
|
49
|
-
#=> { authorization_endpoint: "https://aaronparecki.com/auth", micropub: "https://aaronparecki.com/micropub", microsub: "https://aperture.p3k.io/microsub/1", redirect_uri: nil, token_endpoint: "https://aaronparecki.com/auth/token", webmention: "https://webmention.io/aaronpk/webmention" }
|
49
|
+
#=> { authorization_endpoint: "https://aaronparecki.com/auth", "indieauth-metadata": "https://aaronparecki.com/.well-known/oauth-authorization-server", micropub: "https://aaronparecki.com/micropub", microsub: "https://aperture.p3k.io/microsub/1", redirect_uri: nil, token_endpoint: "https://aaronparecki.com/auth/token", webmention: "https://webmention.io/aaronpk/webmention" }
|
50
50
|
```
|
51
51
|
|
52
52
|
This example will search `https://aaronparecki.com` for valid IndieAuth, Micropub, and Webmention endpoints and return a `Hash` of results. Each key in the returned `Hash` will have a value of either a `String` representing a URL or `nil`. The `redirect_uri` key's value will be either an `Array` or `nil` since a given URL may register multiple callback URLs.
|
@@ -80,7 +80,7 @@ From [httprb/http](https://github.com/httprb/http):
|
|
80
80
|
|
81
81
|
- `IndieWeb::Endpoints::HttpError`
|
82
82
|
|
83
|
-
From the Ruby Standard Library's [`OpenSSL::SSL::SSLError`](https://ruby-doc.org/stdlib-2.6.
|
83
|
+
From the Ruby Standard Library's [`OpenSSL::SSL::SSLError`](https://ruby-doc.org/stdlib-2.6.10/libdoc/openssl/rdoc/OpenSSL/SSL/SSLError.html):
|
84
84
|
|
85
85
|
- `IndieWeb::Endpoints::SSLError`
|
86
86
|
|
@@ -8,8 +8,9 @@ module IndieWeb
|
|
8
8
|
user_agent: 'IndieWeb Endpoint Discovery (https://rubygems.org/gems/indieweb-endpoints)'
|
9
9
|
}.freeze
|
10
10
|
|
11
|
-
# Create a new client with a URL to parse for IndieWeb endpoints
|
11
|
+
# Create a new client with a URL to parse for IndieWeb endpoints.
|
12
12
|
#
|
13
|
+
# @example
|
13
14
|
# client = IndieWeb::Endpoints::Client.new('https://aaronparecki.com')
|
14
15
|
#
|
15
16
|
# @param url [String, HTTP::URI, #to_s] an absolute URL
|
@@ -25,17 +26,17 @@ module IndieWeb
|
|
25
26
|
%(#<#{self.class.name}:#{format('%#0x', object_id)} uri: "#{uri}">)
|
26
27
|
end
|
27
28
|
|
28
|
-
# A Hash of the discovered IndieWeb endpoints from the provided URL
|
29
|
+
# A Hash of the discovered IndieWeb endpoints from the provided URL.
|
29
30
|
#
|
30
31
|
# @return [Hash{Symbol => String, Array, nil}]
|
31
32
|
def endpoints
|
32
33
|
@endpoints ||= Parser.new(response).results
|
33
34
|
end
|
34
35
|
|
35
|
-
# The HTTP::Response object returned by the provided URL
|
36
|
+
# The +HTTP::Response+ object returned by the provided URL.
|
36
37
|
#
|
37
38
|
# @return [HTTP::Response]
|
38
|
-
# @raise [IndieWeb::Endpoints::HttpError]
|
39
|
+
# @raise [IndieWeb::Endpoints::HttpError, IndieWeb::Endpoints::SSLError]
|
39
40
|
def response
|
40
41
|
@response ||= HTTP.follow(max_hops: 20)
|
41
42
|
.headers(HTTP_HEADERS_OPTS)
|
@@ -13,6 +13,7 @@ module IndieWeb
|
|
13
13
|
def results
|
14
14
|
{
|
15
15
|
authorization_endpoint: result_for(:authorization_endpoint),
|
16
|
+
'indieauth-metadata': result_for(:'indieauth-metadata'),
|
16
17
|
micropub: result_for(:micropub),
|
17
18
|
microsub: result_for(:microsub),
|
18
19
|
redirect_uri: results_for(:redirect_uri),
|
data/lib/indieweb/endpoints.rb
CHANGED
@@ -18,12 +18,15 @@ module IndieWeb
|
|
18
18
|
class InvalidURIError < Error; end
|
19
19
|
class SSLError < Error; end
|
20
20
|
|
21
|
-
# Discover a URL's IndieAuth, Micropub, Microsub, and Webmention endpoints
|
21
|
+
# Discover a URL's IndieAuth, Micropub, Microsub, and Webmention endpoints.
|
22
22
|
#
|
23
|
+
# Convenience method for {IndieWeb::Endpoints::Client#endpoints}.
|
24
|
+
#
|
25
|
+
# @example
|
23
26
|
# IndieWeb::Endpoints.get('https://aaronparecki.com')
|
24
27
|
#
|
25
|
-
# @param
|
26
|
-
# @return
|
28
|
+
# @param (see IndieWeb::Endpoints::Client#endpoints)
|
29
|
+
# @return (see IndieWeb::Endpoints::Client#endpoints)
|
27
30
|
def self.get(url)
|
28
31
|
Client.new(url).endpoints
|
29
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indieweb-endpoints
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -76,7 +76,7 @@ licenses:
|
|
76
76
|
- MIT
|
77
77
|
metadata:
|
78
78
|
bug_tracker_uri: https://github.com/indieweb/indieweb-endpoints-ruby/issues
|
79
|
-
changelog_uri: https://github.com/indieweb/indieweb-endpoints-ruby/blob/v7.
|
79
|
+
changelog_uri: https://github.com/indieweb/indieweb-endpoints-ruby/blob/v7.2.0/CHANGELOG.md
|
80
80
|
rubygems_mfa_required: 'true'
|
81
81
|
post_install_message:
|
82
82
|
rdoc_options: []
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.3.12
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Discover a URL’s IndieAuth, Micropub, Microsub, and Webmention endpoints.
|