mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
remove ccirrelo/supervisor, update
everything seems to work even though sirupsen is upper case? :cyfap:
This commit is contained in:
27
vendor/github.com/go-openapi/runtime/security/authorizer.go
generated
vendored
Normal file
27
vendor/github.com/go-openapi/runtime/security/authorizer.go
generated
vendored
Normal 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 })
|
||||
}
|
||||
28
vendor/github.com/go-openapi/runtime/security/authorizer_test.go
generated
vendored
Normal file
28
vendor/github.com/go-openapi/runtime/security/authorizer_test.go
generated
vendored
Normal 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)
|
||||
}
|
||||
6
vendor/github.com/go-openapi/runtime/security/bearer_auth_test.go
generated
vendored
6
vendor/github.com/go-openapi/runtime/security/bearer_auth_test.go
generated
vendored
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user