wip: migrate to mono-repo. SPN has already been moved to spn/
This commit is contained in:
17
spn/hub/truststores.go
Normal file
17
spn/hub/truststores.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package hub
|
||||
|
||||
import "github.com/safing/jess"
|
||||
|
||||
// SingleTrustStore is a simple truststore that always returns the same Signet.
|
||||
type SingleTrustStore struct {
|
||||
Signet *jess.Signet
|
||||
}
|
||||
|
||||
// GetSignet implements the truststore interface.
|
||||
func (ts *SingleTrustStore) GetSignet(id string, recipient bool) (*jess.Signet, error) {
|
||||
if ts.Signet.ID != id || recipient != ts.Signet.Public {
|
||||
return nil, jess.ErrSignetNotFound
|
||||
}
|
||||
|
||||
return ts.Signet, nil
|
||||
}
|
||||
Reference in New Issue
Block a user