Move logger to pkg/logger
This commit is contained in:
		
							parent
							
								
									d1ef14becc
								
							
						
					
					
						commit
						fb9616160e
					
				| 
						 | 
					@ -7,7 +7,7 @@ import (
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"golang.org/x/crypto/bcrypt"
 | 
						"golang.org/x/crypto/bcrypt"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								http.go
								
								
								
								
							
							
						
						
									
										2
									
								
								http.go
								
								
								
								
							| 
						 | 
					@ -7,7 +7,7 @@ import (
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Server represents an HTTP server
 | 
					// Server represents an HTTP server
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@ import (
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// responseLogger is wrapper of http.ResponseWriter that keeps track of its HTTP status
 | 
					// responseLogger is wrapper of http.ResponseWriter that keeps track of its HTTP status
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@ import (
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestLoggingHandler_ServeHTTP(t *testing.T) {
 | 
					func TestLoggingHandler_ServeHTTP(t *testing.T) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								main.go
								
								
								
								
							
							
						
						
									
										2
									
								
								main.go
								
								
								
								
							| 
						 | 
					@ -12,7 +12,7 @@ import (
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/BurntSushi/toml"
 | 
						"github.com/BurntSushi/toml"
 | 
				
			||||||
	options "github.com/mreiferson/go-options"
 | 
						options "github.com/mreiferson/go-options"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,7 +14,7 @@ import (
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/mbland/hmacauth"
 | 
						"github.com/mbland/hmacauth"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	sessionsapi "github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
						sessionsapi "github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/encryption"
 | 
						"github.com/pusher/oauth2_proxy/pkg/encryption"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/providers"
 | 
						"github.com/pusher/oauth2_proxy/providers"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,7 +15,7 @@ import (
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/mbland/hmacauth"
 | 
						"github.com/mbland/hmacauth"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
						"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/sessions/cookie"
 | 
						"github.com/pusher/oauth2_proxy/pkg/sessions/cookie"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/providers"
 | 
						"github.com/pusher/oauth2_proxy/providers"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ import (
 | 
				
			||||||
	oidc "github.com/coreos/go-oidc"
 | 
						oidc "github.com/coreos/go-oidc"
 | 
				
			||||||
	"github.com/dgrijalva/jwt-go"
 | 
						"github.com/dgrijalva/jwt-go"
 | 
				
			||||||
	"github.com/mbland/hmacauth"
 | 
						"github.com/mbland/hmacauth"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/apis/options"
 | 
						"github.com/pusher/oauth2_proxy/pkg/apis/options"
 | 
				
			||||||
	sessionsapi "github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
						sessionsapi "github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/encryption"
 | 
						"github.com/pusher/oauth2_proxy/pkg/encryption"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,7 @@ import (
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/apis/options"
 | 
						"github.com/pusher/oauth2_proxy/pkg/apis/options"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ import (
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/bitly/go-simplejson"
 | 
						"github.com/bitly/go-simplejson"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Request parses the request body into a simplejson.Json object
 | 
					// Request parses the request body into a simplejson.Json object
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ import (
 | 
				
			||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/bitly/go-simplejson"
 | 
						"github.com/bitly/go-simplejson"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
						"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/requests"
 | 
						"github.com/pusher/oauth2_proxy/pkg/requests"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@ import (
 | 
				
			||||||
	"strconv"
 | 
						"strconv"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
						"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@ import (
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
						"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/requests"
 | 
						"github.com/pusher/oauth2_proxy/pkg/requests"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ import (
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
						"github.com/pusher/oauth2_proxy/pkg/apis/sessions"
 | 
				
			||||||
	"golang.org/x/oauth2"
 | 
						"golang.org/x/oauth2"
 | 
				
			||||||
	"golang.org/x/oauth2/google"
 | 
						"golang.org/x/oauth2/google"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@ import (
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/pkg/requests"
 | 
						"github.com/pusher/oauth2_proxy/pkg/requests"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@ import (
 | 
				
			||||||
	"html/template"
 | 
						"html/template"
 | 
				
			||||||
	"path"
 | 
						"path"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func loadTemplates(dir string) *template.Template {
 | 
					func loadTemplates(dir string) *template.Template {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@ import (
 | 
				
			||||||
	"sync/atomic"
 | 
						"sync/atomic"
 | 
				
			||||||
	"unsafe"
 | 
						"unsafe"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// UserMap holds information from the authenticated emails file
 | 
					// UserMap holds information from the authenticated emails file
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ import (
 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pusher/oauth2_proxy/logger"
 | 
						"github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
	fsnotify "gopkg.in/fsnotify/fsnotify.v1"
 | 
						fsnotify "gopkg.in/fsnotify/fsnotify.v1"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package main
 | 
					package main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "github.com/pusher/oauth2_proxy/logger"
 | 
					import "github.com/pusher/oauth2_proxy/pkg/logger"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func WatchForUpdates(filename string, done <-chan bool, action func()) {
 | 
					func WatchForUpdates(filename string, done <-chan bool, action func()) {
 | 
				
			||||||
	logger.Printf("file watching not implemented on this platform")
 | 
						logger.Printf("file watching not implemented on this platform")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue