remove ccirrelo/supervisor, update

everything seems to work even though sirupsen is upper case?

:cyfap:
This commit is contained in:
Reed Allman
2017-09-05 11:36:47 -07:00
parent 78ba35fb23
commit 27e43c5d94
397 changed files with 13691 additions and 8828 deletions

View File

@@ -0,0 +1,27 @@
// Copyright 2015 go-swagger maintainers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package security
import (
"net/http"
"github.com/go-openapi/runtime"
)
// Authorized provides a default implementation of the Authorizer interface where all
// requests are authorized (successful)
func Authorized() runtime.Authorizer {
return runtime.AuthorizerFunc(func(_ *http.Request, _ interface{}) error { return nil })
}

View File

@@ -0,0 +1,28 @@
// Copyright 2015 go-swagger maintainers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package security
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestAuthorized(t *testing.T) {
authorizer := Authorized()
err := authorizer.Authorize(nil, nil)
assert.NoError(t, err)
}

View File

@@ -49,7 +49,7 @@ func TestValidBearerAuth(t *testing.T) {
mpbody := bytes.NewBuffer(nil)
writer := multipart.NewWriter(mpbody)
writer.WriteField("access_token", "token123")
_ = writer.WriteField("access_token", "token123")
writer.Close()
req4, _ := http.NewRequest("POST", "/blah", mpbody)
req4.Header.Set("Content-Type", writer.FormDataContentType())
@@ -90,7 +90,7 @@ func TestInvalidBearerAuth(t *testing.T) {
mpbody := bytes.NewBuffer(nil)
writer := multipart.NewWriter(mpbody)
writer.WriteField("access_token", "token124")
_ = writer.WriteField("access_token", "token124")
writer.Close()
req4, _ := http.NewRequest("POST", "/blah", mpbody)
req4.Header.Set("Content-Type", writer.FormDataContentType())
@@ -131,7 +131,7 @@ func TestMissingBearerAuth(t *testing.T) {
mpbody := bytes.NewBuffer(nil)
writer := multipart.NewWriter(mpbody)
writer.WriteField("access_toke", "token123")
_ = writer.WriteField("access_toke", "token123")
writer.Close()
req4, _ := http.NewRequest("POST", "/blah", mpbody)
req4.Header.Set("Content-Type", writer.FormDataContentType())