Skip to content

Commit

Permalink
Now using the authorize intead of authorise...
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Buhr committed Aug 15, 2014
1 parent 32e9541 commit eaba1d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion middleware_api_security_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// shared secret between the client and the owner and is set in the tyk.conf file. This should never be made public!
func CheckIsAPIOwner(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
tykAuthKey := r.Header.Get("X-Tyk-Authorisation")
tykAuthKey := r.Header.Get("X-Tyk-Authorization")
if tykAuthKey != config.Secret {
// Error
log.Warning("Attempted administrative access with invalid or missing key!")
Expand Down
6 changes: 3 additions & 3 deletions oauth_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestAPIClientAuthorizeAuthCode(t *testing.T) {
param.Set("client_id", T_CLIENT_ID)
param.Set("key_rules", keyRules)
req, err := http.NewRequest(method, uri, bytes.NewBufferString(param.Encode()))
req.Header.Set("x-tyk-authorisation", "352d20ee67be67f6340b4c0605b044b7")
req.Header.Set("x-tyk-authorization", "352d20ee67be67f6340b4c0605b044b7")
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

if err != nil {
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestAPIClientAuthorizeToken(t *testing.T) {
param.Set("client_id", T_CLIENT_ID)
param.Set("key_rules", keyRules)
req, err := http.NewRequest(method, uri, bytes.NewBufferString(param.Encode()))
req.Header.Set("x-tyk-authorisation", "352d20ee67be67f6340b4c0605b044b7")
req.Header.Set("x-tyk-authorization", "352d20ee67be67f6340b4c0605b044b7")
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

if err != nil {
Expand Down Expand Up @@ -198,7 +198,7 @@ func GetAuthCode() map[string]string {
param.Set("client_id", T_CLIENT_ID)
param.Set("key_rules", keyRules)
req, _ := http.NewRequest(method, uri, bytes.NewBufferString(param.Encode()))
req.Header.Set("x-tyk-authorisation", "352d20ee67be67f6340b4c0605b044b7")
req.Header.Set("x-tyk-authorization", "352d20ee67be67f6340b4c0605b044b7")
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

recorder := httptest.NewRecorder()
Expand Down

0 comments on commit eaba1d1

Please sign in to comment.