mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
deprecate embedded browser (#12163)
https://github.com/minio/console takes over the functionality for the future object browser development Signed-off-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@@ -91,61 +90,6 @@ func TestAuthenticateURL(t *testing.T) {
|
||||
testAuthenticate("url", t)
|
||||
}
|
||||
|
||||
// Tests web request authenticator.
|
||||
func TestWebRequestAuthenticate(t *testing.T) {
|
||||
obj, fsDir, err := prepareFS()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(fsDir)
|
||||
if err = newTestConfig(globalMinioDefaultRegion, obj); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
creds := globalActiveCred
|
||||
token, err := getTokenString(creds.AccessKey, creds.SecretKey)
|
||||
if err != nil {
|
||||
t.Fatalf("unable get token %s", err)
|
||||
}
|
||||
testCases := []struct {
|
||||
req *http.Request
|
||||
expectedErr error
|
||||
}{
|
||||
// Set valid authorization header.
|
||||
{
|
||||
req: &http.Request{
|
||||
Header: http.Header{
|
||||
"Authorization": []string{token},
|
||||
},
|
||||
},
|
||||
expectedErr: nil,
|
||||
},
|
||||
// No authorization header.
|
||||
{
|
||||
req: &http.Request{
|
||||
Header: http.Header{},
|
||||
},
|
||||
expectedErr: errNoAuthToken,
|
||||
},
|
||||
// Invalid authorization token.
|
||||
{
|
||||
req: &http.Request{
|
||||
Header: http.Header{
|
||||
"Authorization": []string{"invalid-token"},
|
||||
},
|
||||
},
|
||||
expectedErr: errAuthentication,
|
||||
},
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
_, _, gotErr := webRequestAuthenticate(testCase.req)
|
||||
if testCase.expectedErr != gotErr {
|
||||
t.Errorf("Test %d, expected err %s, got %s", i+1, testCase.expectedErr, gotErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkParseJWTStandardClaims(b *testing.B) {
|
||||
obj, fsDir, err := prepareFS()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user