Validate the princpal and current domains in lookup

This patch includes a copy of the `validateAuthority` function introduced in #10 and so it will need to be refactored once/if both of these patches are merged.