taldir

Directory service to resolve wallet mailboxes by messenger addresses
Log | Files | Refs | Submodules | README | LICENSE

validator.go (1407B)


      1 // This file is part of tdir, the Taler Directory implementation.
      2 // Copyright (C) 2025 Martin Schanzenbach
      3 //
      4 // Taldir is free software: you can redistribute it and/or modify it
      5 // under the terms of the GNU Affero General Public License as published
      6 // by the Free Software Foundation, either version 3 of the License,
      7 // or (at your option) any later version.
      8 //
      9 // Taldir is distributed in the hope that it will be useful, but
     10 // WITHOUT ANY WARRANTY; without even the implied warranty of
     11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12 // Affero General Public License for more details.
     13 //
     14 // You should have received a copy of the GNU Affero General Public License
     15 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
     16 //
     17 // SPDX-License-Identifier: AGPL3.0-or-later
     18 
     19 package taldir
     20 
     21 import (
     22 	"html/template"
     23 )
     24 
     25 type ValidatorType string
     26 
     27 const (
     28 	ValidatorTypeCommand ValidatorType = "command"
     29 	ValidatorTypeOIDC    ValidatorType = "oidc"
     30 )
     31 
     32 type Validator interface {
     33 
     34 	// Validator name
     35 	Name() string
     36 
     37 	// Validator type
     38 	Type() ValidatorType
     39 
     40 	// Amount of payment required
     41 	ChallengeFee() string
     42 
     43 	// registration/lookup page
     44 	LandingPageTpl() *template.Template
     45 
     46 	// Is alias valid
     47 	IsAliasValid(alias string) error
     48 
     49 	// Start registration
     50 	RegistrationStart(topic string, link string, message string, alias string, challenge string) (string, error)
     51 }