public_suffix 5.1.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +45 -1
- data/LICENSE.txt +1 -1
- data/README.md +38 -31
- data/RELEASING.md +95 -0
- data/SECURITY.md +1 -2
- data/data/list.txt +2649 -2207
- data/lib/public_suffix/domain.rb +1 -1
- data/lib/public_suffix/errors.rb +1 -1
- data/lib/public_suffix/list.rb +1 -1
- data/lib/public_suffix/rule.rb +1 -1
- data/lib/public_suffix/version.rb +2 -2
- data/lib/public_suffix.rb +1 -1
- metadata +8 -10
- data/2.0-Upgrade.md +0 -52
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '084a35b60185cb9effa86043e48492bbdef04d05f0f25b022cd4814b812b3de2'
|
|
4
|
+
data.tar.gz: 70c513a2c19d770c0d6d929a9bb8fe868a9df87b899af6eaf4ffe24a4acfc903
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 867e2369292df3275da727802270527999530fff53b9683228edf4f183e9f8fd7592cb3da2d2bf0923f2b7c727e778dbc45e329f234e7f1869d74f298994bf5a
|
|
7
|
+
data.tar.gz: 9fbbcf8839be0685d98d91e6fb44ec010f3dd2c3e80469b57b1138465701b3b0168da508aa3f7c8a3e46897c8135b337b2b64e1d17fb058e4de02a11efc4e984
|
data/CHANGELOG.md
CHANGED
|
@@ -2,17 +2,59 @@
|
|
|
2
2
|
|
|
3
3
|
This project uses [Semantic Versioning 2.0.0](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
## 7.0.0
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- Updated definitions.
|
|
11
|
+
- Minimum Ruby version is 3.2
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 6.0.2
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Updated definitions.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## 6.0.1
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- Updated definitions.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 6.0.0
|
|
29
|
+
|
|
30
|
+
Same as 5.1.0. Re-releasing as a major version change due to a major ruby version requirement change.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Updated definitions.
|
|
35
|
+
- Minimum Ruby version is 3.0
|
|
36
|
+
|
|
37
|
+
|
|
5
38
|
## 5.1.1
|
|
6
39
|
|
|
7
40
|
No significant changes. Releasing a mini version to address 5.1.0 release with major ruby requirement change (GH-315).
|
|
8
41
|
|
|
9
42
|
|
|
43
|
+
## 5.1.0
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- Updated definitions.
|
|
48
|
+
- Minimum Ruby version is 3.0
|
|
49
|
+
|
|
50
|
+
|
|
10
51
|
## 5.0.5
|
|
11
52
|
|
|
12
53
|
### Changed
|
|
13
54
|
|
|
14
55
|
- Updated definitions.
|
|
15
56
|
|
|
57
|
+
|
|
16
58
|
## 5.0.4
|
|
17
59
|
|
|
18
60
|
### Changed
|
|
@@ -20,18 +62,21 @@ No significant changes. Releasing a mini version to address 5.1.0 release with m
|
|
|
20
62
|
- Reduced .gem file size (GH-258). [Thanks @ybiquitous]
|
|
21
63
|
- Updated definitions.
|
|
22
64
|
|
|
65
|
+
|
|
23
66
|
## 5.0.3
|
|
24
67
|
|
|
25
68
|
### Fixed
|
|
26
69
|
|
|
27
70
|
- Fixed automated release workflow.
|
|
28
71
|
|
|
72
|
+
|
|
29
73
|
## 5.0.2
|
|
30
74
|
|
|
31
75
|
### Changed
|
|
32
76
|
|
|
33
77
|
- Updated definitions.
|
|
34
78
|
|
|
79
|
+
|
|
35
80
|
## 5.0.1
|
|
36
81
|
|
|
37
82
|
### Changed
|
|
@@ -44,7 +89,6 @@ No significant changes. Releasing a mini version to address 5.1.0 release with m
|
|
|
44
89
|
### Changed
|
|
45
90
|
|
|
46
91
|
- Minimum Ruby version is 2.6
|
|
47
|
-
|
|
48
92
|
- Updated definitions.
|
|
49
93
|
|
|
50
94
|
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PublicSuffix for Ruby
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`PublicSuffix` is a Ruby domain name parser based on the [Public Suffix List](https://publicsuffix.org/).
|
|
4
4
|
|
|
5
5
|
[](https://github.com/weppos/publicsuffix-ruby/actions/workflows/tests.yml)
|
|
6
6
|
[](https://tidelift.com/subscription/pkg/rubygems-public-suffix?utm_source=rubygems-public-suffix&utm_medium=referral&utm_campaign=enterprise)
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
## Requirements
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
`PublicSuffix` requires **Ruby >= 3.2**. For older versions of Ruby, use a previous release.
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
@@ -33,8 +33,6 @@ Or use Bundler and define it as a dependency in your `Gemfile`:
|
|
|
33
33
|
gem 'public_suffix'
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
If you are upgrading to 2.0, see [2.0-Upgrade.md](2.0-Upgrade.md).
|
|
37
|
-
|
|
38
36
|
## Usage
|
|
39
37
|
|
|
40
38
|
Extract the domain out from a name:
|
|
@@ -108,9 +106,9 @@ PublicSuffix.valid?("example.tldnotlisted", default_rule: nil)
|
|
|
108
106
|
```
|
|
109
107
|
|
|
110
108
|
|
|
111
|
-
## Fully
|
|
109
|
+
## Fully qualified domain names
|
|
112
110
|
|
|
113
|
-
This library automatically recognizes Fully Qualified Domain Names. A FQDN is a domain name that
|
|
111
|
+
This library automatically recognizes Fully Qualified Domain Names. A FQDN is a domain name that ends with a trailing dot.
|
|
114
112
|
|
|
115
113
|
```ruby
|
|
116
114
|
# Parse a standard domain name
|
|
@@ -124,7 +122,7 @@ PublicSuffix.domain("www.google.com.")
|
|
|
124
122
|
|
|
125
123
|
## Private domains
|
|
126
124
|
|
|
127
|
-
This library
|
|
125
|
+
This library supports toggling private (non-ICANN) domain handling.
|
|
128
126
|
|
|
129
127
|
```ruby
|
|
130
128
|
# Extract a domain including private domains (by default)
|
|
@@ -150,15 +148,15 @@ PublicSuffix.domain("something.blogspot.com")
|
|
|
150
148
|
# => "blogspot.com"
|
|
151
149
|
```
|
|
152
150
|
|
|
153
|
-
##
|
|
151
|
+
## Adding custom domains
|
|
154
152
|
|
|
155
|
-
|
|
153
|
+
To manually add a domain to the list:
|
|
156
154
|
|
|
157
155
|
```ruby
|
|
158
156
|
PublicSuffix::List.default << PublicSuffix::Rule.factory('onmicrosoft.com')
|
|
159
157
|
```
|
|
160
158
|
|
|
161
|
-
## What is the
|
|
159
|
+
## What is the public suffix list?
|
|
162
160
|
|
|
163
161
|
The [Public Suffix List](https://publicsuffix.org) is a cross-vendor initiative to provide an accurate list of domain name suffixes.
|
|
164
162
|
|
|
@@ -167,7 +165,7 @@ The Public Suffix List is an initiative of the Mozilla Project, but is maintaine
|
|
|
167
165
|
A "public suffix" is one under which Internet users can directly register names. Some examples of public suffixes are ".com", ".co.uk" and "pvt.k12.wy.us". The Public Suffix List is a list of all known public suffixes.
|
|
168
166
|
|
|
169
167
|
|
|
170
|
-
## Why the
|
|
168
|
+
## Why use the public suffix list instead of regular expressions?
|
|
171
169
|
|
|
172
170
|
Previously, browsers used an algorithm which basically only denied setting wide-ranging cookies for top-level domains with no dots (e.g. com or org). However, this did not work for top-level domains where only third-level registrations are allowed (e.g. co.uk). In these cases, websites could set a cookie for co.uk which will be passed onto every website registered under co.uk.
|
|
173
171
|
|
|
@@ -182,43 +180,52 @@ Source: https://wiki.mozilla.org/Public_Suffix_List
|
|
|
182
180
|
Not convinced yet? Check out [this real world example](https://stackoverflow.com/q/288810/123527).
|
|
183
181
|
|
|
184
182
|
|
|
185
|
-
## Does
|
|
183
|
+
## Does PublicSuffix make network requests?
|
|
186
184
|
|
|
187
|
-
No.
|
|
185
|
+
No. `PublicSuffix` comes with a bundled list. It does not make any HTTP requests to parse or validate a domain.
|
|
188
186
|
|
|
189
187
|
|
|
190
|
-
##
|
|
188
|
+
## Terminology
|
|
191
189
|
|
|
192
|
-
|
|
190
|
+
- **TLD** (Top-Level Domain): The last segment of a domain name. For example, in `mozilla.org`, the `.org` portion is the TLD.
|
|
193
191
|
|
|
194
|
-
-
|
|
195
|
-
- The PublicSuffix code repository is here: https://github.com/weppos/publicsuffix-ruby. Contributions are welcome! Please include tests and/or feature coverage for every patch, and create a topic branch for every separate change you make.
|
|
192
|
+
- **SLD** (Second-Level Domain): A domain directly below a top-level domain. For example, in `https://www.mozilla.org/en-US/`, `mozilla` is the second-level domain of the `.org` TLD.
|
|
196
193
|
|
|
197
|
-
|
|
194
|
+
- **TRD** (Third-Level Domain): Also known as a subdomain, this is the part of the domain before the SLD or root domain. For example, in `https://www.mozilla.org/en-US/`, `www` is the TRD.
|
|
198
195
|
|
|
196
|
+
- **FQDN** (Fully Qualified Domain Name): A complete domain name that includes the hostname, domain, and top-level domain, ending with a trailing dot. The format is `[hostname].[domain].[tld].` (e.g., `www.mozilla.org.`).
|
|
199
197
|
|
|
200
|
-
## Security and Vulnerability Reporting
|
|
201
198
|
|
|
202
|
-
|
|
199
|
+
## Documentation and support
|
|
203
200
|
|
|
201
|
+
### Documentation
|
|
204
202
|
|
|
205
|
-
|
|
203
|
+
Library documentation is auto-generated from the [README](https://github.com/weppos/publicsuffix-ruby/blob/master/README.md) and source code, and is available at https://rubydoc.info/gems/public_suffix.
|
|
206
204
|
|
|
207
|
-
|
|
205
|
+
### Bug reports and contributions
|
|
208
206
|
|
|
207
|
+
- **Bug Tracker**: https://github.com/weppos/publicsuffix-ruby/issues
|
|
208
|
+
- **Code Repository**: https://github.com/weppos/publicsuffix-ruby
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
Contributions are welcome! Please include tests and/or feature coverage for every patch, and create a topic branch for every separate change you make.
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
### Enterprise support
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
[Consider subscribing to Tidelift](https://tidelift.com/subscription/pkg/rubygems-public-suffix?utm_source=rubygems-public-suffix&utm_medium=referral&utm_campaign=readme), which provides enterprise support for this project as part of the Tidelift Subscription. Tidelift subscriptions help fund the project, allowing us to ship releases, bugfixes, and security updates more frequently.
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
## Security and vulnerability reporting
|
|
215
218
|
|
|
216
|
-
|
|
219
|
+
For full information and details about our security policy, please visit [`SECURITY.md`](SECURITY.md).
|
|
217
220
|
|
|
218
|
-
tld = Top level domain, this is in reference to the last segment of a domain, sometimes the part that is directly after the "dot" symbol. For example, `mozilla.org`, the `.org` portion is the tld.
|
|
219
221
|
|
|
220
|
-
|
|
222
|
+
## Changelog
|
|
223
|
+
|
|
224
|
+
See [CHANGELOG.md](CHANGELOG.md) for details.
|
|
225
|
+
|
|
221
226
|
|
|
222
|
-
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
Copyright (c) 2009-2025 Simone Carletti. This is Free Software distributed under the MIT license.
|
|
223
230
|
|
|
224
|
-
|
|
231
|
+
The [Public Suffix List source](https://publicsuffix.org/list/) is subject to the terms of the Mozilla Public License, v. 2.0.
|
data/RELEASING.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
This document describes the steps to release a new version of PublicSuffix.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- You have commit access to the repository
|
|
8
|
+
- You have push access to the repository
|
|
9
|
+
- You have a GPG key configured for signing tags
|
|
10
|
+
- You have permission to publish to RubyGems
|
|
11
|
+
|
|
12
|
+
## Release process
|
|
13
|
+
|
|
14
|
+
1. **Determine the new version** using [Semantic Versioning](https://semver.org/)
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
VERSION=X.Y.Z
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- **MAJOR** version for incompatible API changes
|
|
21
|
+
- **MINOR** version for backwards-compatible functionality additions
|
|
22
|
+
- **PATCH** version for backwards-compatible bug fixes
|
|
23
|
+
|
|
24
|
+
2. **Update the version file** with the new version
|
|
25
|
+
|
|
26
|
+
Edit `lib/public_suffix/version.rb` and update the `VERSION` constant:
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
VERSION = "X.Y.Z"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3. **Update the changelog** with the new version
|
|
33
|
+
|
|
34
|
+
Edit `CHANGELOG.md` and add a new section for the release:
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
## vX.Y.Z
|
|
38
|
+
|
|
39
|
+
- Description of changes
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
4. **Install dependencies**
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
bundle install
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
or simply:
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
bundle
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
5. **Run tests** and confirm they pass
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
bundle exec rake test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
6. **Commit the new version**
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
git add lib/public_suffix/version.rb CHANGELOG.md Gemfile.lock
|
|
64
|
+
git commit -m "Release $VERSION"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
7. **Create a signed tag**
|
|
68
|
+
|
|
69
|
+
```shell
|
|
70
|
+
git tag -a v$VERSION -s -m "Release $VERSION"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
8. **Push the changes and tag**
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
git push origin main
|
|
77
|
+
git push origin v$VERSION
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
9. **Build and publish the gem**
|
|
81
|
+
|
|
82
|
+
```shell
|
|
83
|
+
bundle exec rake release
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This will:
|
|
87
|
+
- Build the gem
|
|
88
|
+
- Push it to RubyGems
|
|
89
|
+
- Create a GitHub release
|
|
90
|
+
|
|
91
|
+
## Post-release
|
|
92
|
+
|
|
93
|
+
- Verify the new version appears on [RubyGems](https://rubygems.org/gems/public_suffix)
|
|
94
|
+
- Verify the GitHub release was created
|
|
95
|
+
- Announce the release if necessary
|
data/SECURITY.md
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Security updates are provided only for the current minor version.
|
|
6
6
|
|
|
7
|
-
If you are using a previous minor version, we recommend to upgrade to the current minor version.
|
|
8
|
-
This project uses [semantic versioning](https://semver.org/), therefore you can upgrade to a more recent minor version without incurring into breaking changes.
|
|
7
|
+
If you are using a previous minor version, we recommend to upgrade to the current minor version. This project uses [semantic versioning](https://semver.org/), therefore you can upgrade to a more recent minor version without incurring into breaking changes.
|
|
9
8
|
|
|
10
9
|
Exceptionally, we may support previous minor versions upon request if there are significant reasons preventing to immediately switch the latest minor version.
|
|
11
10
|
|