mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 02:17:46 +00:00
Surface 401 from instance detection so the user can supply credentials
When an instance sits behind a reverse proxy that requires HTTP Basic Auth, every detection probe (/info, /api/v1/config, /api/v1/stats, /healthcheck, /config) returns 401 before reaching the real backend, so the type cannot be identified. Re-throw APIError.unauthorized from each probe instead of swallowing it, and have detectWithResult convert the first 401 it sees into DetectionError.basicAuthRequired. Add a basicAuthHeader parameter so the caller can retry detection after the user provides credentials; if a retry also returns 401, surface basicAuthInvalid instead.
This commit is contained in:
@@ -14593,6 +14593,28 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sources.error.basicAuthInvalid" : {
|
||||
"comment" : "Error when HTTP Basic Auth credentials are rejected by the server",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Invalid HTTP Basic Auth credentials. Check the username and password."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sources.error.basicAuthRequired" : {
|
||||
"comment" : "Error when an instance is fronted by HTTP Basic Auth and credentials are required to detect its type",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This instance requires HTTP Basic Auth. Enter a username and password to continue."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sources.error.couldNotDetect" : {
|
||||
"comment" : "Error when source type could not be detected",
|
||||
"localizations" : {
|
||||
|
||||
Reference in New Issue
Block a user