Classify invalid delivery destinations during preflight

This commit is contained in:
2026-11-01 19:24:52 +00:00
parent 627d524aa2
commit e5512d50b0
9 changed files with 146 additions and 14 deletions

View File

@@ -48,11 +48,13 @@ type DeliveryDestination struct {
Token string
}
// DeliveryPreflightFailureKind classifies a failure while checking a delivery
// destination's credentials and repository access.
// DeliveryPreflightFailureKind classifies a failure while checking destination
// settings, credentials, and repository access.
type DeliveryPreflightFailureKind string
const (
// DeliveryPreflightInvalidDestination means the destination settings fail local validation.
DeliveryPreflightInvalidDestination DeliveryPreflightFailureKind = "invalid_destination"
// DeliveryPreflightMissingCredential means no nonblank credential was supplied.
DeliveryPreflightMissingCredential DeliveryPreflightFailureKind = "missing_credential"
// DeliveryPreflightInvalidCredential means the selected service rejected the credential.
@@ -221,6 +223,8 @@ func publicPreflightError(err error) error {
}
kind := DeliveryPreflightUnavailable
switch failure.Kind {
case forge.PreflightInvalidDestination:
kind = DeliveryPreflightInvalidDestination
case forge.PreflightMissingCredential:
kind = DeliveryPreflightMissingCredential
case forge.PreflightInvalidCredential: