Skip to content

fix: detect 401/403 auth errors from boxo pinning client#49

Merged
pcfreak30 merged 1 commit into
developfrom
fix/auth-error-detection-pinning
May 18, 2026
Merged

fix: detect 401/403 auth errors from boxo pinning client#49
pcfreak30 merged 1 commit into
developfrom
fix/auth-error-detection-pinning

Conversation

@pcfreak30
Copy link
Copy Markdown
Member

@pcfreak30 pcfreak30 commented May 18, 2026

Boxo returns HTTP errors as raw strings like 'remote pinning service
returned http error 401: ...' which were being wrapped as ErrPinningFailed,
producing unhelpful 'pinning failed' messages instead of clear auth errors.

Add isBoxoAuthError() with regex matching on boxo error messages and
use wrapPinningError/WrapAuthError consistently across Pin, List, UnpinAll,
UpdateMetadata, and waitForPinCompletion.


Detect and properly handle 401/403 authentication errors from the boxo pinning client

The boxo remote pinning client returns HTTP 401/403 errors as string-based error messages (e.g., "remote pinning service returned http error 401: unauthorized") rather than typed errors, causing them to be misidentified as generic pinning failures. This PR adds detection for these auth errors via regex matching on the error message, and ensures all pinning operations (Pin, List, Status, UpdateMetadata, waitForPinCompletion) properly surface them as authentication errors with a clear message directing users to re-authenticate.

Boxo returns HTTP errors as raw strings like 'remote pinning service
returned http error 401: ...' which were being wrapped as ErrPinningFailed,
producing unhelpful 'pinning failed' messages instead of clear auth errors.

Add isBoxoAuthError() with regex matching on boxo error messages and
use wrapPinningError/WrapAuthError consistently across Pin, List, UnpinAll,
UpdateMetadata, and waitForPinCompletion.
@kody-ai
Copy link
Copy Markdown

kody-ai Bot commented May 18, 2026

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@github-actions
Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 34.6%

Generated from commit: 6f5029f
Repository: LumeWeb/pinner-cli

@pcfreak30 pcfreak30 merged commit 761a2ea into develop May 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant