Authentication and dependencies.
This commit is contained in:
@@ -20,3 +20,4 @@
|
|||||||
|
|
||||||
(define scribblings
|
(define scribblings
|
||||||
'(("scribblings/git-cli.scrbl" () ("git-cli"))))
|
'(("scribblings/git-cli.scrbl" () ("git-cli"))))
|
||||||
|
|
||||||
|
|||||||
+14
-6
@@ -189,17 +189,25 @@
|
|||||||
; post : output has only been inspected.
|
; post : output has only been inspected.
|
||||||
; result : #t when a known authentication failure is present, otherwise #f.
|
; 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)
|
(define (authentication-failure? exit-code output)
|
||||||
(and (not (= exit-code 0))
|
(and (not (= exit-code 0))
|
||||||
(ormap
|
(ormap
|
||||||
(λ (entry)
|
(λ (entry)
|
||||||
(let ((line (string-downcase (format "~a" (cadr entry)))))
|
(let ((line (string-downcase (format "~a" (cadr entry)))))
|
||||||
(or (string-contains? line "authentication failed")
|
(ormap (λ (x) (string-contains? line x)) auth-recognizers)))
|
||||||
(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"))))
|
|
||||||
output)))
|
output)))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|||||||
Reference in New Issue
Block a user