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: Sun, 07 May 2023 15:55:02 +0000 Message-ID: <87a5ygf86h.fsf@posteo.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31584"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Thomas Fitzsimmons Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 07 17:56:05 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 1pvgk1-00081p-6z for ged-emacs-devel@m.gmane-mx.org; Sun, 07 May 2023 17:56:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvgjG-00074F-WF; Sun, 07 May 2023 11:55:19 -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 1pvgjD-00073n-IG for emacs-devel@gnu.org; Sun, 07 May 2023 11:55:15 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvgj4-0002xA-Bg for emacs-devel@gnu.org; Sun, 07 May 2023 11:55:15 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 490A324012E for ; Sun, 7 May 2023 17:55:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1683474903; bh=loy0W+6K4Jm4yaamzlogpviUxBRhSZRtVcwQ4TIyZ6Y=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=q3hcmqGU9q5i/CHMFnQt/BeRPBNwt/9JT0gPh2E9a1h/ngmMyzNAPpmNF6ClZSSAX WfEtzKDTkOZTlc+6EfKw7FhOyydk5jZUK5glzTJEdos3n9tRq2G2Md66W0anss7xBB pU+aUpoEG2abI51P8UIxz3jTMaqH44VuEYSzK1zG3DZYMt83j7c8sa7Wc4V7d1FkKX YU68Rlwde7rYyMQWKfRMjDO14YhJ37lEWVlsxoFN8ztjlMIP5t70fNViWeXEuuzgRv D8vMZn8guWzVsQ8Sziicol8B4RCcF2vnBxRSU1+lH7wP1FsxC2XBu0S7Uy3FEzuDfM okVdDXHSr/hfQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QDpsL5Yf3z9rxB; Sun, 7 May 2023 17:55:02 +0200 (CEST) In-Reply-To: (Thomas Fitzsimmons's message of "Sat, 06 May 2023 01:07:16 -0400") 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.65; envelope-from=philipk@posteo.net; helo=mout01.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:305960 Archived-At: Thomas Fitzsimmons writes: > Hi, > > I would like to add one or two new packages to GNU ELPA. I have no objections to this, but I don't have any comments either. > 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. > > -- Philip Kaludercic