1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-17 00:17:40 +02:00

Auth and standard logging with file rolling

This commit is contained in:
MisterWil
2019-02-10 08:37:45 -08:00
parent ee4ebe53bf
commit 8ec025f536
23 changed files with 799 additions and 200 deletions

View File

@ -5,7 +5,6 @@ import (
"encoding/base64"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"net/http/httptest"
@ -16,6 +15,7 @@ import (
"time"
"github.com/mbland/hmacauth"
"github.com/pusher/oauth2_proxy/logger"
"github.com/pusher/oauth2_proxy/providers"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -23,7 +23,7 @@ import (
)
func init() {
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
logger.SetFlags(logger.Lshortfile)
}
@ -263,7 +263,7 @@ func (tp *TestProvider) ValidateSessionState(session *providers.SessionState) bo
func TestBasicAuthPassword(t *testing.T) {
providerServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Printf("%#v", r)
logger.Printf("%#v", r)
var payload string
switch r.URL.Path {
case "/oauth/token":
@ -355,7 +355,7 @@ func NewPassAccessTokenTest(opts PassAccessTokenTestOptions) *PassAccessTokenTes
t.providerServer = httptest.NewServer(
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Printf("%#v", r)
logger.Printf("%#v", r)
var payload string
switch r.URL.Path {
case "/oauth/token":