Remove SCUM sqlite user projections
This commit is contained in:
@@ -18,7 +18,7 @@ func TestObservabilityValidatorsBoundMetricsBackupsAndRemoteTargets(t *testing.T
|
||||
if err := ValidateRemoteAdapterRequest(domain.RemoteAdapterRequest{ServerInstanceID: "server-1", DeclarationKey: "ftp", TargetKey: "tcp://host", Capability: "remote.ftp.read", IdempotencyKey: "request-1"}); err == nil {
|
||||
t.Fatal("expected unsafe remote target rejection")
|
||||
}
|
||||
if err := ValidateRemoteAdapterRequest(domain.RemoteAdapterRequest{ServerInstanceID: "server-1", DeclarationKey: "sqlite-db", TargetKey: "scum-db", Capability: domain.JobCapabilityRemoteRunDBSQLiteExecute, IdempotencyKey: "sql-execute-1", Inputs: map[string]string{"mode": "execute", "sqlText": "UPDATE prisoner SET stamina = 855 WHERE id = 'steam-123';"}}); err != nil {
|
||||
if err := ValidateRemoteAdapterRequest(domain.RemoteAdapterRequest{ServerInstanceID: "server-1", DeclarationKey: "sqlite-db", TargetKey: "game-db", Capability: domain.JobCapabilityRemoteRunDBSQLiteExecute, IdempotencyKey: "sql-execute-1", Inputs: map[string]string{"mode": "execute", "sqlText": "UPDATE players SET score = 855 WHERE id = 'player-123';"}}); err != nil {
|
||||
t.Fatalf("expected SQL text input to validate: %v", err)
|
||||
}
|
||||
if err := ValidateRemoteAdapterRequest(domain.RemoteAdapterRequest{ServerInstanceID: "server-1", DeclarationKey: "rcon", TargetKey: "scum-rcon", Capability: domain.JobCapabilityRemoteRunRCONCommand, IdempotencyKey: "rcon-command-1", Inputs: map[string]string{"command": "#Login password=opaque /Users/operator note tcp://127.0.0.1:7777"}}); err != nil {
|
||||
|
||||
@@ -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