;;; url-http-ntlm.el --- NTLM authentication for the url library
;; Copyright (C) 2008, 2016 Free Software Foundation, Inc.
;; Author: Tom Schutzer-Weissmann <tom.weissmann@gmail.com>
;; Maintainer: Thomas Fitzsimmons <fitzsim@fitzsim.org>
;; Version: 2.0.4
;; Keywords: comm, data, processes, hypermedia
;; Homepage: https://code.google.com/p/url-http-ntlm/
;; Package-Requires: ((cl-lib "0.5") (ntlm "2.1.0"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; This package provides a NTLM handler for the URL package.
;;
;; Installation:
;;
;; M-x package-install RET url-http-ntlm RET
;;
;; Acknowledgements:
;;
;; Taro Kawagishi <tarok@transpulse.org> wrote ntlm.el and md4.el,
;; which are parts of FLIM (Faithful Library about Internet Message).
;;
;; http://stuff.mit.edu/afs/sipb/contrib/emacs/packages/flim-1.14.7/ntlm.el
;; http://stuff.mit.edu/afs/sipb/contrib/emacs/packages/flim-1.14.7/md4.el
;;; Code:
;; Remove authorization after redirect.
;;; Private variables.
;;; Private functions.
;;; Public function called by `url-get-authentication'.
;;;###autoload
;;; Register `url-ntlm-auth' HTTP authentication method.
;;;###autoload
;;;; ChangeLog:
;; 2017-08-14 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Bump version to 2.0.4
;;
;; * packages/url-http-ntlm/url-http-ntlm.el: Bump version to 2.0.4.
;;
;; 2017-08-14 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Omit user and domain in Type 1 message
;;
;; * packages/url-http-ntlm/url-http-ntlm.el (url-ntlm-auth): Omit user and
;; domain in Type 1 message.
;;
;; 2016-10-05 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Bump version to 2.0.3
;;
;; * packages/url-http-ntlm/url-http-ntlm.el: Bump version to 2.0.3.
;;
;; 2016-10-05 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Bump ntlm required version to 2.1.0
;;
;; 2016-10-05 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Avoid calculating responses twice
;;
;; * packages/url-http-ntlm/url-http-ntlm.el
;; (url-http-ntlm--get-stage): Update docstring.
;; (url-ntlm-auth): Return immediately if prompt is not t. Update
;; docstring.
;;
;; 2016-07-11 Paul Eggert <eggert@cs.ucla.edu>
;;
;; Fix some quoting problems in doc strings
;;
;; Most of these are minor issues involving, e.g., quoting `like this'
;; instead of 'like this'. A few involve escaping ` and ' with a preceding
;; \= when the characters should not be turned into curved single quotes.
;;
;; 2016-02-21 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Bump version to 2.0.2
;;
;; * packages/url-http-ntlm/url-http-ntlm.el: Bump version to 2.0.2.
;;
;; 2016-02-21 Stefan Monnier <monnier@iro.umontreal.ca>
;;
;; Remove url-http-ntlm-parse-header-NN.MM.el files
;;
;; * packages/url-http-ntlm/url-http-ntlm.el: Add advice around
;; url-http-parse-headers, url-http-handle-authentication and
;; url-retrieve-internal to clear HTTP Authorization header.
;; * packages/url-http-ntlm/url-http-ntlm-parse-headers-24.1.el,
;; packages/url-http-ntlm/url-http-ntlm-parse-headers-24.2.el,
;; packages/url-http-ntlm/url-http-ntlm-parse-headers-24.3.el,
;; packages/url-http-ntlm/url-http-ntlm-parse-headers-24.4.el,
;; packages/url-http-ntlm/url-http-ntlm-parse-headers-24.5.el: Remove
;; files.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Bump version to 2.0.1
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Update copyright years
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Bump version to 2.0.0
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Add cl-lib to Package-Requires
;;
;; * url-http-ntlm.el: Add cl-lib to Package-Requires.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Add `url-debug' debugging messages
;;
;; * url-http-ntlm.el: Require url-util.
;; (url-http-ntlm--get-stage, url-ntlm-auth): Add debugging messages.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Shorten first line of some docstrings
;;
;; * url-http-ntlm.el (url-http-ntlm--last-args)
;; (url-http-ntlm--default-users, url-http-ntlm--get-challenge): Shorten
;; first line of documentation string.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Require ntlm 2.0.0
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Change spelling of authorization function
;;
;; * url-http-ntlm.el (url-http-ntlm--detect-loop): Update call to
;; url-http-ntlm--authorization.
;; (url-http-ntlm--authorization): Rename from
;; url-http-ntlm--authorisation.
;; (url-ntlm-auth): Update call to url-http-ntlm--authorization.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Add home page header
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Add auth-source support
;;
;; * url-http-ntlm.el (url-http-ntlm--authorisation): Try to read user and
;; password using auth-source library.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Autoload url-ntlm-auth and its registration
;;
;; * url-http-ntlm.el Autoload call to url-register-auth-scheme.
;; (url-ntlm-auth): Autoload function.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Declare url-http-extra-headers special
;;
;; * url-http-ntlm.el (url-http-ntlm--clean-headers): Declare
;; url-http-extra-headers special.
;; (url-http-ntlm--get-stage): Likewise.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Remove limit of one username and password per server
;;
;; * url-http-ntlm.el: Remove comment about only supporting one username
;; and password. Do not make url-http-ntlm--last-args a buffer-local
;; variable.
;; (url-http-ntlm--auth-storage): Change docstring to not mention one user
;; and password limitation.
;; (url-http-ntlm--default-users): New variable.
;; (url-http-ntlm--ensure-user): New function.
;; (url-http-ntlm--get-stage): Take a url argument. Store a key in
;; url-http-ntlm--last-args.
;; (url-http-ntlm--authorisation): Take a realm argument. Use a key when
;; accessing url-http-ntlm--last-args.
;; (url-ntlm-auth): Ensure the received URL has its user slot set before
;; processing it.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Prevent infinite loops
;;
;; * url-http-ntlm.el (url-http-ntlm--loop-timer-counter): New variable.
;; (url-http-ntlm--detect-loop): New function.
;; (url-ntlm-auth): Call url-http-ntlm--detect-loop before handling a
;; request or response.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Override url-http-parse-headers redirect handling
;;
;; * url-http-ntlm.el: Require versioned url-http-ntlm-parse-headers
;; feature when emacs-major-version is less than 25.
;; * url-http-ntlm-parse-headers-24.1.el,
;; url-http-ntlm-parse-headers-24.2.el,
;; url-http-ntlm-parse-headers-24.3.el,
;; url-http-ntlm-parse-headers-24.4.el,
;; url-http-ntlm-parse-headers-24.5.el: New files.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Port to cl-lib
;;
;; * url-http-ntlm.el: Require cl-lib.
;; (url-http-ntlm--ensure-keepalive): Use cl-assert.
;; (url-http-ntlm--get-stage): Use cl-destructuring-bind.
;; (url-http-ntlm--authorisation): Use cl-second.
;; (url-http-ntlm--rmssoc): Use cl-remove.
;; (url-ntlm-auth): Use cl-case and cl-destructuring-bind.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Add comment headings
;;
;; 2016-02-17 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.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el (url-http-ntlm-last-args): Group defvar with others
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el (url-ntlm-auth): Move defun near end of file
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Use url-http-ntlm namespace consistently
;;
;; * url-http-ntlm.el (url-ntlm-auth): Call url-http-ntlm-ensure-keepalive
;; and url-http-ntlm-get-stage.
;; (url-http-ntlm-ensure-keepalive): Rename from url-ntlm-ensure-keepalive.
;; (url-http-ntlm-clean-headers): Rename from url-ntlm-clean-headers.
;; (url-http-ntlm-last-args): Rename from url-ntlm-last-args.
;; (url-http-ntlm-get-stage): Rename from url-ntlm-get-stage.
;; (url-http-ntlm-get-stage): Reference url-http-ntlm-last-args. Call
;; url-http-ntlm-clean-headers.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Update author's email address
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Update installation instructions
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Add maintainer header
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Update copyright owner and years
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Reindent whole file
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Remove blank comment lines
;;
;; * url-http-ntlm.el (url-ntlm-auth, url-ntlm-get-stage): Remove blank
;; comment lines.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Fix checkdoc errors
;;
;; * url-http-ntlm.el (url-http-ntlm-auth-storage, url-ntlm-auth)
;; (url-ntlm-ensure-keepalive, url-ntlm-clean-headers)
;; (url-ntlm-get-stage, url-http-ntlm-authorisation)
;; (url-http-ntlm-get-challenge, url-http-ntlm-rmssoc)
;; (url-http-ntlm-string): Fix checkdoc errors.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Wrap lines at column 80
;;
;; * url-http-ntlm.el (url-ntlm-ensure-keepalive, url-ntlm-last-args)
;; (url-ntlm-get-stage, url-http-ntlm-authorisation): Wrap lines at column
;; 80.
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm.el: Adjust blank lines
;;
;; 2016-02-17 Thomas Fitzsimmons <fitzsim@fitzsim.org>
;;
;; url-http-ntlm: Remove trailing whitespace
;;
;; * url-http-ntlm.el (url-http-ntlm-authorisation): Remove trailing
;; whitespace.
;;
;; 2016-02-17 Tom Schutzer-Weissmann <tom.weissmann@gmail.com>
;;
;; url-http-ntlm: New package
;;
;; * url-http-ntlm.el: Import from
;; https://url-http-ntlm.googlecode.com/svn/trunk/url-http-ntlm.el,
;; revision r2.
;;
;;; url-http-ntlm.el ends here