tpagectl: 401 and 403 conflated as authentication failed #550

Closed
opened 2026-08-05 09:19:56 +00:00 by the.auditor · 1 comment
Owner

In runCreate (internal/tpagectl/site/create.go), both 401 and 403 map to authentication failed: …, but the daemon's 403 means "not authorized to register for this owner" (authorization/owner mismatch), not bad credentials.

Suggested fix: distinguish wording — 401 → authentication failure, 403 → authorization failure (not permitted for this owner). Also untested: the 403 path and the non-auth error passthrough (e.g. 409 conflict should surface the raw error without the "authentication failed" prefix).

Ref: PR #548

In `runCreate` (`internal/tpagectl/site/create.go`), both 401 and 403 map to `authentication failed: …`, but the daemon's 403 means "not authorized to register for this owner" (authorization/owner mismatch), not bad credentials. Suggested fix: distinguish wording — 401 → authentication failure, 403 → authorization failure (not permitted for this owner). Also untested: the 403 path and the non-auth error passthrough (e.g. 409 conflict should surface the raw error without the "authentication failed" prefix). Ref: PR #548
Owner

Fixed in #634: site create distinguishes 401 ("authentication failed") from 403 ("not authorized to register site for owner ..."), with a regression test.

Fixed in #634: `site create` distinguishes 401 ("authentication failed") from 403 ("not authorized to register site for owner ..."), with a regression test.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#550
No description provided.