Skip to content

Commit 397be82

Browse files
authored
Merge pull request #642 from maxmind/greg/stf-557
Validate and update links (STF-557)
2 parents 7cabbcd + 7cb9a22 commit 397be82

11 files changed

Lines changed: 148 additions & 13 deletions

File tree

.github/workflows/links.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Links
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 13 * * 1" # weekly, to catch external link rot without a commit
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
linkChecker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
21+
- name: Setup mise
22+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
23+
with:
24+
install: false
25+
26+
# Install only lychee (not the repo's full toolchain) and run the check.
27+
- name: Check links
28+
env:
29+
MISE_AUTO_INSTALL: "false"
30+
run: |
31+
mise install lychee
32+
mise run check-links

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
.claude
1010
.gh-pages
1111
.idea
12+
.lycheecache
1213
docs/.hugo_build.lock
1314
docs/public/
1415
.pmd

README.dev.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
To get this access, first create a Central Portal account. You will then need
2121
access to our namespace, but we have not added anyone since switching to
22-
Central Portal. Previously you would need to make an account on the [Sonatype
23-
JIRA issue tracker](https://issues.sonatype.org/) and make an issue asking for
24-
access [like so](https://issues.sonatype.org/browse/OSSRH-34414).
22+
Central Portal. Previously you would need to make an account on the Sonatype
23+
JIRA issue tracker and make an issue asking for access. That tracker has since
24+
been [retired](https://central.sonatype.org/faq/what-happened-to-issues-sonatype-org/).
2525

2626
Ensure you inform MaxMind operations about your new access.
2727

@@ -52,7 +52,7 @@ and enter `trust` and choose ultimate.
5252
Make sure the key shows up in `gpg --list-secret-keys`.
5353

5454
Make sure you publish it to a keyserver. See
55-
[here](http://central.sonatype.org/pages/working-with-pgp-signatures.html)
55+
[here](https://central.sonatype.org/publish/requirements/gpg/)
5656
for more info about that and the process in general.
5757

5858
### gpg "inappropriate ioctl" errors

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ Please report all issues with this code using the
327327

328328
If you are having an issue with the minFraud service that is not specific
329329
to the client API, please see
330-
[our support page](https://www.maxmind.com/en/support).
330+
[our support page](https://support.maxmind.com/knowledge-base).
331331

332332
## Requirements ##
333333

lychee.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Lychee link checker configuration
2+
# https://lychee.cli.rs/#/usage/config
3+
#
4+
# Run locally with:
5+
# lychee './**/*.md' './src/**/*.java' './pom.xml'
6+
7+
# Include URL fragments in checks
8+
include_fragments = true
9+
10+
# Don't allow any redirects, so links that have moved are surfaced and updated
11+
# to their canonical destination.
12+
max_redirects = 0
13+
14+
# Accept these HTTP status codes
15+
# 100-103: Informational responses
16+
# 200-299: Success responses
17+
# 403: Forbidden (some sites use this for rate limiting)
18+
# 429: Too Many Requests
19+
# 500-599: Server errors (temporary issues shouldn't fail CI)
20+
# 999: LinkedIn's custom status code
21+
accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"]
22+
23+
# Exclude URL patterns from checking (treated as regular expressions)
24+
exclude = [
25+
'^file://',
26+
# Live / auth-gated endpoints that appear as string literals or require login
27+
'^https://geoip\.maxmind\.com',
28+
'^https://geolite\.info',
29+
'^https://minfraud\.maxmind\.com',
30+
'^https://sandbox\.maxmind\.com',
31+
'^https://updates\.maxmind\.com',
32+
'^https://www\.maxmind\.com/en/accounts/',
33+
'https://www\.maxmind\.com/en/account/login',
34+
# XML namespace identifiers in pom.xml (not real links)
35+
'^http://www\.w3\.org/',
36+
'^http://maven\.apache\.org/',
37+
'^https://maven\.apache\.org/xsd/',
38+
'^http://java\.sun\.com/',
39+
'^http://schemas\.',
40+
# Maven property placeholder in a build-time download URL (not a real link)
41+
'japicmp\.baselineVersion',
42+
# dev.maxmind.com docs render anchors client-side, so lychee cannot verify
43+
# the #schema-... fragment even though the page (a clean 200) contains it.
44+
'^https://dev\.maxmind\.com/minfraud/api-documentation/responses/#',
45+
# Placeholders / local
46+
'^https?://example\.(com|org|net)',
47+
'^http://localhost',
48+
'127\.0\.0\.1',
49+
]
50+
51+
# Exclude file paths from getting checked (treated as regular expressions)
52+
exclude_path = [
53+
'(^|/)node_modules/',
54+
'(^|/)target/',
55+
'(^|/)\.git/',
56+
# Test code and fixtures contain example URLs (e.g. www.example.com), not ours
57+
'(^|/)src/test/',
58+
# Changelog: historical entries are preserved as-is, not rewritten
59+
'(^|/)CHANGELOG\.md$',
60+
]
61+
62+
# Cache results for 1 day to speed up repeated checks
63+
cache = true
64+
max_cache_age = "1d"
65+
66+
# Skip missing input files instead of erroring
67+
skip_missing = true

mise.lock

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ disable_backends = [
99
[tools]
1010
hugo = "latest"
1111
java = "latest"
12+
lychee = "latest"
1213
maven = "latest"
1314

1415
[tasks.build-docs]
@@ -19,6 +20,10 @@ run = "hugo --source docs --minify"
1920
description = "Serve the docs site locally with Hugo dev server"
2021
run = "hugo server --source docs"
2122

23+
[tasks.check-links]
24+
description = "Check links with lychee"
25+
run = "lychee --no-progress './**/*.md' './src/**/*.java' './pom.xml'"
26+
2227
[hooks]
2328
enter = "mise install --quiet --locked"
2429

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
<version>4.3.0</version>
88
<name>MaxMind minFraud API</name>
99
<description>MaxMind minFraud Score, Insights, Factors and Report Transaction API</description>
10-
<url>http://dev.maxmind.com/minfraud</url>
10+
<url>https://dev.maxmind.com/minfraud/</url>
1111
<licenses>
1212
<license>
1313
<name>Apache License, Version 2.0</name>
14-
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
14+
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
1515
<distribution>repo</distribution>
1616
</license>
1717
</licenses>
1818
<organization>
1919
<name>MaxMind, Inc.</name>
20-
<url>http://www.maxmind.com/</url>
20+
<url>https://www.maxmind.com/en/home</url>
2121
</organization>
2222
<scm>
2323
<url>https://github.com/maxmind/minfraud-api-java</url>

src/main/java/com/maxmind/minfraud/request/CustomInputs.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
/**
1010
* Custom inputs to be used in
11-
* <a href="https://www.maxmind.com/en/minfraud-interactive/#/custom-rules">Custom Rules</a>.
11+
* <a href="https://www.maxmind.com/en/accounts/current/minfraud-interactive/custom-rules">Custom
12+
* Rules</a>.
1213
* In order to use custom inputs, you must set them up from your account portal.
1314
*/
1415
public final class CustomInputs extends AbstractModel {

src/main/java/com/maxmind/minfraud/response/Device.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* date-time.
2222
* @param localTime The date and time of the transaction at the UTC offset associated with the
2323
* device. This is an RFC 3339 date-time.
24-
* @see <a href="https://dev.maxmind.com/minfraud/track-devices?lang=en">Device Tracking Add-on</a>
24+
* @see <a href="https://dev.maxmind.com/minfraud/track-devices/?lang=en">Device Tracking Add-on</a>
2525
*/
2626
public record Device(
2727
@JsonProperty("confidence")

0 commit comments

Comments
 (0)