Skip to content

Commit

Permalink
fixup! crypto/spiffe: adds a multi trust anchor selector
Browse files Browse the repository at this point in the history
  • Loading branch information
lrascao committed Jan 29, 2025
1 parent e5dc547 commit 6a0e8a2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crypto/spiffe/trustanchors/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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
}

0 comments on commit 6a0e8a2

Please sign in to comment.