Add stats reporter events listener, restore all events for http layer, rework authentication middleware and authenticator interface

This commit is contained in:
ErickSkrauch
2020-02-16 13:23:47 +03:00
parent db728451f8
commit 40c53ea0d9
12 changed files with 602 additions and 185 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/elyby/chrly/auth"
"github.com/elyby/chrly/bootstrap"
"github.com/elyby/chrly/db"
"github.com/elyby/chrly/http"
@@ -82,7 +81,7 @@ var serveCmd = &cobra.Command{
SkinsRepo: skinsRepo,
CapesRepo: capesRepo,
MojangTexturesProvider: mojangTexturesProvider,
Auth: &auth.JwtAuth{Key: []byte(viper.GetString("chrly.secret"))},
Authenticator: &http.JwtAuth{Key: []byte(viper.GetString("chrly.secret"))},
TexturesExtraParamName: viper.GetString("textures.extra_param_name"),
TexturesExtraParamValue: viper.GetString("textures.extra_param_value"),
}).CreateHandler()