[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/url-http-oauth 085d57961a 20/24: Make message formattin
|
From: |
Thomas Fitzsimmons |
|
Subject: |
[elpa] externals/url-http-oauth 085d57961a 20/24: Make message formatting consistent |
|
Date: |
Mon, 8 May 2023 21:10:48 -0400 (EDT) |
branch: externals/url-http-oauth
commit 085d57961a4b42d41f324c0af0512f0684b3fe28
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Make message formatting consistent
* url-http-oauth.el (url-http-oauth-interpose)
(url-http-oauth--parse-grant, url-http-oauth--expiry-string)
(url-http-oauth--url-build-refresh, url-oauth-auth): Add package
name herald to error message.
(url-http-oauth--netrc-delete): Remove a message.
---
url-http-oauth.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/url-http-oauth.el b/url-http-oauth.el
index 5394846391..b0ef7dcfe5 100644
--- a/url-http-oauth.el
+++ b/url-http-oauth.el
@@ -133,7 +133,7 @@ REDIRECT_URI."
(let* ((client-secret-method
(cdr (assoc "client-secret-method" url-settings))))
(unless (or (eq client-secret-method 'prompt) (eq client-secret-method
nil))
- (error "Unrecognized client-secret-method value"))
+ (error "url-http-oauth: Unrecognized client-secret-method value"))
(prog1
(add-to-list 'url-http-oauth--interposed url-settings)
(url-http-oauth--update-regexp))))
@@ -223,14 +223,14 @@ server to receive a new access token."
(defun url-http-oauth--parse-grant ()
"Parse the JSON grant structure in the current buffer.
Return the parsed JSON object."
- (message "url-http-oauth grant: %s" (buffer-string))
+ (message "url-http-oauth: grant: %s" (buffer-string))
(progn
(goto-char (point-min))
(re-search-forward "\n\n")
(let* ((grant (url-http-oauth--json-parse-buffer))
(type (gethash "token_type" grant)))
(unless (equal (downcase type) "bearer")
- (error "Unrecognized token type %s" type))
+ (error "url-http-oauth: Unrecognized token type %s" type))
;; Return grant object.
grant)))
@@ -284,7 +284,7 @@ endpoint."
"Return as a string a number representing the expiry time of GRANT.
The time is in seconds since the epoch."
(let ((expiry (gethash "expires_on" grant)))
- (unless expiry (error "Did not find expiry time in grant"))
+ (unless expiry (error "url-http-oauth: Did not find expiry time in grant"))
expiry))
(defun url-http-oauth--refresh-token-string (grant)
@@ -327,13 +327,14 @@ The refresh token is an opaque string."
(url-build-query-string
(apply #'list
(let ((resource-url
- (cdr (assoc "resource-url" url-settings))))
+ (cdr (assoc "resource-url" url-settings)))
+ (error-message
+ "url-http-oauth: Failed to retrieve refresh token for %s"))
(list "refresh_token"
(or (plist-get
(url-http-oauth--auth-source-search resource-url)
:refresh-token)
- (error "Failed to retrieve refresh token for %s"
- resource-url))))
+ (error error-message resource-url))))
(list "client_id" client-identifier)
(list "grant_type" "refresh_token")
(list "resource" resource)
@@ -415,7 +416,6 @@ The entry is cleared from the `password-data' cache after
the
nil))))
1))))
(when prior-start-point
- (message "prior start point: %s" prior-start-point)
(goto-char prior-start-point)
(auth-source-netrc-parse-next-interesting)
(goto-char (pos-bol))
@@ -526,7 +526,7 @@ permissions that the caller is requesting."
(let ((bearer (url-http-oauth--get-bearer url)))
(if bearer
(concat "Bearer " bearer)
- (error "Bearer retrieval failed for %s" url)))))
+ (error "url-http-oauth: Bearer retrieval failed for %s" url)))))
;;; Register `url-oauth-auth' HTTP authentication method.
;;;###autoload
- [elpa] externals/url-http-oauth 9d5c820c90 14/24: Fix auth-source lookups, (continued)
- [elpa] externals/url-http-oauth 9d5c820c90 14/24: Fix auth-source lookups, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 972011f217 04/24: Shorten header line to fit into 80 columns, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 8719575647 10/24: Add scope argument to top-level interpose function, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 3b3f9fe53f 12/24: Support extra arguments on authorization URL, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 8601d89d43 18/24: Complete regexp, list and token refresh design, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth ee73bb0450 19/24: Make functions private, fix some bugs, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 7e825a8765 21/24: Allow per-provider user-agent interaction function, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 9b2af487e3 22/24: Use relative expiry time in seconds, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth d86dbb478d 23/24: Retest against sourcehut, fix new issues, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 4441b79a9a 13/24: Remove explicit extra argument handling, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 085d57961a 20/24: Make message formatting consistent,
Thomas Fitzsimmons <=
- [elpa] externals/url-http-oauth 0bf4a7633d 08/24: Complete confidential client support, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth b884e725af 05/24: Get basics working for Sourcehut, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 38157dfb3a 09/24: Reduce overloading of "register", Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth e1408ed406 02/24: Implement provider registration, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth f5b953197b 15/24: Fix auth-source-search for path and scope, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 40c46af10c 24/24: Bump version to 0.8.0, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth e95f685771 06/24: Begin auth-source implementation, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth 1ecb40b545 17/24: Make some adjustments based on testing, Thomas Fitzsimmons, 2023/05/08
- [elpa] externals/url-http-oauth fcb5929654 16/24: Fix auth-source lookup conflicts and config cdrs, Thomas Fitzsimmons, 2023/05/08