GNU bug report logs - #40228
[oauth2.el] oauth2-auth-and-store: Add optional argument state

Previous Next

Package: emacs;

Reported by: Xu Chunyang <xuchunyang56 <at> gmail.com>

Date: Wed, 25 Mar 2020 20:29:02 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40228 in the body.
You can then email your comments to 40228 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#40228; Package emacs. (Wed, 25 Mar 2020 20:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Xu Chunyang <xuchunyang56 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 25 Mar 2020 20:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Xu Chunyang <xuchunyang56 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: julien <at> danjou.info
Subject: [oauth2.el] oauth2-auth-and-store: Add optional argument state
Date: Thu, 26 Mar 2020 04:28:25 +0800
Hi,

I'm using an API which requires state, but oauth2-auth-and-store
doesn't take one, hence this package, by the way, I changed
resource-url to scope, the former looks like a typo.

diff -u --label /Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
--label \#\<buffer\ oauth2.el\>
/Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
/var/folders/7f/s191h4q97p90374yw15ssrs00000gn/T/buffer-content-9fSeJ8
--- /Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
+++ #<buffer oauth2.el>
@@ -149,7 +149,7 @@
   (secure-hash 'md5 (concat auth-url token-url resource-url)))

 ;;;###autoload
-(defun oauth2-auth-and-store (auth-url token-url resource-url
client-id client-secret &optional redirect-uri)
+(defun oauth2-auth-and-store (auth-url token-url scope client-id
client-secret &optional redirect-uri state)
   "Request access to a resource and store it using `plstore'."
   ;; We store a MD5 sum of all URL
   (let* ((plstore (plstore-open oauth2-token-file))
@@ -167,7 +167,7 @@
                            :token-url token-url
                            :access-response (plist-get plist :access-response))
       (let ((token (oauth2-auth auth-url token-url
-                                client-id client-secret resource-url
nil redirect-uri)))
+                                client-id client-secret scope state
redirect-uri)))
         ;; Set the plstore
         (setf (oauth2-token-plstore token) plstore)
         (setf (oauth2-token-plstore-id token) id)

Diff finished.  Thu Mar 26 04:23:21 2020




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40228; Package emacs. (Wed, 25 Mar 2020 20:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 40228 <at> debbugs.gnu.org (full text, mbox):

From: Xu Chunyang <xuchunyang56 <at> gmail.com>
To: 40228 <at> debbugs.gnu.org
Subject: [oauth2.el] oauth2-auth-and-store: Add optional argument state
Date: Thu, 26 Mar 2020 04:32:06 +0800
Oops, I forget changing all resource-url, here is the updated patch.

diff -u --label /Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
--label \#\<buffer\ oauth2.el\>
/Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
/var/folders/7f/s191h4q97p90374yw15ssrs00000gn/T/buffer-content-3H8LwW
--- /Users/xcy/.emacs.d/elpa-27.0.90/oauth2-0.11/oauth2.el
+++ #<buffer oauth2.el>
@@ -149,11 +149,11 @@
   (secure-hash 'md5 (concat auth-url token-url resource-url)))

 ;;;###autoload
-(defun oauth2-auth-and-store (auth-url token-url resource-url
client-id client-secret &optional redirect-uri)
+(defun oauth2-auth-and-store (auth-url token-url scope client-id
client-secret &optional redirect-uri state)
   "Request access to a resource and store it using `plstore'."
   ;; We store a MD5 sum of all URL
   (let* ((plstore (plstore-open oauth2-token-file))
-         (id (oauth2-compute-id auth-url token-url resource-url))
+         (id (oauth2-compute-id auth-url token-url scope))
          (plist (cdr (plstore-get plstore id))))
     ;; Check if we found something matching this access
     (if plist
@@ -167,7 +167,7 @@
                            :token-url token-url
                            :access-response (plist-get plist :access-response))
       (let ((token (oauth2-auth auth-url token-url
-                                client-id client-secret resource-url
nil redirect-uri)))
+                                client-id client-secret scope state
redirect-uri)))
         ;; Set the plstore
         (setf (oauth2-token-plstore token) plstore)
         (setf (oauth2-token-plstore-id token) id)

Diff finished.  Thu Mar 26 04:31:13 2020




Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 15:09:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40228; Package emacs. (Thu, 01 Oct 2020 18:31:01 GMT) Full text and rfc822 format available.

Message #13 received at 40228 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Xu Chunyang <xuchunyang56 <at> gmail.com>
Cc: 40228 <at> debbugs.gnu.org
Subject: Re: bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional
 argument state
Date: Thu, 01 Oct 2020 20:30:41 +0200
Xu Chunyang <xuchunyang56 <at> gmail.com> writes:

> Oops, I forget changing all resource-url, here is the updated patch.

Looks like this was applied in 18a55dc8bd34328fa5b281b399d882bc82a1fba6,
so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 40228 <at> debbugs.gnu.org and Xu Chunyang <xuchunyang56 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 01 Oct 2020 18:31:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Oct 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 177 days ago.

Previous Next


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