switch session store to jwt, no refresh yet #30

This commit is contained in:
Umputun
2018-05-21 19:16:16 -05:00
parent 60794baedd
commit 07ea6e5b4e
32 changed files with 2068 additions and 195 deletions
-2
View File
@@ -17,7 +17,6 @@ import (
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/render"
"github.com/gorilla/context"
"github.com/pkg/errors"
"gopkg.in/russross/blackfriday.v2"
@@ -80,7 +79,6 @@ func (s *Rest) routes() chi.Router {
router.Use(middleware.RealIP, Recoverer)
router.Use(middleware.Throttle(1000), middleware.Timeout(60*time.Second))
router.Use(AppInfo("remark42", s.Version), Ping)
router.Use(context.ClearHandler) // if you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler
s.adminService = admin{
dataService: s.DataService,
+4 -6
View File
@@ -14,7 +14,6 @@ import (
"time"
"github.com/coreos/bbolt"
"github.com/gorilla/sessions"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -469,11 +468,10 @@ func prep(t *testing.T) (srv *Rest, ts *httptest.Server) {
srv = &Rest{
DataService: dataStore,
Authenticator: auth.Authenticator{
SessionStore: sessions.NewFilesystemStore("/tmp", []byte("blah")),
DevPasswd: "password",
Providers: nil,
AvatarProxy: &proxy.Avatar{StorePath: "/tmp", RoutePath: "/api/v1/avatar"},
Admins: []string{"a1", "a2"},
DevPasswd: "password",
Providers: nil,
AvatarProxy: &proxy.Avatar{StorePath: "/tmp", RoutePath: "/api/v1/avatar"},
Admins: []string{"a1", "a2"},
},
Exporter: &migrator.Remark{DataStore: &dataStore},
Cache: &mockCache{},