GNU bug report logs - #79168
30.1; Proposed changes for oauth2

Previous Next

Package: emacs;

Reported by: Xiyue Deng <manphiz <at> gmail.com>

Date: Mon, 4 Aug 2025 00:00:01 UTC

Severity: normal

Found in version 30.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Full log


View this message in rfc822 format

From: Xiyue Deng <manphiz <at> gmail.com>
To: 79168 <at> debbugs.gnu.org
Cc: Xiyue Deng <manphiz <at> gmail.com>
Subject: bug#79168: [PATCH 04/11] Rename internal variables using consistent oauth2 prefix
Date: Fri,  8 Aug 2025 23:45:43 -0700
(Adapted from bug#52476 by Aleksandr Vityazev.)
* packages/oauth2/oauth2.el: Rename internal variables
oauth--url-advice and oauth--token-data to use oauth2 prefix.
---
 oauth2.el | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/oauth2.el b/oauth2.el
index eccf439130..ef82a64c5f 100644
--- a/oauth2.el
+++ b/oauth2.el
@@ -61,8 +61,8 @@
 (defvar oauth2-debug nil
   "Enable verbose logging in oauth2 to help debugging.")
 
-(defvar oauth--url-advice nil)
-(defvar oauth--token-data)
+(defvar oauth2--url-advice nil)
+(defvar oauth2--token-data)
 
 (defun oauth2--do-debug (&rest msg)
   "Output debug messages when `oauth2-debug' is enabled."
@@ -231,20 +231,20 @@ This allows to store the token in an unique way."
 
 (defun oauth2-extra-headers (extra-headers)
   "Return EXTRA-HEADERS with `Authorization: Bearer' added."
-  (cons (oauth2-authz-bearer-header (oauth2-token-access-token (car oauth--token-data)))
+  (cons (oauth2-authz-bearer-header (oauth2-token-access-token (car oauth2--token-data)))
         extra-headers))
 
 
 ;; FIXME: We should change URL so that this can be done without an advice.
 (defun oauth2--url-http-handle-authentication-hack (orig-fun &rest args)
-  (if (not oauth--url-advice)
+  (if (not oauth2--url-advice)
       (apply orig-fun args)
     (let ((url-request-method url-http-method)
           (url-request-data url-http-data)
           (url-request-extra-headers
            (oauth2-extra-headers url-http-extra-headers)))
-      (oauth2-refresh-access (car oauth--token-data))
-      (url-retrieve-internal (cdr oauth--token-data)
+      (oauth2-refresh-access (car oauth2--token-data))
+      (url-retrieve-internal (cdr oauth2--token-data)
                              url-callback-function
                              url-callback-arguments)
       ;; This is to make `url' think it's done.
@@ -257,8 +257,8 @@ This allows to store the token in an unique way."
 (defun oauth2-url-retrieve-synchronously (token url &optional request-method request-data request-extra-headers)
   "Retrieve an URL synchronously using TOKEN to access it.
 TOKEN can be obtained with `oauth2-auth'."
-  (let* ((oauth--token-data (cons token url)))
-    (let ((oauth--url-advice t)         ;Activate our advice.
+  (let* ((oauth2--token-data (cons token url)))
+    (let ((oauth2--url-advice t)         ;Activate our advice.
           (url-request-method request-method)
           (url-request-data request-data)
           (url-request-extra-headers
@@ -273,8 +273,8 @@ TOKEN can be obtained with `oauth2-auth'."
 TOKEN can be obtained with `oauth2-auth'.  CALLBACK gets called with CBARGS
 when finished.  See `url-retrieve'."
   ;; TODO add support for SILENT and INHIBIT-COOKIES.  How to handle this in `url-http-handle-authentication'.
-  (let* ((oauth--token-data (cons token url)))
-    (let ((oauth--url-advice t)         ;Activate our advice.
+  (let* ((oauth2--token-data (cons token url)))
+    (let ((oauth2--url-advice t)         ;Activate our advice.
           (url-request-method request-method)
           (url-request-data request-data)
           (url-request-extra-headers
-- 
2.39.5





This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.