예제 #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
파일: hydra_auth.go 프로젝트: ndlib/disadis
// 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),
	}
}