unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional argument state
@ 2020-03-25 20:28 Xu Chunyang
  2020-03-25 20:32 ` Xu Chunyang
  0 siblings, 1 reply; 3+ messages in thread
From: Xu Chunyang @ 2020-03-25 20:28 UTC (permalink / raw)
  To: 40228; +Cc: julien

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional argument state
  2020-03-25 20:28 bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional argument state Xu Chunyang
@ 2020-03-25 20:32 ` Xu Chunyang
  2020-10-01 18:30   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Xu Chunyang @ 2020-03-25 20:32 UTC (permalink / raw)
  To: 40228

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional argument state
  2020-03-25 20:32 ` Xu Chunyang
@ 2020-10-01 18:30   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-01 18:30 UTC (permalink / raw)
  To: Xu Chunyang; +Cc: 40228

Xu Chunyang <xuchunyang56@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-01 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-25 20:28 bug#40228: [oauth2.el] oauth2-auth-and-store: Add optional argument state Xu Chunyang
2020-03-25 20:32 ` Xu Chunyang
2020-10-01 18:30   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).