[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4128f4f 13/32: url-http-ntlm.el (url-ntlm-auth): Move defu
From: |
Thomas Fitzsimmons |
Subject: |
[elpa] master 4128f4f 13/32: url-http-ntlm.el (url-ntlm-auth): Move defun near end of file |
Date: |
Thu, 18 Feb 2016 03:27:53 +0000 |
branch: master
commit 4128f4fb735e3a179420a8d3bc2bd5c89a889dfb
Author: Thomas Fitzsimmons <address@hidden>
Commit: Thomas Fitzsimmons <address@hidden>
url-http-ntlm.el (url-ntlm-auth): Move defun near end of file
---
packages/url-http-ntlm/url-http-ntlm.el | 70 +++++++++++++++---------------
1 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/packages/url-http-ntlm/url-http-ntlm.el
b/packages/url-http-ntlm/url-http-ntlm.el
index 86649a6..302915f 100644
--- a/packages/url-http-ntlm/url-http-ntlm.el
+++ b/packages/url-http-ntlm/url-http-ntlm.el
@@ -53,41 +53,6 @@ The username can contain the domain name, in the form
\"address@hidden".
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] master 0bbbe59 03/32: url-http-ntlm.el: Adjust blank lines, (continued)
- [elpa] master 0bbbe59 03/32: url-http-ntlm.el: Adjust blank lines, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 9e52a39 04/32: url-http-ntlm: Wrap lines at column 80, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 0799c67 05/32: url-http-ntlm: Fix checkdoc errors, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 8482b90 06/32: url-http-ntlm: Remove blank comment lines, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 50656c4 07/32: url-http-ntlm.el: Reindent whole file, Thomas Fitzsimmons, 2016/02/17
- [elpa] master cec4982 08/32: url-http-ntlm.el: Update copyright owner and years, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 2d39d5d 09/32: url-http-ntlm.el: Add maintainer header, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 3033c48 10/32: url-http-ntlm.el: Update installation instructions, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 19e93aa 11/32: url-http-ntlm.el: Update author's email address, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 6fb3a70 12/32: url-http-ntlm: Use url-http-ntlm namespace consistently, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 4128f4f 13/32: url-http-ntlm.el (url-ntlm-auth): Move defun near end of file,
Thomas Fitzsimmons <=
- [elpa] master 55e7f42 14/32: url-http-ntlm.el (url-http-ntlm-last-args): Group defvar with others, Thomas Fitzsimmons, 2016/02/17
- [elpa] master d251ed3 15/32: url-http-ntlm: Use double dash naming convention for private symbols, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 47e1c41 16/32: url-http-ntlm.el: Add comment headings, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 8ce1ae7 17/32: url-http-ntlm: Port to cl-lib, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 2dbfb38 19/32: url-http-ntlm: Prevent infinite loops, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 355e756 20/32: url-http-ntlm: Remove limit of one username and password per server, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 0f6ba4d 21/32: url-http-ntlm: Declare url-http-extra-headers special, Thomas Fitzsimmons, 2016/02/17
- [elpa] master eba1c75 18/32: url-http-ntlm: Override url-http-parse-headers redirect handling, Thomas Fitzsimmons, 2016/02/17
- [elpa] master 904d3e6 22/32: url-http-ntlm: Autoload url-ntlm-auth and its registration, Thomas Fitzsimmons, 2016/02/17
- [elpa] master bc582f8 23/32: url-http-ntlm: Add auth-source support, Thomas Fitzsimmons, 2016/02/17