From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [GNU ELPA] New package: url-http-oauth Date: Mon, 08 May 2023 10:30:17 +0000 Message-ID: <877ctjjeti.fsf@posteo.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21327"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thomas Fitzsimmons , emacs-devel To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 08 12:31:18 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvy9G-0005Ny-2S for ged-emacs-devel@m.gmane-mx.org; Mon, 08 May 2023 12:31:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvy8c-0002EV-4B; Mon, 08 May 2023 06:30:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvy8R-0002Dn-1Q for emacs-devel@gnu.org; Mon, 08 May 2023 06:30:28 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvy8M-0003Gi-B5 for emacs-devel@gnu.org; Mon, 08 May 2023 06:30:26 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E80E424023B for ; Mon, 8 May 2023 12:30:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1683541818; bh=sKqn1SSFBCmgh9jVZ1YKMRvmc8VJVtrl+YX55hT+Cy0=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=fHKA6UggNiSy/v4ZnfePdu5V++ZLSOFXoPcUtpO4Q0j/PW68aw95pomHZv1Cfm+LT U1qROfhN81gCH7rToqY0wtXxxrKjfoRHklxxgYrajtlUjX/FdpiQzQSnTsekYsCWqP T36hUrvJ0/F0wOpeAMBGIjz79B3J6gOoTXz+8JEwBbah+qmxClKXNvI2y/nJQvdSwg ETkL6UPJmDIdlby6mwVdZysE+Z/lSyhK23Affsz81sY/eP6xA0HBZOuvixucY0u5ll c7jV9V67YmLOWnD5asqBNJdGpvkEb6dYnttRq1p/bJM40az36zGzlHbnSxor9N0R37 3B7kj5Svc/dPw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QFHcB30slz6tvd; Mon, 8 May 2023 12:30:18 +0200 (CEST) In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Mon, 8 May 2023 08:50:06 +0100") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305972 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > I think packages such as this one are very welcome, and I appreciate the > UI-agnostic architecture you describe. > > Url.el itself, last i looked, seemed a bit outdated and hard to work with. > Are there other http client libraries for Emacs? Could they also take > advantage of your new library? Adam Porter recently wrote a library called "plz" which was added to GNU ELPA: http://elpa.gnu.org/packages/plz.html > Jo=C3=A3o > > On Sat, May 6, 2023, 06:07 Thomas Fitzsimmons wrote: > >> Hi, >> >> I would like to add one or two new packages to GNU ELPA. >> >> The main one is url-http-oauth, which adds OAuth 2.0 support to the URL >> library, via "url-auth" hooks, like url-http-basic, url-http-digest and >> url-http-ntlm. It provides auth-source integration for secrets, using >> the netrc backend. >> >> https://git.sr.ht/~fitzsim/url-http-oauth >> >> This package is unrelated to oauth2.el in GNU ELPA, which provides new >> oauth2-url-retrieve and oauth2-url-retrieve-synchronously functions, and >> has plstore instead of auth-source integration. For Excorporate, I >> needed something that would work with the built-in url-retrieve >> functions and I couldn't see how to do that with oauth2.el. I haven't >> tested, but I see no reason that the two packages would interfere with >> one another. >> >> For the next release of Excorporate I want to depend on url-http-oauth >> to fix the longstanding bug#50113, "Excorporate: Communicating with >> domain that requires SSO?". I have the changes ready; I am using them >> daily. >> >> The OAuth 2.0 standard encodes the use of a user-agent (i.e., web >> browser) for authorization steps which differ per OAuth 2.0 provider, >> and are not defined by the specification. I have provided support for >> package authors and users to write custom functions to automate these >> web browser interactions in arbitrary ways: >> >> AUTHORIZATION-CODE-FUNCTION is an elisp function that takes an >> authorization URL as a string argument, and returns, as a string, a >> full URL containing a code value in its query string. >> >> By default though, url-http-oauth will prompt the user to copy-n-paste >> URLs to and from the web browser. This is the most general default I >> could think of; for example, this allows performing authorization in a >> local web browser then pasting the result to an Emacs session running >> three SSH hops away, where `browse-url' may not do the right thing. >> >> Users and package authors can design automatic user-agent interactions, >> but those ways are so varied that I wanted to see how they would evolve. >> For example, I would like to see someone write an >> authorization-code-function for Sourcehut that would use EWW inline. >> For other OAuth 2.0 providers whose authorization steps require >> JavaScript, EWW would not work. >> >> I have published another, tiny package: >> >> https://git.sr.ht/~fitzsim/url-http-oauth-demo >> >> It demonstrates the use of url-http-oauth against the Emacs-friendliest >> OAuth 2.0 implementation I've found: Sourcehut. Sourcehut's >> implementation is entirely Free Software, and it does not require >> JavaScript in the authorization steps. Its client registration process >> does not have onerous terms of use. Any Sourcehut user should be able >> to get url-http-oauth-demo working. Maybe this package makes sense in >> GNU ELPA, or perhaps it could be part of url-http-oauth's documentation. >> >> I wrote these packages myself [1] and I have copyright assignment >> paperwork on file. >> >> Thomas >> >> 1. Except url-http-oauth--netrc-delete, which borrows lots of code from >> auth-source.el. >> >>