feat(storage): add native MySQL namespace and identity pilots
Add resumable checked migrations and explicit schema administration commands. Port ML budgets, namespaces, identity and group persistence with three-backend contracts. Keep MySQL unavailable as the full application backend.
This commit is contained in:
1 parent
0c7897d695
commit
6a67fd9afe
40 files changed
+3087
-94
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMySQLRejectsUnsafeConfiguration(t *testing.T) {
|
||||
for _, dsn := range []string{"", "private-secret@bad", "u:private-secret@tcp(localhost:3306)/pages", "u:p@tcp(localhost:3306)/pages?tls=skip-verify", "u:p@tcp(localhost:3306)/pages?tls=preferred", "u:p@tcp(localhost:3306)/pages?tls=true&multiStatements=true", "u:p@tcp(localhost:3306)/pages?tls=true&allowAllFiles=true", "u:p@tcp(localhost:3306)/pages?tls=true&sql_mode=bad"} {
|
||||
connection, err := OpenMySQL(context.Background(), MySQLOptions{DSN: dsn})
|
||||
if connection != nil {
|
||||
connection.Close()
|
||||
t.Fatal("unexpected connection")
|
||||
}
|
||||
if err == nil || strings.Contains(err.Error(), "private-secret") {
|
||||
t.Fatalf("configuration not safely rejected: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user