diff --git a/info.rkt b/info.rkt index 0906c2f..13b3ee2 100644 --- a/info.rkt +++ b/info.rkt @@ -20,3 +20,4 @@ (define scribblings '(("scribblings/git-cli.scrbl" () ("git-cli")))) + diff --git a/private/git-auth.rkt b/private/git-auth.rkt index 1f1888d..6c615fc 100644 --- a/private/git-auth.rkt +++ b/private/git-auth.rkt @@ -189,17 +189,25 @@ ; post : output has only been inspected. ; result : #t when a known authentication failure is present, otherwise #f. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define auth-recognizers + '("authentication failed" + "failed to authenticate" + "could not read username" + "could not read password" + "http basic: access denied" + "access denied" + "terminal prompts disabled" + "requested url returned error: 401" + "requested url returned error: 403" + )) + (define (authentication-failure? exit-code output) (and (not (= exit-code 0)) (ormap (λ (entry) (let ((line (string-downcase (format "~a" (cadr entry))))) - (or (string-contains? line "authentication failed") - (string-contains? line "failed to authenticate") - (string-contains? line "could not read username") - (string-contains? line "could not read password") - (string-contains? line "http basic: access denied") - (string-contains? line "terminal prompts disabled")))) + (ormap (λ (x) (string-contains? line x)) auth-recognizers))) output))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;