fixup! crypto/spiffe: adds a multi trust anchor selector

Signed-off-by: Luis Rascao <luis.rascao@gmail.com>
This commit is contained in:
Luis Rascao 2025-01-28 18:57:19 -08:00
parent e5dc547b39
commit dbff496f77
No known key found for this signature in database
GPG Key ID: 9F44FAF8AF67E4BC
1 changed files with 9 additions and 4 deletions

View File

@ -23,6 +23,11 @@ import (
"github.com/dapr/kit/concurrency"
)
var (
ErrNotImplemented = errors.New("not implemented")
ErrTrustDomainNotFound = errors.New("trust domain not found")
)
type OptionsMulti struct {
TrustAnchors map[spiffeid.TrustDomain]Interface
}
@ -50,8 +55,8 @@ func (m *multi) Run(ctx context.Context) error {
return r.Run(ctx)
}
func (m *multi) CurrentTrustAnchors(ctx context.Context) ([]byte, error) {
return nil, errors.New("not implemented")
func (m *multi) CurrentTrustAnchors(context.Context) ([]byte, error) {
return nil, ErrNotImplemented
}
func (m *multi) GetX509BundleForTrustDomain(td spiffeid.TrustDomain) (*x509bundle.Bundle, error) {
@ -61,9 +66,9 @@ func (m *multi) GetX509BundleForTrustDomain(td spiffeid.TrustDomain) (*x509bundl
}
}
return nil, errors.New("trust domain not found")
return nil, ErrTrustDomainNotFound
}
func (m *multi) Watch(ctx context.Context, ch chan<- []byte) {
func (m *multi) Watch(context.Context, chan<- []byte) {
return
}