Remove SCUM sqlite user projections
This commit is contained in:
@@ -8,14 +8,14 @@ import (
|
||||
)
|
||||
|
||||
func TestValidateGamePluginRuntimeProfilesAllowsSafeCasePreservingDataTargetPath(t *testing.T) {
|
||||
profiles := validRuntimeDataTargetProfiles("SCUM/Saved/SaveFiles/SCUM.db")
|
||||
profiles := validRuntimeDataTargetProfiles("Game/Saved/SaveFiles/state.db")
|
||||
if err := ValidateGamePluginRuntimeProfiles(profiles); err != nil {
|
||||
t.Fatalf("expected safe cross-platform data target path to validate: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateGamePluginRuntimeProfilesRejectsUnsafeDataTargetPath(t *testing.T) {
|
||||
for _, sourcePath := range []string{"../SCUM.db", "/SCUM.db", `SCUM\\Saved\\SCUM.db`, "C:/SCUM.db", "https://example.test/SCUM.db"} {
|
||||
for _, sourcePath := range []string{"../state.db", "/state.db", `Game\\Saved\\state.db`, "C:/state.db", "https://example.test/state.db"} {
|
||||
t.Run(sourcePath, func(t *testing.T) {
|
||||
err := ValidateGamePluginRuntimeProfiles(validRuntimeDataTargetProfiles(sourcePath))
|
||||
if err == nil || !strings.Contains(err.Error(), "sourcePath must be a safe relative path") {
|
||||
@@ -28,18 +28,18 @@ func TestValidateGamePluginRuntimeProfilesRejectsUnsafeDataTargetPath(t *testing
|
||||
func validRuntimeDataTargetProfiles(sourcePath string) domain.GamePluginRuntimeProfiles {
|
||||
return domain.GamePluginRuntimeProfiles{
|
||||
TransportProfiles: []domain.RuntimeTransportProfile{{
|
||||
Key: "scum-database",
|
||||
Key: "game-database",
|
||||
Kind: "sqlite",
|
||||
TargetKey: "scum-database",
|
||||
TargetKey: "game-database",
|
||||
Capabilities: []string{domain.JobCapabilityRemoteRunDBSQLiteQuery},
|
||||
}},
|
||||
DataTargets: []domain.RuntimeDataTarget{{
|
||||
Key: "scum-database",
|
||||
Key: "game-database",
|
||||
Kind: "sqlite.snapshot",
|
||||
TransportKey: "scum-database",
|
||||
TransportKey: "game-database",
|
||||
SourceRootKey: "server-root",
|
||||
SourcePath: sourcePath,
|
||||
WorkspaceKey: "databases/scum-database",
|
||||
WorkspaceKey: "databases/game-database",
|
||||
RefreshPolicy: "on-demand-snapshot",
|
||||
MaxBytes: 1024 * 1024,
|
||||
Platforms: []string{"windows"},
|
||||
|
||||
Reference in New Issue
Block a user