Validate Authority Documentation

Shared Validate Throttle: 500/Hour

Object: Authority

Authority is a Hierarchical Component that contains UserInfo, URI Host and Port.

print
Object: Print

Example

"print": {
	"uri": "user:@juandefu.ca:80",
	"iri": "user:@juandefu.ca:80"
}
encoding
Object: Encoding
Encoding only contains information about whether or not a Port was encoded.
For other Encoding information use Child fields.

Example

"encoding": {}
userinfo
Object: UserInfo

Example

"userinfo": {
	"print": {
		"uri": "user",
		"iri": "user"
	},
	"username": {
		"print": {
			"opaque": [
				"user"
			]
		},
		"encoding": {},
		"correct": true
	},
	"password": {
		"print": {
			"opaque": [
				"pass"
			]
		},
		"encoding": {},
		"correct": true
	},
	"confidential": true,
	"correct": true
}
host
Object: URI Host

Example

"host": {
	"encoding": {},
	"host": {
		"print": {
			"unicode": "juandefu.ca",
			"unicode-email": "juandefu.ca",
			"idna": "juandefu.ca"
		},
		"hostname": {
			"print": {
				"unicode": "juandefu.ca",
				"idna": "juandefu.ca",
				"percent-encoded": "juandefu.ca"
			},
			"labels": [
				{
					"print": {
						"unicode": "juandefu"
					},
					"encoding": {},
					"delimiter": 1,
					"correct": true
				},
				{
					"print": {
						"unicode": "ca"
					},
					"encoding": {},
					"correct": true
				}
			],
			"correct": true,
			"correct-email": true,
			"tld-real": true,
			"tld-pos": 1
		},
		"correct": true,
		"correct-email": true
	},
	"correct": true
}
port
Object: Port

Example

"port": {
	"port": 80,
	"correct": true
}
dangerous
Boolean
Is this Potentially Dangerous?

Example

"dangerous": false
correct
Boolean
Was Input Correct to the Spec?

Example

"correct": true

Object Examples: Authority

UserInfo@Hostname
"user:pass@juandefu.ca"
{
	"print": {
		"uri": "user@juandefu.ca",
		"iri": "user@juandefu.ca"
	},
	"encoding": {},
	"userinfo": {
		"print": {
			"uri": "user",
			"iri": "user"
		},
		"username": {
			"print": {
				"opaque": [
					"user"
				]
			},
			"encoding": {},
			"correct": true
		},
		"password": {
			"print": {
				"opaque": [
					"pass"
				]
			},
			"encoding": {},
			"correct": true
		},
		"confidential": true,
		"correct": true
	},
	"host": {
		"encoding": {},
		"host": {
			"print": {
				"unicode": "juandefu.ca",
				"unicode-email": "juandefu.ca",
				"idna": "juandefu.ca"
			},
			"hostname": {
				"print": {
					"unicode": "juandefu.ca",
					"idna": "juandefu.ca",
					"percent-encoded": "juandefu.ca"
				},
				"labels": [
					{
						"print": {
							"unicode": "juandefu"
						},
						"encoding": {},
						"delimiter": 1,
						"correct": true
					},
					{
						"print": {
							"unicode": "ca"
						},
						"encoding": {},
						"correct": true
					}
				],
				"correct": true,
				"correct-email": true,
				"tld-real": true,
				"tld-pos": 1
			},
			"correct": true,
			"correct-email": true
		},
		"correct": true
	},
	"correct": true
}
UserInfo@Hostname:Encoded Port:
"user:@juandefu.ca:%38%30"
{
	"print": {
		"uri": "user:@juandefu.ca:80",
		"iri": "user:@juandefu.ca:80"
	},
	"encoding": {
		"port": true
	},
	"userinfo": {
		"print": {
			"uri": "user:",
			"iri": "user:"
		},
		"username": {
			"print": {
				"opaque": [
					"user"
				]
			},
			"encoding": {},
			"correct": true
		},
		"password": {
			"print": {},
			"encoding": {},
			"correct": true
		},
		"confidential": true,
		"correct": true
	},
	"host": {
		"encoding": {},
		"host": {
			"print": {
				"unicode": "juandefu.ca",
				"unicode-email": "juandefu.ca",
				"idna": "juandefu.ca"
			},
			"hostname": {
				"print": {
					"unicode": "juandefu.ca",
					"idna": "juandefu.ca",
					"percent-encoded": "juandefu.ca"
				},
				"labels": [
					{
						"print": {
							"unicode": "juandefu"
						},
						"encoding": {},
						"delimiter": 1,
						"correct": true
					},
					{
						"print": {
							"unicode": "ca"
						},
						"encoding": {},
						"correct": true
					}
				],
				"correct": true,
				"correct-email": true,
				"tld-real": true,
				"tld-pos": 1
			},
			"correct": true,
			"correct-email": true
		},
		"correct": true
	},
	"port": {
		"port": 80,
		"correct": true
	}
}

Object: Authority_Options

POST APIs only support setting Options. Attributes are displayed when set to true.
GET APIs return the Default set Options.
print
Object: Print_Options
encoding
Object: Encoding_Options
userinfo
Object: UserInfo_Options
host
Object: URI_Host_Options
port
Boolean
dangerous
Boolean
correct
Boolean

Object Examples: Authority_Options

Default Options:
{
	"print": {
		"uri": true,
		"iri": true,
		"ignore-ports": null
	},
	"encoding": {
		"port": true
	},
	"userinfo": {
		"print": {
			"uri": true,
			"iri": true
		},
		"username": {
			"print": {
				"opaque": true,
				"uri": false,
				"iri": false
			},
			"encoding": {
				"cleaned": true,
				"unicode": true,
				"pe-necessary": true,
				"pe-unnecessary": true,
				"pe-partial": true,
				"pe-invalid": true
			},
			"correct": true
		},
		"password": {
			"print": {
				"opaque": true,
				"uri": false,
				"iri": false
			},
			"encoding": {
				"cleaned": true,
				"unicode": true,
				"pe-necessary": true,
				"pe-unnecessary": true,
				"pe-partial": true,
				"pe-invalid": true
			},
			"correct": true
		},
		"confidential": true,
		"correct": true
	},
	"host": {
		"encoding": {
			"ip": true,
			"prefix": true
		},
		"host": {
			"print": {
				"unicode": true,
				"unicode-email": true,
				"idna": true,
				"idna-email": false,
				"percent-encoded": false
			},
			"literal": true,
			"zoneid": {
				"print": {
					"uri": true,
					"iri": true
				},
				"encoding": {
					"cleaned": true,
					"unicode": true,
					"pe-necessary": true,
					"pe-unnecessary": true,
					"pe-partial": true,
					"pe-invalid": true
				},
				"zoneid": true,
				"correct": true
			},
			"ip": {
				"print": {
					"parsed": false,
					"ipv4": true,
					"ipv4historic": false,
					"ipv6short": true,
					"ipv6v4short": true,
					"ipv6long": true,
					"ipv6v4long": false
				},
				"blocks": {
					"print": null,
					"size": true,
					"base": true,
					"number": true,
					"pads": true,
					"correct": true,
					"position": true
				},
				"bytes": true,
				"version": true,
				"doublecolon-v6": true,
				"doublecolon-v6v4": true,
				"correct": true,
				"private": false,
				"loopback": false,
				"linklocal": false,
				"reserved": false
			},
			"ipvfuture": true,
			"hostname": {
				"print": {
					"unicode": true,
					"idna": true,
					"percent-encoded": true
				},
				"labels": {
					"print": {
						"unicode": true,
						"idna": false,
						"percent-encoded": false
					},
					"encoding": {
						"cleaned": true,
						"unicode": true,
						"pe-necessary": true,
						"pe-unnecessary": true,
						"pe-partial": true,
						"idna": true,
						"idna-invalid": true,
						"idna-normalized": true,
						"idna-normalize-failed": true,
						"idna-excluded": true
					},
					"delimiter": true,
					"correct": true
				},
				"email-toolong": true,
				"dangerous": true,
				"correct": true,
				"correct-email": true,
				"tld": true,
				"tld-invalid": true,
				"tld-real": true,
				"tld-root": true,
				"tld-pos": true
			},
			"dangerous": true,
			"correct": true,
			"correct-email": true
		},
		"registeredname": {
			"print": {
				"opaque": true,
				"uri": true,
				"iri": true
			},
			"encoding": {
				"cleaned": true,
				"unicode": true,
				"pe-necessary": true,
				"pe-unnecessary": true,
				"pe-partial": true,
				"pe-invalid": true
			},
			"correct": true
		},
		"dangerous": true,
		"correct": true
	},
	"port": true,
	"dangerous": true,
	"correct": true
}

Object: Print

uri
String
URI Output

Unicode and Unsafe ASCII Characters are Percent Encoded

Example

"uri": "ascii"
"uri": "%25" // ascii % character
"uri": "%F0%9F%98%BB" // 😻
iri
String
IRI Output

Unicode is Unencoded, Unsafe ASCII Characters are Percent Encoded

Example

"iri": "unicode"
"iri": "%25" // ascii % character
"iri": "😻"
ignore-ports
String
Ports that will NOT be printed!

Example

"ignore-ports": [
	0,
	80,
	443
]

Object Examples: Print

Hostname Input: "juandefu.ca"
{
	"uri": "juandefu.ca",
	"iri": "juandefu.ca"
}
Hostname:Port Input: "juandefu.ca:80"
{
	"uri": "juandefu.ca:80",
	"iri": "juandefu.ca:80"
}
Hostname:Port Ignored Input:"juandefu.ca:80"
{
	"uri": "juandefu.ca",
	"iri": "juandefu.ca",
	"ignore-ports": [
		80
	]
}

Object: Print_Options

POST APIs only support setting Options. Attributes are displayed when set to true.
GET APIs return the Default set Options.
uri
Boolean
iri
Boolean
ignore-ports
[]Number
By Default no Ports are ignored, not even 0. Ports by Default are only ignored in the context of a URI.


Object: Encoding

port
Boolean
Was the Port incorrectly Percent Encoded?

Example

"port": true

Object Examples: Encoding

Encoded Port Input: "juandefu.ca:%38%30"
{
	"print": {
		"uri": "juandefu.ca:80",
		"iri": "juandefu.ca:80"
	},
	"encoding": {
		"port": true
	},
	"host": {
		"encoding": {},
		"host": {
			"print": {
				"unicode": "juandefu.ca",
				"unicode-email": "juandefu.ca",
				"idna": "juandefu.ca"
			},
			"hostname": {
				"print": {
					"unicode": "juandefu.ca",
					"idna": "juandefu.ca",
					"percent-encoded": "juandefu.ca"
				},
				"labels": [
					{
						"print": {
							"unicode": "juandefu"
						},
						"encoding": {},
						"delimiter": 1,
						"correct": true
					},
					{
						"print": {
							"unicode": "ca"
						},
						"encoding": {},
						"correct": true
					}
				],
				"correct": true,
				"correct-email": true,
				"tld-real": true,
				"tld-pos": 1
			},
			"correct": true,
			"correct-email": true
		},
		"correct": true
	},
	"port": {
		"port": 80,
		"correct": true
	}
}

Object: Encoding_Options

POST APIs only support setting Options. Attributes are displayed when set to true.
GET APIs return the Default set Options.
port
Boolean

POST /api;v1.0/validate/uri/authority

JSON POST endpoint. Supports Validator Options!

Request

Parameters

raw
String
Raw Input to Validate

Example

"raw": "http://juandefu.ca/"
validator
Number
Optional
Method of Validation to use.
STRICT Validation will not allow Incorrect Spec Validation to occur! It's recommended to use LOOSE!
LOOSE_ASIS assumes percent encoding DOES NOT EXIST and any percent characters will be encoded!

The Default/Invalid Validator is LOOSE

Constants

Key Value
STRICT 1
LOOSE 2
LOOSE_ASIS 3


Example

"validator": 0
options
Object: Authority_Options
Optional
Validator Options
Default Options will be used when nil

shorten
Boolean
Optional
Shorten Validated Object
Shortened Object may include other URI Compments needed to create a Valid URI Object
Validated must be Valid and Shorten must not be Throttled!

Example

"shorten": true
shorten-private
Boolean
Optional
If this is set you will only be able to access the Shortened Link with a Private Key!
Private is a very large Random Integer up to 2^64 (18,446,744,073,709,551,615) and should be very hard to brute force!
DO NOT RELY SOLEY ON THIS FOR SECURITY!

Example

"private": true

Response

errors
[]String
This is only returned on Internal Errors! Always check the Response Header Content-Type before parsing!

Example

"errors": [
	"internal server error"
]
shortened
Object: Shortened
If Validated is Throttled or an error occurs Shortened will be ignored!

validated
Object: Authority
Always returned!

If Throttled, returns an Object containing the Attribute "throttle" with a value of the Throttle Expiration Timestamp RFC 3339


GET /api;v1.0/validate/uri/authority

GET endpoint that only uses Query String Parameters. Supports JSONP!
Content must be properly encoded to fit within the Query String Field Variable "raw"!

Request

Parameters

raw
String
Raw Input to Validate

Example

"raw": "http://juandefu.ca/"
validator
Number
Optional
Method of Validation to use.
STRICT Validation will not allow Incorrect Spec Validation to occur! It's recommended to use LOOSE!
LOOSE_ASIS assumes percent encoding DOES NOT EXIST and any percent characters will be encoded!

The Default/Invalid Validator is LOOSE

Constants

Key Value
STRICT 1
LOOSE 2
LOOSE_ASIS 3


Example

validator=2
shorten
Exists
Optional
Shorten Validated Object
Shortened Object may include other URI Compments needed to create a Valid URI Object
Validated must be Valid and Shorten must not be Throttled!

shorten-private
Exists
Optional
If this is set you will only be able to access the Shortened Link with a Private Key!
Private is a very large Random Integer up to 2^64 (18,446,744,073,709,551,615) and should be very hard to brute force!
DO NOT RELY SOLEY ON THIS FOR SECURITY!

jsonp
String
Optional
JSONP will be used to pad the JSON payload with a Function.
Must be a-zA-Z and 15 characters or less.
If JSONP is set and is empty or invalid "ZeroOut" will be used!

Example

jsonp=Whoa
Whoa({});
pd
Exists
Optional
Should Input be Percent Decoded before being passed to the Validator?
Most Validators will do their own Percent Decoding of Input.
This should only be used if necessary or if the Validator does not support Percent Decoding.

Response

errors
[]String
This is only returned on Internal Errors! Always check the Response Header Content-Type before parsing!

Example

"errors": [
	"internal server error"
]
shortened
Object: Shortened
If Validated is Throttled or an error occurs Shortened will be ignored!

validated
Object: Authority
Always returned!

If Throttled, returns an Object containing the Attribute "throttle" with a value of the Throttle Expiration Timestamp RFC 3339


GET /api;v1.0/validate/uri/authority/after?

GET endpoint that uses Directory Parameters and the whole content of Query String (?) as the Raw Parameter. Supports JSONP!
This is useful if you are unsure or unable to properly encode a Query String Variable.
This will not support Fragments if # is not encoded! Fragments are client side only!
Variables are appended to the Directory 'after' with the ; Delimiter and before the Query String! Order of parameters is not important.
Example:
Request: /api;v1.0/validate/uri/authority/after;jsonp=Whoa;shorten;validator=2?juandefu.ca:1337
Parameters: ;jsonp=Whoa;shorten;validator=2
Validate: juandefu.ca:1337

Request

Parameters

validator
Number
Optional
Method of Validation to use.
STRICT Validation will not allow Incorrect Spec Validation to occur! It's recommended to use LOOSE!
LOOSE_ASIS assumes percent encoding DOES NOT EXIST and any percent characters will be encoded!

The Default/Invalid Validator is LOOSE

Constants

Key Value
STRICT 1
LOOSE 2
LOOSE_ASIS 3


Example

validator=2
shorten
Exists
Optional
Shorten Validated Object
Shortened Object may include other URI Compments needed to create a Valid URI Object
Validated must be Valid and Shorten must not be Throttled!

shorten-private
Exists
Optional
If this is set you will only be able to access the Shortened Link with a Private Key!
Private is a very large Random Integer up to 2^64 (18,446,744,073,709,551,615) and should be very hard to brute force!
DO NOT RELY SOLEY ON THIS FOR SECURITY!

jsonp
String
Optional
JSONP will be used to pad the JSON payload with a Function.
Must be a-zA-Z and 15 characters or less.
If JSONP is set and is empty or invalid "ZeroOut" will be used!

Example

jsonp=Whoa
Whoa({});
pd
Exists
Optional
Should Input be Percent Decoded before being passed to the Validator?
Most Validators will do their own Percent Decoding of Input.
This should only be used if necessary or if the Validator does not support Percent Decoding.

Response

errors
[]String
This is only returned on Internal Errors! Always check the Response Header Content-Type before parsing!

Example

"errors": [
	"internal server error"
]
shortened
Object: Shortened
If Validated is Throttled or an error occurs Shortened will be ignored!

validated
Object: Authority
Always returned!

If Throttled, returns an Object containing the Attribute "throttle" with a value of the Throttle Expiration Timestamp RFC 3339