mirror of
https://github.com/openziti/zrok.git
synced 2024-11-25 01:23:49 +01:00
not public; lint
This commit is contained in:
parent
4b3c22d02a
commit
cb1a88e339
@ -27,12 +27,12 @@ func createAccountHandler(params identity.CreateAccountParams) middleware.Respon
|
||||
Password: hashPassword(params.Body.Password),
|
||||
Token: token,
|
||||
}
|
||||
tx, err := Str.Begin()
|
||||
tx, err := str.Begin()
|
||||
if err != nil {
|
||||
logrus.Errorf("error starting transaction: %v", err)
|
||||
return identity.NewCreateAccountInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
|
||||
}
|
||||
id, err := Str.CreateAccount(a, tx)
|
||||
id, err := str.CreateAccount(a, tx)
|
||||
if err != nil {
|
||||
logrus.Errorf("error creating account: %v", err)
|
||||
_ = tx.Rollback()
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var Str *store.Store
|
||||
var str *store.Store
|
||||
|
||||
func Run(cfg *Config) error {
|
||||
swaggerSpec, err := loads.Embedded(rest_server_zrok.SwaggerJSON, rest_server_zrok.FlatSwaggerJSON)
|
||||
@ -29,7 +29,7 @@ func Run(cfg *Config) error {
|
||||
api.TunnelUntunnelHandler = tunnel.UntunnelHandlerFunc(untunnelHandler)
|
||||
|
||||
if v, err := store.Open(cfg.Store); err == nil {
|
||||
Str = v
|
||||
str = v
|
||||
} else {
|
||||
return errors.Wrap(err, "error opening store")
|
||||
}
|
||||
|
@ -14,11 +14,11 @@ import (
|
||||
|
||||
func ZrokAuthenticate(token string) (*rest_model_zrok.Principal, error) {
|
||||
logrus.Infof("authenticating")
|
||||
tx, err := Str.Begin()
|
||||
tx, err := str.Begin()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if a, err := Str.FindAccountWithToken(token, tx); err == nil {
|
||||
if a, err := str.FindAccountWithToken(token, tx); err == nil {
|
||||
principal := rest_model_zrok.Principal{
|
||||
ID: int64(a.Id),
|
||||
Token: a.Token,
|
||||
|
Loading…
Reference in New Issue
Block a user