Skip to content

Commit 6a0e8a2

Browse files
committed
fixup! crypto/spiffe: adds a multi trust anchor selector
1 parent e5dc547 commit 6a0e8a2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

crypto/spiffe/trustanchors/multi.go

+9-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import (
2323
"github.com/dapr/kit/concurrency"
2424
)
2525

26+
var (
27+
ErrNotImplemented = errors.New("not implemented")
28+
ErrTrustDomainNotFound = errors.New("trust domain not found")
29+
)
30+
2631
type OptionsMulti struct {
2732
TrustAnchors map[spiffeid.TrustDomain]Interface
2833
}
@@ -50,8 +55,8 @@ func (m *multi) Run(ctx context.Context) error {
5055
return r.Run(ctx)
5156
}
5257

53-
func (m *multi) CurrentTrustAnchors(ctx context.Context) ([]byte, error) {
54-
return nil, errors.New("not implemented")
58+
func (m *multi) CurrentTrustAnchors(context.Context) ([]byte, error) {
59+
return nil, ErrNotImplemented
5560
}
5661

5762
func (m *multi) GetX509BundleForTrustDomain(td spiffeid.TrustDomain) (*x509bundle.Bundle, error) {
@@ -61,9 +66,9 @@ func (m *multi) GetX509BundleForTrustDomain(td spiffeid.TrustDomain) (*x509bundl
6166
}
6267
}
6368

64-
return nil, errors.New("trust domain not found")
69+
return nil, ErrTrustDomainNotFound
6570
}
6671

67-
func (m *multi) Watch(ctx context.Context, ch chan<- []byte) {
72+
func (m *multi) Watch(context.Context, chan<- []byte) {
6873
return
6974
}

0 commit comments

Comments
 (0)