From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iM91CjaV7mVR6gAAqHPOHw:P1 (envelope-from ) for ; Mon, 11 Mar 2024 06:23:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id iM91CjaV7mVR6gAAqHPOHw (envelope-from ) for ; Mon, 11 Mar 2024 06:23:02 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; none 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 D574262A47 for ; Mon, 11 Mar 2024 06:23:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjY7N-0005QU-Mw; Mon, 11 Mar 2024 01:22:33 -0400 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 1rjY7J-0005Pn-JV for guix-patches@gnu.org; Mon, 11 Mar 2024 01:22:29 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjY7J-0006aH-Ai for guix-patches@gnu.org; Mon, 11 Mar 2024 01:22:29 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjY7q-0001OH-Up for guix-patches@gnu.org; Mon, 11 Mar 2024 01:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69719] [PATCH] services: radicale: Use define-configuration. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 Mar 2024 05:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69719 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Juliana Sims , 69719@debbugs.gnu.org Received: via spool by 69719-submit@debbugs.gnu.org id=B69719.17101345455272 (code B ref 69719); Mon, 11 Mar 2024 05:23:02 +0000 Received: (at 69719) by debbugs.gnu.org; 11 Mar 2024 05:22:25 +0000 Received: from localhost ([127.0.0.1]:38305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjY7F-0001My-0Q for submit@debbugs.gnu.org; Mon, 11 Mar 2024 01:22:25 -0400 Received: from mail-ej1-f67.google.com ([209.85.218.67]:50675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjY7C-0001Ml-Lr for 69719@debbugs.gnu.org; Mon, 11 Mar 2024 01:22:23 -0400 Received: by mail-ej1-f67.google.com with SMTP id a640c23a62f3a-a28a6cef709so378552666b.1 for <69719@debbugs.gnu.org>; Sun, 10 Mar 2024 22:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710134443; x=1710739243; darn=debbugs.gnu.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=+JMOwGNS2EggvEAZW7yo+7W5o4D0ayLnfNiMbzckFHE=; b=HqdqAT8xQfxpI1vSiA3t9mKKRebCFhOustMCkpVdVGGy2HV/x+7zWwFkFs8mxPN/cl GiNwuHT+HKCvpnpz80GX4QEHXhreJPOZNV1shrILlr8hdeh19Y/wBxhwDHWGZVwNly8a HUFNCEHYejgXyFStUnjZWyZ/m4aIaOKLAheMxomwreeT1ZnnG00MMZwt0VduRL3nWqrn kUCOErMKDDM2i+K+EoQ+j11U+rzn/RLxp0YXzMcQAdhPnNwatPaI5QOVXQWfGMb9fS1F RwUfr/8xv/Arq9E6G/jHOcsZG90YLZ1vue5XvlTig3pCDsyJKmRFiCLFtZ+WhHlxaUcL mfWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710134443; x=1710739243; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+JMOwGNS2EggvEAZW7yo+7W5o4D0ayLnfNiMbzckFHE=; b=Bo+6mY31A56h3KDop08EugkuVpzS6p8/+SyQtTY2niO8dhiQes2gIFCPiJlQiXl3bX ekI95bNWhDmRgxtkRfkNQFsU2fHsQtvjtI2clLceoDHoDhUIIytwE+CFGHaa2KhE671d mCBrdznnMQpNIvkFpf4mLI0vDQoDG/EUmu56ClOd/7y0CLC6+bfLgdq7Dmhp8Phb0rzL EKQ/1G2GSXH9x/C6Nw9KsMPrp31RmY4VFzCd9jV80GqJlnXL0IGXLleOkQ2+qjpYLjsd Wb0swNlz9UYxFKBoNiaumXChZ9GjqDAPzuZIHIbr5o5f6NY64KMKyYdaVzD0/FFMo5uM iSoA== X-Forwarded-Encrypted: i=1; AJvYcCWreD6eXD+potxoVAuWWFft3w6xvak5EHXxGTIF5W6P9FZ5DoJyJXLD7suwHUSdatxRHJbLL4GucoABWvKI8dOWAGOPT78= X-Gm-Message-State: AOJu0YzuRn+8rHgE4t7JyHAFw77t+uc0VW8t3bI0HmohrsffM7kJwZTs +Nw6LuTo7QPIsPVulhVPNayOvscwuoHxEaFC43FZKMjfBDOfUYMztucpX2ojq1A= X-Google-Smtp-Source: AGHT+IHdVuJxRZSifHUCg5TdMUvyDDTVa7iRcjejvBfhxjXsDh5Kcw0xEtHJBCq1+YjGiqsE+YD0Sg== X-Received: by 2002:a17:907:6d16:b0:a46:3097:3016 with SMTP id sa22-20020a1709076d1600b00a4630973016mr404082ejc.54.1710134442757; Sun, 10 Mar 2024 22:20:42 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id h15-20020a170906590f00b00a44a04aa3cfsm2501163ejq.225.2024.03.10.22.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 22:20:42 -0700 (PDT) Message-ID: <525f302593642aba838cb3ee966482794302cffb.camel@gmail.com> From: Liliana Marie Prikler Date: Mon, 11 Mar 2024 06:20:41 +0100 In-Reply-To: <17984bb7ca32629fed475db7e782acd90e538077.1710122683.git.juli@incana.org> References: <17984bb7ca32629fed475db7e782acd90e538077.1710122683.git.juli@incana.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.00 X-Spam-Score: -4.00 X-Migadu-Queue-Id: D574262A47 X-TUID: 68qpo0kp61NR Hi Juliana, Am Sonntag, dem 10.03.2024 um 22:04 -0400 schrieb Juliana Sims: > [...] >=20 > +(define (radicale-serialize-field field-name value) > +=C2=A0 ;; XXX We quote the un-gexp form here because otherwise symbol- > literals are > +=C2=A0 ;; treated as variables. We can get away with this because all of > our other > +=C2=A0 ;; field value types are primitives by the time they get here so > are printed > +=C2=A0 ;; the same whether or not they are quoted. > +=C2=A0 #~(format #f "~a =3D ~a\n" #$(uglify-field-name field-name) > '#$value)) You should not need to quote symbols here. > +(define (radicale-serialize-boolean field-name value?) > +=C2=A0 (radicale-serialize-field field-name (if value? "True" "False"))) > + > +(define (radicale-serialize-comma-separated-string-list field-name > value) > +=C2=A0 (radicale-serialize-field field-name (string-join value ", "))) > + > +(define radicale-serialize-file-name radicale-serialize-field) > + > +(define radicale-serialize-non-negative-integer radicale-serialize- > field) > + > +(define radicale-serialize-string radicale-serialize-field) > + > +(define radicale-serialize-symbol radicale-serialize-field) > + > +(define ((sanitize-delimited-symbols syms location field) value) > +=C2=A0 (cond > +=C2=A0=C2=A0 ((not (maybe-value-set? value)) > +=C2=A0=C2=A0=C2=A0 value) > +=C2=A0=C2=A0 ((member value syms) > +=C2=A0=C2=A0=C2=A0 (uglify-field-name value)) > +=C2=A0=C2=A0 (else > +=C2=A0=C2=A0=C2=A0 (configuration-field-error (source-properties->locati= on > location) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 field > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 value)))) > + > +;; Section configuration types > + > +(define-configuration radicale-auth-configuration > +=C2=A0 (type > +=C2=A0=C2=A0 maybe-symbol > +=C2=A0=C2=A0 "The method to verify usernames and passwords. Options are > @code{none}, > +@code{htpasswd}, @code{remote-user}, and @code{http-x-remote-user}. > + > +This value is tied to @code{htpasswd-filename} and @code{htpasswd- > encryption}." > +=C2=A0=C2=A0 (sanitizer > +=C2=A0=C2=A0=C2=A0 (sanitize-delimited-symbols '(none htpasswd remote-us= er http-x- > remote-user) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (current-source-location) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'type)) > +=C2=A0=C2=A0 (serializer radicale-serialize-field)) Note the mismatch between documented and stored type: Your type is "maybe-symbol", but you store strings. Instead, you can a) move the the logic to uglify the name to radicale-serialize-symbol or define a radicale-serialize-uglified-symbol variant if you need the normal radicale-serialize-symbol, or b) document that you actually take strings. Of course, you can also think of other solutions. Hint: I'd personally prefer solution a). Cheers