mirror of
https://github.com/elyby/chrly.git
synced 2025-05-31 14:11:51 +05:30
Replace dep with go mod, migrate from travis to github-actions
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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"])
|
||||
|
||||
|
Reference in New Issue
Block a user