working commit

This commit is contained in:
2026-02-20 19:08:26 +02:00
parent f973293315
commit 3220e2d78f
32 changed files with 195 additions and 213 deletions
+6 -6
View File
@@ -18,7 +18,7 @@ import (
"mstore/pkg/auxhttp"
"mstore/pkg/auxpwd"
"mstore/pkg/term"
"mstore/pkg/uuid"
"mstore/pkg/auxid"
)
const (
@@ -44,12 +44,12 @@ func (hand *Handler) AuthMiddleware(next router.Handler) router.Handler {
}
// Authentification
func (hand *Handler) CheckAccess(rctx *router.Context) (bool, uuid.UUID, error) {
func (hand *Handler) CheckAccess(rctx *router.Context) (bool, uint64, error) {
var err error
var success bool
var username string
var password string
var accountID uuid.UUID
var accountID uint64
accountID = term.AnonymousID
@@ -80,9 +80,9 @@ anonymous:
return success, accountID, err
}
func (hand *Handler) ValidatePassword(ctx context.Context, username, password string) (bool, uuid.UUID, error) {
func (hand *Handler) ValidatePassword(ctx context.Context, username, password string) (bool, uint64, error) {
var err error
var accountID uuid.UUID
var accountID uint64
valid := false
accountExists, accountDescr, err := hand.mdb.GetAccountByUsername(ctx, username)
@@ -102,7 +102,7 @@ func (hand *Handler) ValidatePassword(ctx context.Context, username, password st
// Authorization
func (hand *Handler) CheckRight(ctx context.Context, accountID uuid.UUID, reqRight term.Right, subject string) (bool, error) {
func (hand *Handler) CheckRight(ctx context.Context, accountID uint64, reqRight term.Right, subject string) (bool, error) {
var err error
var res bool
//hand.logg.Debugf("Cop check your right %s: %s %s", accountID, reqRight, subject)