forked from Mirrors/oauth2
Requested changes.
This commit is contained in:
parent
cdebe8a098
commit
ae11242ea6
|
@ -7,7 +7,7 @@ import (
|
|||
"net/url"
|
||||
)
|
||||
|
||||
// ClientAuthentication represents an OAuth client ID and secret and the mechanism for passing these credentials as stated in rfc6749#2.3.1
|
||||
// ClientAuthentication represents an OAuth client ID and secret and the mechanism for passing these credentials as stated in rfc6749#2.3.1.
|
||||
type ClientAuthentication struct {
|
||||
//Can be either basic or request-body
|
||||
AuthStyle oauth2.AuthStyle
|
||||
|
@ -15,7 +15,7 @@ type ClientAuthentication struct {
|
|||
ClientSecret string
|
||||
}
|
||||
|
||||
func (c *ClientAuthentication) InjectAuthentication(values *url.Values, headers *http.Header) {
|
||||
func (c *ClientAuthentication) InjectAuthentication(values url.Values, headers http.Header) {
|
||||
if c.ClientID == "" || c.ClientSecret == "" || values == nil || headers == nil {
|
||||
return
|
||||
}
|
|
@ -2,7 +2,7 @@ package externalaccount
|
|||
|
||||
import "fmt"
|
||||
|
||||
//Struct for handling OAuth related error responses as stated in rfc6749#5.2
|
||||
//Error for handling OAuth related error responses as stated in rfc6749#5.2.
|
||||
type Error struct {
|
||||
Code string
|
||||
URI string
|
||||
|
|
|
@ -8,8 +8,8 @@ func TestError_Generator(t *testing.T) {
|
|||
"http:thisIsAPlaceholder",
|
||||
"The Answer!",
|
||||
}
|
||||
output := "got error code " + "42" + " from " + "http:thisIsAPlaceholder" + ": " + "The Answer!"
|
||||
if got, want := e, output; e.Error() != output {
|
||||
want := "got error code " + "42" + " from " + "http:thisIsAPlaceholder" + ": " + "The Answer!"
|
||||
if got := e.Error(); got != want {
|
||||
t.Errorf("Got error message %q; want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue