Add backups, currencies and dashboard APIs, and scope access by guard_name.
Web users may only CRUD their own records, operators stay in assigned branches, and admin/manager/superadmin keep full access. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
0d000f9af6
commit
28509eb4ca
65 files changed
+9132
-296
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package backup
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestValidBackupFileName(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
ok bool
|
||||
}{
|
||||
{"backup_2026_05_22_01.sql", true},
|
||||
{"backup_2026_08_29_12.sql", true},
|
||||
{"", false},
|
||||
{"../etc/passwd", false},
|
||||
{"backup_2026_05_22_01.sql/../../x", false},
|
||||
{"foo.sql", false},
|
||||
{"backup_2026_05_22_01.sql.exe", false},
|
||||
{"backup_2026_05_22_01.sql ", false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
if got := validBackupFileName(tt.name); got != tt.ok {
|
||||
t.Errorf("validBackupFileName(%q) = %v, want %v", tt.name, got, tt.ok)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user