mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 02:36:17 +01:00
- Add version exchange between hub and agent. - Introduce ConnectionManager for managing WebSocket and SSH connections. - Implement fingerprint generation and storage in agent. - Create expiry map package to store universal tokens. - Update config.yml configuration to include tokens. - Enhance system management with new methods for handling system states and alerts. - Update front-end components to support token / fingerprint management features. - Introduce utility functions for token generation and hub URL retrieval. Co-authored-by: nhas <jordanatararimu@gmail.com>
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
//go:build testing
|
||||
// +build testing
|
||||
|
||||
// Package tests provides helpers for testing the application.
|
||||
package tests
|
||||
|
||||
@@ -56,3 +59,30 @@ func NewTestHubWithConfig(config core.BaseAppConfig) (*TestHub, error) {
|
||||
|
||||
return t, nil
|
||||
}
|
||||
|
||||
// Helper function to create a test user for config tests
|
||||
func CreateUser(app core.App, email string, password string) (*core.Record, error) {
|
||||
userCollection, err := app.FindCachedCollectionByNameOrId("users")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
user := core.NewRecord(userCollection)
|
||||
user.Set("email", email)
|
||||
user.Set("password", password)
|
||||
|
||||
return user, app.Save(user)
|
||||
}
|
||||
|
||||
// Helper function to create a test record
|
||||
func CreateRecord(app core.App, collectionName string, fields map[string]any) (*core.Record, error) {
|
||||
collection, err := app.FindCachedCollectionByNameOrId(collectionName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
record := core.NewRecord(collection)
|
||||
record.Load(fields)
|
||||
|
||||
return record, app.Save(record)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user