From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yIC7MsWfgGFxsAAAgWs5BA (envelope-from ) for ; Tue, 02 Nov 2021 03:17:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6D5uLsWfgGFjfAAAB5/wlQ (envelope-from ) for ; Tue, 02 Nov 2021 02:17:41 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 21D4A31BC9 for ; Tue, 2 Nov 2021 03:17:41 +0100 (CET) Received: from localhost ([::1]:45550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhjMp-0006KR-3Y for larch@yhetil.org; Mon, 01 Nov 2021 22:17:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhjKq-0006Iw-Da for emacs-orgmode@gnu.org; Mon, 01 Nov 2021 22:15:41 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:35783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhjKo-0006Wb-AT for emacs-orgmode@gnu.org; Mon, 01 Nov 2021 22:15:36 -0400 Received: by mail-pl1-x62c.google.com with SMTP id b13so2215166plg.2 for ; Mon, 01 Nov 2021 19:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=r11FNVXh2UslpnRxtZyVBvOdz13Wec6ZDzT79PskzYs=; b=LWSkUkI7GL37eMK/QkA19A14zol+0nnEtnmc87tvZVQ8nh0ExgA3XBZmjyDZuCs2aj y14VvJVRR/haKw08ibo5HXLgsKiasHAOIfTAh0rYpHJ6KvojP8Ca0d23+aPkAp8qJ1jl OptoDMcVlRMOoVnEgswbN+8kVa8TTQtqKm2dU5IXbTS2UpOqL+wMM8t8+jW+rwxTejwu Fm2QOM9dUjvMJad31fS5UhMKzKFmBS/7o4cBmbuOQlN5gks2bbUTiEdTK/SQ8f0FNwSp I+ZYoYZ2U5kQxjMVFHIaZOvXDvGlVCEtSFgU5hQlFCPUTJJjer3t9xGxgGRG3WMd89e+ MFDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=r11FNVXh2UslpnRxtZyVBvOdz13Wec6ZDzT79PskzYs=; b=pmH6705Ngr9QOcDSEAcwSOddlLhe4HMx/8ilifDWYcAkbNEZlRuoQqAHNwifcdEfP2 MUlT/A+CulbaTrcRfGbepKSetfg7UAPLWNce8OBsKpO9GBlgETYjrMf3dMMXy0BtTWty zRo5d2YFiQrgrnyl4HU/QOOBHWNgB7EgjtpWGv2UvD9XIfj2nhAkrQ3Mk0/GmJIryYkf QWeioS+b9KXsdzFYlfkqCeeYz50bXd0FbRV+JB6EIKjrRitmG9iqqbg8wlp0zrMnhTwo qN5BuB3PhY9aZmAKi/aq6QfRK5J0aIKCAMPFkLS0IjlVvr4ADuzEf/7l4HRhKqaH07Tg Z/rA== X-Gm-Message-State: AOAM532UWHnsqD/JaPR4KsTI/Vd5zWhIUvkHxWS0OL2AHAEg5TjF9dY6 3CW6wZMS36o3eOKJBU6tROofsoGVABE= X-Google-Smtp-Source: ABdhPJx8uuCt9Pr60rqXd0hL1ilfEwx6mRIYDgy0Gb8Eur0jtRZhLCxFssPJqgq1IX/7MY8S7mbqVg== X-Received: by 2002:a17:902:e789:b0:140:801:1262 with SMTP id cp9-20020a170902e78900b0014008011262mr29048636plb.42.1635819329646; Mon, 01 Nov 2021 19:15:29 -0700 (PDT) Received: from [192.168.1.233] (125-238-170-116-vdsl.sparkbb.co.nz. [125.238.170.116]) by smtp.gmail.com with ESMTPSA id e7sm13874941pgk.90.2021.11.01.19.15.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Nov 2021 19:15:28 -0700 (PDT) Subject: Re: Storing database credentials outside an org file To: emacs-orgmode@gnu.org References: <87sfwg4jrr.fsf@gmail.com> From: Mike Gauland Message-ID: <3f63e0ad-9788-4169-5abf-36094eac053e@gmail.com> Date: Tue, 2 Nov 2021 15:15:25 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <87sfwg4jrr.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=mikelygee@gmail.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.14, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635819461; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=r11FNVXh2UslpnRxtZyVBvOdz13Wec6ZDzT79PskzYs=; b=R8iFUQZC1NGPhF/I4M94CGiEpFxv3F+SU+Jj1j7d4Qgj/3w+9dkcgRVvr/vVdM/uKfmfew kq3KgZ/7qVpp4CG9jK1NKHcUnPvy9kNZT3ByTnpyDLCJiDYKwEpKyibLX5zfDyvN3h77cu E5rooIUW3utEPs//Y7k92yTeDoRh/Tu4YA7yb9a/51r+aU1/Pg/FVPOChdnwpMAS1wnVF7 ac+E/mhf4RJ7HoZEUf6cTVEKtfvNxSri1TOQ8pbESxJPKQ7jecCHJhanpI/RLmfuo6drMx 1POUq4jlM3FwHAXw4rg0XZTX8DYegAiTEmbdfFwoWpUyZqIMxMFVInMs0sr0fA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635819461; a=rsa-sha256; cv=none; b=UjhoIIExpA+5ru4skcsrJdWWaLOkVUZ6Vkju1qDxoJ41gszUnR8HKGP1bIwsCpVjbX/QSV GbWJl1oFCGnTfT+c2ZazRrHNM/Jhwb+ImG7pNdkLDKy3vuXl6JzKCHh4N3rCDl7I7L+6y5 +1/ht/cnh5omWXs9QnVf3fDpBPBz5iDn2aSaATgMmaBQiGypPuAI5FNIIk5hDEi250mLN5 pET/gZJ8c8ch9Qx57amd+/e43U3MJ/PDD1xEhI3+0wQ0tZkC8MUzn7PceFOFu+uEObyYDM Gs4cK9ZAsmSO/pIv7bceJyuVkpo5WC62FlPFcR/hxuJwZ80jAsnqzwKUdu0zEg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LWSkUkI7; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LWSkUkI7; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 21D4A31BC9 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: wxRIH+EcoV9k On 1/11/21 4:33 pm, Tim Cross wrote: > Mike Gauland writes: > >> I often use an org file to record database queries, using sql source blocks. >> I've been putting the database credentials in the file using header-args:sql >> properties, but I'd prefer to have the credentials saved in a separate file for >> security reasons. >> >> Any ideas on how I could make this work? > It probably wouldn't be too hard to use the authinfo.gpg facility via > the auth-source library which is included in Emacs. In fact, I think > sql-mode might already have support for this built in. > Thanks for the suggestion. I didn't see it on worg, but in ob-sql.el I found support for ":dbconnection". I can set up an entry in sql-connection-alist, and give the name of the entry to the sql block via :dbconnection. Now, my password is safely out of the .org file. As a bonus, it is easier to maintain across different org files.