[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/url-http-ntlm 5c47391 13/42: url-http-ntlm.el (url-ntlm
From: |
Stefan Monnier |
Subject: |
[elpa] externals/url-http-ntlm 5c47391 13/42: url-http-ntlm.el (url-ntlm-auth): Move defun near end of file |
Date: |
Sat, 28 Nov 2020 17:19:44 -0500 (EST) |
branch: externals/url-http-ntlm
commit 5c47391579dce3257c45a23b6386f59861d0e17f
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
url-http-ntlm.el (url-ntlm-auth): Move defun near end of file
---
url-http-ntlm.el | 70 ++++++++++++++++++++++++++++----------------------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/url-http-ntlm.el b/url-http-ntlm.el
index 86649a6..302915f 100644
--- a/url-http-ntlm.el
+++ b/url-http-ntlm.el
@@ -53,41 +53,6 @@ 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.")
-(defun url-ntlm-auth (url &optional prompt overwrite realm args)
- "Return an NTLM HTTP authorization header.
-Get the contents of the Authorization header for a HTTP response
-using NTLM authentication, to access URL. Because NTLM is a
-two-step process, this function expects to be called twice, first
-to generate the NTLM type 1 message (request), then to respond to
-the server's type 2 message (challenge) with a suitable response.
-
-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)))
- (case stage
- ;; NTLM Type 1 message: the request
- (:request
- (destructuring-bind (&optional server user hash)
- (url-http-ntlm-authorisation url)
- (when server
- (url-http-ntlm-string
- (ntlm-build-auth-request user server)))))
- ;; NTLM Type 3 message: the response
- (:response
- (let ((challenge (url-http-ntlm-get-challenge)))
- (destructuring-bind (server user hash)
- (url-http-ntlm-authorisation url)
- (url-http-ntlm-string
- (ntlm-build-auth-response challenge
- user
- hash)))))
- (:error
- (url-http-ntlm-authorisation url :clear)))))
-
(defun url-http-ntlm-ensure-keepalive ()
"Report an error if `url-http-attempt-keepalives' is not set."
(assert url-http-attempt-keepalives
@@ -204,6 +169,41 @@ stored."
"Return DATA encoded as an NTLM string."
(concat "NTLM " (base64-encode-string data :nobreak)))
+(defun url-ntlm-auth (url &optional prompt overwrite realm args)
+ "Return an NTLM HTTP authorization header.
+Get the contents of the Authorization header for a HTTP response
+using NTLM authentication, to access URL. Because NTLM is a
+two-step process, this function expects to be called twice, first
+to generate the NTLM type 1 message (request), then to respond to
+the server's type 2 message (challenge) with a suitable response.
+
+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)))
+ (case stage
+ ;; NTLM Type 1 message: the request
+ (:request
+ (destructuring-bind (&optional server user hash)
+ (url-http-ntlm-authorisation url)
+ (when server
+ (url-http-ntlm-string
+ (ntlm-build-auth-request user server)))))
+ ;; NTLM Type 3 message: the response
+ (:response
+ (let ((challenge (url-http-ntlm-get-challenge)))
+ (destructuring-bind (server user hash)
+ (url-http-ntlm-authorisation url)
+ (url-http-ntlm-string
+ (ntlm-build-auth-response challenge
+ user
+ hash)))))
+ (:error
+ (url-http-ntlm-authorisation url :clear)))))
+
(url-register-auth-scheme "ntlm" nil 8)
(provide 'url-http-ntlm)
- [elpa] externals/url-http-ntlm c7587cb 39/42: url-http-ntlm.el: Omit user and domain in Type 1 message, (continued)
- [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
- [elpa] externals/url-http-ntlm a55ae6c 01/42: url-http-ntlm: New package, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 9c79150 02/42: url-http-ntlm: Remove trailing whitespace, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 530faf7 04/42: url-http-ntlm: Wrap lines at column 80, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 722e32f 05/42: url-http-ntlm: Fix checkdoc errors, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm dd393b8 12/42: url-http-ntlm: Use url-http-ntlm namespace consistently, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 5c47391 13/42: url-http-ntlm.el (url-ntlm-auth): Move defun near end of file,
Stefan Monnier <=
- [elpa] externals/url-http-ntlm 0dad577 08/42: url-http-ntlm.el: Update copyright owner and years, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 9813aea 19/42: url-http-ntlm: Prevent infinite loops, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm be85e0a 21/42: url-http-ntlm: Declare url-http-extra-headers special, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 790fbd3 25/42: url-http-ntlm: Change spelling of authorization function, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 2aed8ca 22/42: url-http-ntlm: Autoload url-ntlm-auth and its registration, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm c2db685 28/42: url-http-ntlm: Add `url-debug' debugging messages, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 544d008 27/42: url-http-ntlm: Shorten first line of some docstrings, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 9d142fc 32/42: url-http-ntlm.el: Bump version to 2.0.1, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm 2a29445 34/42: url-http-ntlm: Bump version to 2.0.2, Stefan Monnier, 2020/11/28
- [elpa] externals/url-http-ntlm da855fa 33/42: Remove url-http-ntlm-parse-header-NN.MM.el files, Stefan Monnier, 2020/11/28