Changeset 0.28.4 (#190)
This commit is contained in:
@@ -47,6 +47,7 @@ func setupExtensionHarness(t *testing.T) *extensionHarness {
|
||||
} else {
|
||||
stores = postgres.NewStores(database.TestDB)
|
||||
}
|
||||
userCache := middleware.NewUserStatusCache()
|
||||
|
||||
r := gin.New()
|
||||
api := r.Group("/api/v1")
|
||||
@@ -62,7 +63,7 @@ func setupExtensionHarness(t *testing.T) *extensionHarness {
|
||||
|
||||
// Protected routes
|
||||
protected := api.Group("")
|
||||
protected.Use(middleware.Auth(cfg))
|
||||
protected.Use(middleware.Auth(cfg, stores.Users, userCache))
|
||||
|
||||
// User extension endpoints
|
||||
protected.GET("/extensions", extH.ListUserExtensions)
|
||||
@@ -72,7 +73,7 @@ func setupExtensionHarness(t *testing.T) *extensionHarness {
|
||||
|
||||
// Admin extension endpoints
|
||||
admin := api.Group("/admin")
|
||||
admin.Use(middleware.Auth(cfg), middleware.RequireAdmin())
|
||||
admin.Use(middleware.Auth(cfg, stores.Users, userCache), middleware.RequireAdmin())
|
||||
admin.GET("/extensions", extH.AdminListExtensions)
|
||||
admin.POST("/extensions", extH.AdminInstallExtension)
|
||||
admin.PUT("/extensions/:id", extH.AdminUpdateExtension)
|
||||
|
||||
Reference in New Issue
Block a user