gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taldir] branch master updated: add validator type


From: gnunet
Subject: [taldir] branch master updated: add validator type
Date: Tue, 14 Jan 2025 16:14:14 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository taldir.

The following commit(s) were added to refs/heads/master by this push:
     new 27619bd  add validator type
27619bd is described below

commit 27619bd7049a7757cf6ef7a3ae84c20b1254a4f1
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Jan 14 16:14:06 2025 +0100

    add validator type
---
 pkg/rest/taldir.go | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go
index 1543941..41194b3 100644
--- a/pkg/rest/taldir.go
+++ b/pkg/rest/taldir.go
@@ -114,11 +114,21 @@ type Taldir struct {
        I18n *i18n.I18n
 }
 
+type ValidatorType string
+
+const (
+       ValidatorTypeCommand ValidatorType = "command"
+       ValidatorTypeOIDC    ValidatorType = "oidc"
+)
+
 type Validator struct {
 
-       // Amount of payment required
+       // Validator name
        Name string
 
+       // Validator type
+       Type ValidatorType
+
        // Amount of payment required
        ChallengeFee string
 
@@ -788,8 +798,8 @@ func (t *Taldir) Initialize(cfgfile string, version string) 
{
                if !strings.HasPrefix(sec.Name(), "taldir-validator-") {
                        continue
                }
-               if !sec.HasKey("enabled") {
-                       log.Printf("`enabled` key in section `[%s]` not found, 
disabling validator.\n", sec.Name())
+               if !sec.HasKey("type") {
+                       log.Printf("`type` key in section `[%s]` not found, 
disabling validator.\n", sec.Name())
                        continue
                }
                vname := strings.TrimPrefix(sec.Name(), "taldir-validator-")
@@ -805,6 +815,7 @@ func (t *Taldir) Initialize(cfgfile string, version string) 
{
                        ChallengeFee: 
sec.Key("challenge_fee").MustString("KUDOS:0"),
                        PaymentRequired: sec.Key("enabled").MustBool(false),
                        Command: sec.Key("command").MustString(""),
+                       Type: ValidatorType(sec.Key("type").MustString("")),
                }
        }
        t.ChallengeBytes = 
t.Cfg.Section("taldir").Key("challenge_bytes").MustInt(16)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]