Documentation
¶
Overview ¶
Package tokenendpoint turns the errors of an OAuth token request (golang.org/x/oauth2) into errors of this module that carry none of the endpoint's free text. It sits apart from internal/dependency so that packages without OAuth do not import oauth2. Its functions are safe for concurrent use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
Error returns "<operation>: token endpoint answered HTTP <status> [<OAuth error code>]" for an error answer of the endpoint (*oauth2.RetrieveError): its description, URI and body are the endpoint's free text and stay out of errors and outcomes (LOG-009). A failed call (*url.Error) or a cancelled or expired context goes through dependency.Error, so the context error stays detectable. Anything else is an answer oauth2 could not read (a malformed token response, whose parse error quotes its values): "<operation>: token endpoint answered an unreadable token response".
Types ¶
This section is empty.