From 54439113d2d2085b4cd520f064cdcee8c6631e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20R=C3=B3=C5=BCa=C5=84ski?= Date: Wed, 13 Nov 2024 21:39:12 +0100 Subject: [PATCH] don't return certifier info if it is not configured --- registration/config.go | 2 +- rpc/rpcserver.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/registration/config.go b/registration/config.go index fbbb835c..0dc77222 100644 --- a/registration/config.go +++ b/registration/config.go @@ -24,7 +24,7 @@ type Config struct { MaxSubmitBatchSize int `long:"max-submit-batch-size" description:"The maximum number of challenges to submit in a single batch"` SubmitFlushInterval time.Duration `long:"submit-flush-interval" description:"The interval between flushes of the submit queue"` - Certifier *CertifierConfig + Certifier *CertifierConfig `no-flag:"disabled parsing by go-flags because it initializes the pointer"` } type Base64Enc []byte diff --git a/rpc/rpcserver.go b/rpc/rpcserver.go index 38606d61..944a1a9b 100644 --- a/rpc/rpcserver.go +++ b/rpc/rpcserver.go @@ -129,7 +129,8 @@ func (r *rpcServer) Submit(ctx context.Context, in *api.SubmitRequest) (*api.Sub func (r *rpcServer) Info(_ context.Context, _ *api.InfoRequest) (*api.InfoResponse, error) { var certifierResp *api.InfoResponse_Cerifier - if certifier := r.registration.CertifierInfo(); certifier != nil { + certifier := r.registration.CertifierInfo() + if certifier != nil && len(certifier.URL) > 0 { certifierResp = &api.InfoResponse_Cerifier{ Url: certifier.URL, Pubkey: certifier.PubKey,