wip: migrate to mono-repo. SPN has already been moved to spn/

This commit is contained in:
Patrick Pacher
2024-03-15 11:55:13 +01:00
parent b30fd00ccf
commit 8579430db9
577 changed files with 35981 additions and 818 deletions

17
spn/hub/truststores.go Normal file
View 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
}