Authentication and dependencies.

This commit is contained in:
2026-08-13 20:35:38 +02:00
parent f36cc5ad94
commit 9f2e4b2bcc
2 changed files with 15 additions and 6 deletions
+1
View File
@@ -20,3 +20,4 @@
(define scribblings
'(("scribblings/git-cli.scrbl" () ("git-cli"))))
+14 -6
View File
@@ -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)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;