lab7: безопасность, mTLS, OpenBao и PKI lifecycle

This commit is contained in:
Vladislav Kunetskiy
2026-11-10 10:58:07 +03:00
parent 3d216fbd50
commit 3441f2269a
183 changed files with 216667 additions and 3165 deletions
@@ -40,6 +40,23 @@ func (r *SessionRepository) Credentials(ctx context.Context, username string) (d
}, nil
}
func (r *SessionRepository) UpdatePasswordHash(
ctx context.Context, userID uuid.UUID, oldHash, newHash string,
) (bool, error) {
ctx, cancel := r.store.timeout(ctx)
defer cancel()
rows, err := r.store.queries.UpdatePasswordHash(ctx, sqlcgen.UpdatePasswordHashParams{
NewHash: newHash,
UserID: userID,
OldHash: oldHash,
})
if err != nil {
return false, fmt.Errorf("update password hash: %w", mapError(err))
}
return rows != 0, nil
}
func (r *SessionRepository) Create(ctx context.Context, session domain.NewSession) (domain.Session, error) {
ctx, cancel := r.store.timeout(ctx)
defer cancel()