[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/url-http-ntlm daef9e2 15/42: url-http-ntlm: Use double
From: |
Stefan Monnier |
Subject: |
[elpa] externals/url-http-ntlm daef9e2 15/42: url-http-ntlm: Use double dash naming convention for private symbols |
Date: |
Sat, 28 Nov 2020 17:19:44 -0500 (EST) |
branch: externals/url-http-ntlm
commit daef9e270d603bb86c0a0d8caf28bb88e3a39aeb
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
url-http-ntlm: Use double dash naming convention for private symbols
* url-http-ntlm.el (url-http-ntlm--auth-storage): Rename from
url-http-ntlm-auth-storage.
(url-http-ntlm-last-args): Rename from url-http-ntlm-last-args.
(url-http-ntlm--ensure-keepalive): Rename from
url-http-ntlm-ensure-keepalive.
(url-http-ntlm--clean-headers): Rename from
url-http-ntlm-clean-headers. Update private function calls.
(url-http-ntlm--get-stage): Rename from url-http-ntlm-get-stage.
Update private function calls and variable references.
(url-http-ntlm--authorisation): Rename from
url-http-ntlm-authorisation. Update private function calls and
variable references.
(url-http-ntlm--get-challenge): Rename from
url-http-ntlm-get-challenge.
(url-http-ntlm--rmssoc): Rename from url-http-ntlm-rmssoc.
(url-http-ntlm--string): Rename from url-http-ntlm-string.
(url-ntlm-auth): Update private function calls and variable
references.
---
url-http-ntlm.el | 60 ++++++++++++++++++++++++++++----------------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/url-http-ntlm.el b/url-http-ntlm.el
index 47f57e0..4750ae1 100644
--- a/url-http-ntlm.el
+++ b/url-http-ntlm.el
@@ -43,7 +43,7 @@
(require 'cl)
(require 'ntlm)
-(defvar url-http-ntlm-auth-storage nil
+(defvar url-http-ntlm--auth-storage nil
"Authentication storage.
An alist that maps a server name to a pair of \(<username> <ntlm
hashes>\).
@@ -53,24 +53,24 @@ The username can contain the domain name, in the form
\"user@domain\".
Note that for any server, only one user and password is ever stored.")
-(defvar url-http-ntlm-last-args nil
- "Stores the last `url-http-ntlm-get-stage' arguments and return value.
+(defvar url-http-ntlm--last-args nil
+ "Stores the last `url-http-ntlm--get-stage' arguments and return value.
This is used to detect multiple calls.")
-(make-variable-buffer-local 'url-http-ntlm-last-args)
+(make-variable-buffer-local 'url-http-ntlm--last-args)
-(defun url-http-ntlm-ensure-keepalive ()
+(defun url-http-ntlm--ensure-keepalive ()
"Report an error if `url-http-attempt-keepalives' is not set."
(assert url-http-attempt-keepalives
nil
(concat "NTLM authentication won't work unless"
" `url-http-attempt-keepalives' is set!")))
-(defun url-http-ntlm-clean-headers ()
+(defun url-http-ntlm--clean-headers ()
"Remove Authorization element from `url-http-extra-headers' alist."
(setq url-http-extra-headers
- (url-http-ntlm-rmssoc "Authorization" url-http-extra-headers)))
+ (url-http-ntlm--rmssoc "Authorization" url-http-extra-headers)))
-(defun url-http-ntlm-get-stage (args)
+(defun url-http-ntlm--get-stage (args)
"Determine what stage of the NTLM handshake we are at.
PROMPT and ARGS come from `url-ntlm-auth''s caller,
`url-get-authentication'. Their meaning depends on the current
@@ -87,9 +87,9 @@ response's \"WWW-Authenticate\" header, munged by
(auth-header (assoc "Authorization" url-http-extra-headers))
(case-fold-search t)
stage)
- (if (eq args (car url-http-ntlm-last-args))
+ (if (eq args (car url-http-ntlm--last-args))
;; multiple calls, return the same argument we returned last time
- (cdr url-http-ntlm-last-args)
+ (cdr url-http-ntlm--last-args)
(let ((stage
(cond ((and auth-header (string-match response-rxp
(cdr auth-header)))
@@ -102,11 +102,11 @@ response's \"WWW-Authenticate\" header, munged by
:response)
(t
:request))))
- (url-http-ntlm-clean-headers)
- (setq url-http-ntlm-last-args (cons args stage))
+ (url-http-ntlm--clean-headers)
+ (setq url-http-ntlm--last-args (cons args stage))
stage))))
-(defun url-http-ntlm-authorisation (url &optional clear)
+(defun url-http-ntlm--authorisation (url &optional clear)
"Get or clear NTLM authentication details for URL.
If CLEAR is non-nil, clear any saved credentials for server.
Otherwise, return the credentials, prompting the user if
@@ -123,13 +123,13 @@ stored."
(server (url-host href))
(user (url-user href))
(pass (url-password href))
- (stored (assoc server url-http-ntlm-auth-storage))
+ (stored (assoc server url-http-ntlm--auth-storage))
(both (and user pass)))
(if clear
;; clear
(unless both
- (setq url-http-ntlm-auth-storage
- (url-http-ntlm-rmssoc server url-http-ntlm-auth-storage))
+ (setq url-http-ntlm--auth-storage
+ (url-http-ntlm--rmssoc server url-http-ntlm--auth-storage))
nil)
;; get
(if (or both
@@ -145,14 +145,14 @@ stored."
(entry `(,server . (,user*
,(ntlm-get-password-hashes pass*)))))
(unless both
- (setq url-http-ntlm-auth-storage
+ (setq url-http-ntlm--auth-storage
(cons entry
- (url-http-ntlm-rmssoc server
- url-http-ntlm-auth-storage))))
+ (url-http-ntlm--rmssoc server
+ url-http-ntlm--auth-storage))))
entry)
stored))))
-(defun url-http-ntlm-get-challenge ()
+(defun url-http-ntlm--get-challenge ()
"Return the NTLM Type-2 message in the WWW-Authenticate header, if present."
(save-restriction
(mail-narrow-to-head)
@@ -161,11 +161,11 @@ stored."
www-authenticate)
(base64-decode-string (match-string 1 www-authenticate))))))
-(defun url-http-ntlm-rmssoc (key alist)
+(defun url-http-ntlm--rmssoc (key alist)
"Remove all elements whose `car' match KEY from ALIST."
(remove* key alist :key 'car :test 'equal))
-(defun url-http-ntlm-string (data)
+(defun url-http-ntlm--string (data)
"Return DATA encoded as an NTLM string."
(concat "NTLM " (base64-encode-string data :nobreak)))
@@ -182,27 +182,27 @@ PROMPT, OVERWRITE, and REALM are ignored.
ARGS is expected to contain the WWW-Authentication header from
the server's last response. These are used by
`url-http-get-stage' to determine what stage we are at."
- (url-http-ntlm-ensure-keepalive)
- (let ((stage (url-http-ntlm-get-stage args)))
+ (url-http-ntlm--ensure-keepalive)
+ (let ((stage (url-http-ntlm--get-stage args)))
(case stage
;; NTLM Type 1 message: the request
(:request
(destructuring-bind (&optional server user hash)
- (url-http-ntlm-authorisation url)
+ (url-http-ntlm--authorisation url)
(when server
- (url-http-ntlm-string
+ (url-http-ntlm--string
(ntlm-build-auth-request user server)))))
;; NTLM Type 3 message: the response
(:response
- (let ((challenge (url-http-ntlm-get-challenge)))
+ (let ((challenge (url-http-ntlm--get-challenge)))
(destructuring-bind (server user hash)
- (url-http-ntlm-authorisation url)
- (url-http-ntlm-string
+ (url-http-ntlm--authorisation url)
+ (url-http-ntlm--string
(ntlm-build-auth-response challenge
user
hash)))))
(:error
- (url-http-ntlm-authorisation url :clear)))))
+ (url-http-ntlm--authorisation url :clear)))))
(url-register-auth-scheme "ntlm" nil 8)
- [elpa] externals/url-http-ntlm 33a3941 09/42: url-http-ntlm.el: Add maintainer header, (continued)
- [elpa] externals/url-http-ntlm 33a3941 09/42: url-http-ntlm.el: Add maintainer header, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm aeddc9e 10/42: url-http-ntlm.el: Update installation instructions, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm f69bb6b 06/42: url-http-ntlm: Remove blank comment lines, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 8cefb06 11/42: url-http-ntlm.el: Update author's email address, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 21b0f82 17/42: url-http-ntlm: Port to cl-lib, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 516cd35 24/42: url-http-ntlm.el: Add home page header, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm a2cc6c2 23/42: url-http-ntlm: Add auth-source support, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 8efb977 26/42: url-http-ntlm.el: Require ntlm 2.0.0, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 4c8edce 20/42: url-http-ntlm: Remove limit of one username and password per server, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm de4cfea 18/42: url-http-ntlm: Override url-http-parse-headers redirect handling, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm daef9e2 15/42: url-http-ntlm: Use double dash naming convention for private symbols,
Stefan Monnier <=
- [elpa] externals/url-http-ntlm 2d0a650 16/42: url-http-ntlm.el: Add comment headings, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 334222c 14/42: url-http-ntlm.el (url-http-ntlm-last-args): Group defvar with others, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 48849b1 31/42: url-http-ntlm.el: Update copyright years, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm d070501 29/42: url-http-ntlm: Add cl-lib to Package-Requires, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm b92ef48 37/42: url-http-ntlm: Bump ntlm required version to 2.1.0, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm c7587cb 39/42: url-http-ntlm.el: Omit user and domain in Type 1 message, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 5ca617f 40/42: url-http-ntlm: Bump version to 2.0.4, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm ec0acb3 30/42: url-http-ntlm.el: Bump version to 2.0.0, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 4c2295b 35/42: Fix some quoting problems in doc strings, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm f5276f1 42/42: * .gitignore: New file, Stefan Monnier, 2020/11/28