Authentication and dependencies.
This commit is contained in:
@@ -20,3 +20,4 @@
|
||||
|
||||
(define scribblings
|
||||
'(("scribblings/git-cli.scrbl" () ("git-cli"))))
|
||||
|
||||
|
||||
+14
-6
@@ -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)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
Reference in New Issue
Block a user