A golang webfinger server implementation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.1 KiB

  1. package webfinger
  2. // The Resolver is how the webfinger service looks up a user or resource. The resolver
  3. // must be provided by the developer using this package, as each webfinger
  4. // service may be exposing a different set or users or resources or services.
  5. type Resolver interface {
  6. // FindUser finds the user given the username and hostname.
  7. FindUser(username string, hostname, requestHost string, r []Rel) (*Resource, error)
  8. // DummyUser allows us to return a dummy user to avoid user-enumeration via webfinger 404s. This
  9. // can be done in the webfinger code itself but then it would be obvious which users are real
  10. // and which are not real via differences in how the implementation works vs how
  11. // the general webfinger code works. This does not match the webfinger specification
  12. // but is an extra precaution. Returning a NotFound error here will
  13. // keep the webfinger 404 behavior.
  14. DummyUser(username string, hostname string, r []Rel) (*Resource, error)
  15. // IsNotFoundError returns true if the given error is a not found error.
  16. IsNotFoundError(err error) bool
  17. }