From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: New package for NonGNU ELPA : totp-auth Date: Wed, 7 Feb 2024 09:46:43 +0300 Message-ID: References: <47974953-df92-4d26-a3d6-271a7d6003b7@etla.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22114"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.10+64 (b470a9a) (2023-06-05) Cc: Vivek Das Mohapatra , emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 08 07:25:09 2024 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 1rXxqP-0005WW-C2 for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Feb 2024 07:25:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXxpk-0003Qz-VH; Thu, 08 Feb 2024 01:24:29 -0500 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 1rXxpi-0003Qm-PH for emacs-devel@gnu.org; Thu, 08 Feb 2024 01:24:26 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXxpe-0002X6-Hi; Thu, 08 Feb 2024 01:24:26 -0500 Original-Received: from localhost ([::ffff:41.75.172.87]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000010B8A0.0000000065C47370.0000398B; Wed, 07 Feb 2024 23:23:44 -0700 Mail-Followup-To: Richard Stallman , Vivek Das Mohapatra , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:316018 Archived-At: * Richard Stallman [2024-02-07 06:17]: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > This is a useful feature, but should it be implemented as a part of > Emacs? Is there / should there be a shell command for this? > > Given a shell command for this, do we want it implemented in Emacs > too? I have implemented it this way below, and it works well now for long time already. It uses the external shell command. I would rather use Emacs Lisp for it. It is required at many logins. I did not show more than 3 logins below, and they are also fake keys. (defvar oath-keys '(digitalocean "31CHLCURYJ5VRDHB" tether "J2AMLDF473VHD517" twilio "EB1JS6TJNL1TQCWSNEZJG6IQ4XZGSC4UMI276X3TEODG2VQRTE5A") (defun call-process-to-string (program &optional infile display &rest args) (with-temp-buffer (apply #'call-process program infile t display args) (buffer-string))) (defun oath () "Ask for service and kill OATH result to memory." (interactive) (let* ((key (rcd-choose (map-keys oath-keys) "OATH Service: ")) (result (call-process-to-string "oathtool" nil nil "-b" "--totp=sha1" (plist-get oath-keys (intern key)))) (result (string-trim result))) (message result) (kill-new result))) Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/