notary

command module
v0.0.0-...-96398ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2016 License: MIT Imports: 1 Imported by: 0

README

Notary


Build Status codecov GoDoc MIT licensed

An HTTP REST endpoint service reporting whether a POSTed JSON object containing an email is valid.

Validation is against RFC53223.2.3 and §3.4.1).

  • Notable differences:
    • Obsolete address formats are not parsed, including addresses with embedded route information.
    • Group addresses are not parsed.
    • The full range of spacing (the CFWS syntax element) is not supported, such as breaking addresses across lines.
Input:
  • Only POST method is supported to route /email
    • Any other routes will return a 404 page not found error.
  • Header Content-Type must be application/json.
    • All other types will return a 400 Bad Request error.
  • JSON Object: {"email": "jacob@gmail.com"}.
    • May contain more fields, but only email is parsed.
    • Email must be a string value.
Output:
  • JSON response in Body: {"StatusCode": int, Msg: "string"}
    • Response Codes:
      1. 404 page not found when the HTTP route is not /email.
      2. 403 Forbidden if the HTTP request method is not POST.
      3. 400 Bad Request if the Content-Type header is not application/json, JSON POSTed is invalid, JSON POSTed is missing an email key, or if the email address is invalid.
      4. 200 OK only when all conditions have been met (POST /email with JSON: { "email": "validRFC5322Email" }).
  • HTTP Header Status-Line contains the same HTTP Status Code as the JSON returned.
Defaults
  • notary listens on port 9000.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL