This repository has been archived on 2022-11-27. You can view files and clone it, but cannot push or open issues or pull requests.
activitypub/validation.go

23 lines
645 B
Go
Raw Permalink Normal View History

2019-01-22 13:53:54 +00:00
package activitypub
// ValidationErrors is an aggregated error interface that allows
// a Validator implementation to return all possible errors.
type ValidationErrors interface {
error
Errors() []error
Add(error)
}
// Validator is the interface that needs to be implemented by objects that
// provide a validation mechanism for incoming ActivityPub Objects or IRIs
// against an external set of rules.
type Validator interface {
Validate(receiver IRI, incoming Item) (bool, ValidationErrors)
2019-01-22 13:53:54 +00:00
}
func (v defaultValidator) Validate(receiver IRI, incoming Item) (bool, ValidationErrors) {
2019-01-22 13:53:54 +00:00
return true, nil
}
type defaultValidator struct{}