Пример #1
0
// NewPubtktAuth creates a pubtkt authorization from an arbitrary data buffer.
// It is suggested to use NewPubtktAuthFromKeyFile.
func NewPubtktAuth(publicKey interface{}) *PubtktAuth {
	return &PubtktAuth{
		publicKey: publicKey,
		cache:     timecache.New(100, 24*time.Hour),
	}
}
Пример #2
0
// NewHydraAuth makes a new HydraAuth using the given fedoraPath
// and object namespace. The namespace is prefixed to any objects identifiers
// before lookup in Fedora.
func NewHydraAuth(fedoraPath, namespace string) *HydraAuth {
	return &HydraAuth{
		fedora: fedora.NewRemote(fedoraPath, namespace),
		cache:  timecache.New(250, 5*time.Minute),
	}
}