Replace dep with go mod, migrate from travis to github-actions

This commit is contained in:
ErickSkrauch
2023-12-12 01:35:08 +01:00
parent 980c920ceb
commit 6accffed45
17 changed files with 273 additions and 501 deletions

View File

@@ -13,7 +13,7 @@ import (
"github.com/elyby/chrly/model"
)
//noinspection GoSnakeCaseUsage
// noinspection GoSnakeCaseUsage
const UUID_ANY = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
var regexUuidAny = regexp.MustCompile(UUID_ANY)

View File

@@ -32,7 +32,7 @@ func TestJwtAuth_Authenticate(t *testing.T) {
emitter.On("Emit", "authentication:success")
req := httptest.NewRequest("POST", "http://localhost", nil)
req.Header.Add("Authorization", "Bearer " + jwt)
req.Header.Add("Authorization", "Bearer "+jwt)
jwt := &JwtAuth{Key: []byte("secret"), Emitter: emitter}
err := jwt.Authenticate(req)
@@ -99,7 +99,7 @@ func TestJwtAuth_Authenticate(t *testing.T) {
}))
req := httptest.NewRequest("POST", "http://localhost", nil)
req.Header.Add("Authorization", "Bearer " + jwt)
req.Header.Add("Authorization", "Bearer "+jwt)
jwt := &JwtAuth{Emitter: emitter}
err := jwt.Authenticate(req)
@@ -116,7 +116,7 @@ func TestJwtAuth_Authenticate(t *testing.T) {
}))
req := httptest.NewRequest("POST", "http://localhost", nil)
req.Header.Add("Authorization", "Bearer " + jwt)
req.Header.Add("Authorization", "Bearer "+jwt)
jwt := &JwtAuth{Key: []byte("this is another secret"), Emitter: emitter}
err := jwt.Authenticate(req)

View File

@@ -264,7 +264,8 @@ func (ctx *Skinsystem) signatureVerificationKeyHandler(response http.ResponseWri
}
// TODO: in v5 should be extracted into some ProfileProvider interface,
// which will encapsulate all logics, declared in this method
//
// which will encapsulate all logics, declared in this method
func (ctx *Skinsystem) getProfile(request *http.Request, proxy bool) (*profile, error) {
username := parseUsername(mux.Vars(request)["username"])