Feat rebrand armature (#43)
All checks were successful
CI/CD / detect-changes (push) Successful in 3s
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m34s
CI/CD / test-sqlite (push) Successful in 2m46s
CI/CD / build-and-deploy (push) Successful in 1m55s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #43.
This commit is contained in:
2026-03-31 23:25:37 +00:00
committed by xcaliber
parent fb5284f667
commit 680ec3b897
321 changed files with 956 additions and 1033 deletions

View File

@@ -10,12 +10,12 @@ import (
"github.com/gin-gonic/gin"
"golang.org/x/crypto/bcrypt"
"switchboard-core/auth"
"switchboard-core/crypto"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/storage"
"switchboard-core/store"
"armature/auth"
"armature/crypto"
"armature/database"
"armature/models"
"armature/storage"
"armature/store"
)
type AdminHandler struct {

View File

@@ -7,7 +7,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"armature/models"
)
// ListGlobalConnections returns all global-scope connections.

View File

@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/notifications"
"switchboard-core/store"
"armature/notifications"
"armature/store"
)
// AdminEmailHandler handles admin SMTP configuration and test endpoints.
@@ -53,7 +53,7 @@ func (h *AdminEmailHandler) TestEmail(c *gin.Context) {
}
// Get instance name
instanceName := "Switchboard Core"
instanceName := "Armature"
if branding, err := h.stores.GlobalConfig.Get(context.Background(), "branding"); err == nil {
if name, ok := branding["instance_name"].(string); ok && name != "" {
instanceName = name
@@ -64,7 +64,7 @@ func (h *AdminEmailHandler) TestEmail(c *gin.Context) {
htmlBody := `<!DOCTYPE html>
<html><body style="font-family: sans-serif; padding: 20px;">
<h2 style="color: #4a8af4;">` + instanceName + `</h2>
<p>This is a test email from your Switchboard Core instance.</p>
<p>This is a test email from your Armature instance.</p>
<p>If you received this, your SMTP configuration is working correctly.</p>
</body></html>`
textBody := instanceName + " — Test Email\n\nThis is a test email. Your SMTP configuration is working correctly."

View File

@@ -3,7 +3,7 @@ package handlers
import (
"github.com/gin-gonic/gin"
"switchboard-core/metrics"
"armature/metrics"
)
// MetricsHandler serves the admin metrics endpoint.

View File

@@ -9,8 +9,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/metrics"
"switchboard-core/store"
"armature/metrics"
"armature/store"
)
// mockHub implements metrics.ConnCounter for tests.

View File

@@ -8,8 +8,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"switchboard-core/store"
"armature/models"
"armature/store"
)
// AuditLog writes an audit entry via the store interface.

View File

@@ -17,11 +17,11 @@ import (
"github.com/google/uuid"
"golang.org/x/crypto/bcrypt"
"switchboard-core/auth"
"switchboard-core/config"
"switchboard-core/crypto"
"switchboard-core/models"
"switchboard-core/store"
"armature/auth"
"armature/config"
"armature/crypto"
"armature/models"
"armature/store"
)
// Claims represents the JWT payload.
@@ -153,8 +153,8 @@ func (h *AuthHandler) Logout(c *gin.Context) {
h.uekCache.Evict(userID.(string))
}
// Clear the sb_token cookie so SSR middleware doesn't trust a stale token
c.SetCookie("sb_token", "", -1, "/", "", false, false)
// Clear the arm_token cookie so SSR middleware doesn't trust a stale token
c.SetCookie("arm_token", "", -1, "/", "", false, false)
c.JSON(http.StatusOK, gin.H{"message": "logged out"})
}
@@ -287,7 +287,7 @@ func (h *AuthHandler) OIDCCallback(c *gin.Context) {
userJSON, _ := json.Marshal(tokens["user"])
// Set page-auth cookie too (for SSR middleware)
c.SetCookie("sb_token", accessToken, 900, "/", "", false, false)
c.SetCookie("arm_token", accessToken, 900, "/", "", false, false)
// Base64-encode the token payload for the fragment
payload := fmt.Sprintf(`{"access_token":"%s","refresh_token":"%s","user":%s}`,
@@ -517,7 +517,7 @@ func BootstrapAdmin(cfg *config.Config, s store.Stores, uekCache ...*crypto.UEKC
email := cfg.AdminEmail
if email == "" {
email = cfg.AdminUsername + "@switchboard.local"
email = cfg.AdminUsername + "@armature.local"
}
handle := auth.UniqueHandle(ctx, s.Users, models.HandleFromName(cfg.AdminUsername))
@@ -612,7 +612,7 @@ func SeedUsers(cfg *config.Config, s store.Stores, uekCache ...*crypto.UEKCache)
handle := auth.UniqueHandle(ctx, s.Users, models.HandleFromName(username))
user := &models.User{
Username: username,
Email: username + "@switchboard.local",
Email: username + "@armature.local",
PasswordHash: string(hash),
IsActive: true,
AuthSource: "builtin",

View File

@@ -14,9 +14,9 @@ import (
"github.com/golang-jwt/jwt/v5"
"golang.org/x/crypto/bcrypt"
"switchboard-core/auth"
"switchboard-core/config"
"switchboard-core/store"
"armature/auth"
"armature/config"
"armature/store"
)
func testConfig() *config.Config {
@@ -43,7 +43,7 @@ func TestJWTGeneration(t *testing.T) {
RegisteredClaims: jwt.RegisteredClaims{
IssuedAt: jwt.NewNumericDate(now),
ExpiresAt: jwt.NewNumericDate(now.Add(15 * time.Minute)),
Issuer: "switchboard-core",
Issuer: "armature",
},
}

View File

@@ -16,8 +16,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/database"
"switchboard-core/store"
"armature/database"
"armature/store"
)
// BackupHandler provides backup/restore endpoints for admin users.
@@ -101,7 +101,7 @@ func (h *BackupHandler) CreateBackup(c *gin.Context) {
}
// Stream directly to client
filename := fmt.Sprintf("switchboard-%s-%s.swb", meta.Version, meta.Timestamp.Format("20060102-150405"))
filename := fmt.Sprintf("armature-%s-%s.swb", meta.Version, meta.Timestamp.Format("20060102-150405"))
c.Header("Content-Type", "application/zip")
c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=%q", filename))
@@ -119,7 +119,7 @@ func (h *BackupHandler) createStoredBackup(c *gin.Context, ctx interface{ Deadli
}
os.MkdirAll(dir, 0755)
filename := fmt.Sprintf("switchboard-%s-%s.swb", meta.Version, meta.Timestamp.Format("20060102-150405"))
filename := fmt.Sprintf("armature-%s-%s.swb", meta.Version, meta.Timestamp.Format("20060102-150405"))
path := filepath.Join(dir, filename)
f, err := os.Create(path)

View File

@@ -10,7 +10,7 @@ import (
"log"
"strings"
"switchboard-core/database"
"armature/database"
)
// coreTableOrder lists tables for backup in FK-safe import order.

View File

@@ -13,12 +13,12 @@ import (
"github.com/gin-gonic/gin"
authpkg "switchboard-core/auth"
"switchboard-core/config"
"switchboard-core/database"
"switchboard-core/middleware"
"switchboard-core/store"
"switchboard-core/store/sqlite"
authpkg "armature/auth"
"armature/config"
"armature/database"
"armature/middleware"
"armature/store"
"armature/store/sqlite"
)
// ── Backup Test Harness ────────────────────────

View File

@@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"armature/store"
)
// ClusterHandler serves the admin cluster API.

View File

@@ -10,7 +10,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"armature/store"
)
// mockClusterStore implements store.ClusterStore for handler tests.

View File

@@ -6,9 +6,9 @@ import (
"context"
"encoding/json"
"switchboard-core/crypto"
"switchboard-core/models"
"switchboard-core/store"
"armature/crypto"
"armature/models"
"armature/store"
)
// ConnectionResolverAdapter implements sandbox.ConnectionResolver.

View File

@@ -9,7 +9,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"armature/store"
)
// ConnectionTypeEntry is a single connection type in the API response.

View File

@@ -9,9 +9,9 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/crypto"
"switchboard-core/models"
"switchboard-core/store"
"armature/crypto"
"armature/models"
"armature/store"
)
// ConnectionHandler handles user-facing extension connection endpoints.

View File

@@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"armature/models"
)
// ── Extension Dependencies ──────────────────

View File

@@ -41,9 +41,9 @@ import (
"github.com/gin-gonic/gin"
"go.starlark.net/starlark"
"switchboard-core/models"
"switchboard-core/sandbox"
"switchboard-core/store"
"armature/models"
"armature/sandbox"
"armature/store"
)
// ExtAPIHandler serves extension API routes via Starlark.

View File

@@ -15,7 +15,7 @@ import (
"regexp"
"strings"
"switchboard-core/store"
"armature/store"
)
// validSchemaIdentifier matches safe SQL identifiers for table and column names.

View File

@@ -8,7 +8,7 @@ import (
_ "modernc.org/sqlite"
"switchboard-core/store"
"armature/store"
)
// ── mock ExtDataStore ────────────────────────────────────────────────────────

View File

@@ -5,8 +5,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"switchboard-core/store"
"armature/models"
"armature/store"
)
// ExtPermHandler serves extension permission management endpoints.

View File

@@ -5,8 +5,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"switchboard-core/store"
"armature/models"
"armature/store"
)
// ExtSecretsHandler serves extension secret management endpoints.

View File

@@ -9,13 +9,13 @@ import (
"github.com/gin-gonic/gin"
authpkg "switchboard-core/auth"
"switchboard-core/config"
"switchboard-core/database"
"switchboard-core/middleware"
"switchboard-core/store"
postgres "switchboard-core/store/postgres"
sqlite "switchboard-core/store/sqlite"
authpkg "armature/auth"
"armature/config"
"armature/database"
"armature/middleware"
"armature/store"
postgres "armature/store/postgres"
sqlite "armature/store/sqlite"
)
// ── Extension Test Harness ──────────────────

View File

@@ -9,10 +9,10 @@ import (
"strings"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/store"
"switchboard-core/triggers"
"armature/database"
"armature/models"
"armature/store"
"armature/triggers"
)
// ExtensionHandler serves extension management endpoints.

View File

@@ -7,11 +7,11 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/auth"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/notifications"
"switchboard-core/store"
"armature/auth"
"armature/database"
"armature/models"
"armature/notifications"
"armature/store"
)
// ── Request types ───────────────────────────

View File

@@ -8,14 +8,14 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/config"
"switchboard-core/database"
"switchboard-core/middleware"
"switchboard-core/models"
"switchboard-core/notifications"
"switchboard-core/store"
postgres "switchboard-core/store/postgres"
sqlite "switchboard-core/store/sqlite"
"armature/config"
"armature/database"
"armature/middleware"
"armature/models"
"armature/notifications"
"armature/store"
postgres "armature/store/postgres"
sqlite "armature/store/sqlite"
)
// ── Notification Test Harness ──────────────

View File

@@ -10,10 +10,10 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/events"
"switchboard-core/models"
"switchboard-core/notifications"
"switchboard-core/store"
"armature/events"
"armature/models"
"armature/notifications"
"armature/store"
)
// ── Handler ─────────────────────────────────

View File

@@ -14,7 +14,7 @@ import (
"log"
"strings"
"switchboard-core/store"
"armature/store"
"gopkg.in/yaml.v3"
)

View File

@@ -5,17 +5,17 @@ import (
"encoding/json"
"testing"
"switchboard-core/database"
"switchboard-core/store"
postgres "switchboard-core/store/postgres"
sqlite "switchboard-core/store/sqlite"
"armature/database"
"armature/store"
postgres "armature/store/postgres"
sqlite "armature/store/sqlite"
)
// Minimal static spec for testing — valid OpenAPI 3.0 structure.
var testStaticSpec = []byte(`
openapi: "3.0.3"
info:
title: Switchboard Core
title: Armature
version: "${VERSION}"
paths:
/api/v1/health:

View File

@@ -8,13 +8,13 @@ import (
"github.com/gin-gonic/gin"
authpkg "switchboard-core/auth"
"switchboard-core/config"
"switchboard-core/database"
"switchboard-core/middleware"
"switchboard-core/store"
postgres "switchboard-core/store/postgres"
sqlite "switchboard-core/store/sqlite"
authpkg "armature/auth"
"armature/config"
"armature/database"
"armature/middleware"
"armature/store"
postgres "armature/store/postgres"
sqlite "armature/store/sqlite"
)
// ── Dormant Test Harness ──────────────────────

View File

@@ -29,7 +29,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"armature/store"
)
// RegistryEntry represents a single package in the registry.

View File

@@ -15,11 +15,11 @@ import (
"github.com/gin-gonic/gin"
"go.starlark.net/starlark"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/sandbox"
"switchboard-core/store"
"switchboard-core/triggers"
"armature/database"
"armature/models"
"armature/sandbox"
"armature/store"
"armature/triggers"
)
// validPackageID matches lowercase alphanumeric slugs with optional hyphens.

View File

@@ -15,11 +15,11 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/sandbox"
"switchboard-core/store"
"switchboard-core/triggers"
"armature/database"
"armature/models"
"armature/sandbox"
"armature/store"
"armature/triggers"
)
// defaultBundledPackages is the curated set of packages installed by default.

View File

@@ -8,10 +8,10 @@ import (
"path/filepath"
"testing"
"switchboard-core/database"
"switchboard-core/store"
postgres "switchboard-core/store/postgres"
sqlite "switchboard-core/store/sqlite"
"armature/database"
"armature/store"
postgres "armature/store/postgres"
sqlite "armature/store/sqlite"
)
// ── Test helpers ──────────────────────────────

View File

@@ -15,8 +15,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/database"
"switchboard-core/store"
"armature/database"
"armature/store"
)
// ── Helpers ────────────────────────────────────

View File

@@ -14,7 +14,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"armature/store"
)
const presenceOnlineThreshold = 90 * time.Second

View File

@@ -15,8 +15,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/auth"
"switchboard-core/store"
"armature/auth"
"armature/store"
)
// ProfileBootstrapHandler serves the combined boot payload.

View File

@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/auth"
"switchboard-core/store"
"armature/auth"
"armature/store"
)
// ProfilePermissionsHandler exposes the current user's resolved permissions.

View File

@@ -8,7 +8,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/lib/pq"
"switchboard-core/database"
"armature/database"
)
// ── SafeJSON ────────────────────────────────

View File

@@ -7,9 +7,9 @@ import (
"github.com/gin-gonic/gin"
"github.com/robfig/cron/v3"
"switchboard-core/models"
"switchboard-core/store"
"switchboard-core/triggers"
"armature/models"
"armature/store"
"armature/triggers"
)
// ScheduleHandler provides CRUD for user-created scheduled tasks.

View File

@@ -14,8 +14,8 @@ import (
"github.com/gin-gonic/gin"
"golang.org/x/crypto/bcrypt"
"switchboard-core/crypto"
"switchboard-core/store"
"armature/crypto"
"armature/store"
)
// ── Request Types ───────────────────────────

View File

@@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/storage"
"armature/storage"
)
// storageConfigured is a package-level flag set during init.

View File

@@ -8,7 +8,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"armature/models"
)
// ListTeamConnections returns connections scoped to a team.

View File

@@ -12,7 +12,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"armature/store"
)
// TeamPackageSettingsHandler serves team-scoped package settings endpoints.

View File

@@ -10,10 +10,10 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/crypto"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/store"
"armature/crypto"
"armature/database"
"armature/models"
"armature/store"
)
// ── Request types ───────────────────────────

View File

@@ -13,7 +13,7 @@ import (
"github.com/golang-jwt/jwt/v5"
"github.com/google/uuid"
"switchboard-core/database"
"armature/database"
)
const testJWTSecret = "test-secret-key-for-handler-tests"
@@ -48,7 +48,7 @@ func makeToken(userID, email, _ string) string {
RegisteredClaims: jwt.RegisteredClaims{
IssuedAt: jwt.NewNumericDate(time.Now()),
ExpiresAt: jwt.NewNumericDate(time.Now().Add(15 * time.Minute)),
Issuer: "switchboard-core",
Issuer: "armature",
},
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)

View File

@@ -6,7 +6,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/database"
"armature/database"
_ "modernc.org/sqlite" // register sqlite driver for DB_DRIVER=sqlite
)

View File

@@ -7,9 +7,9 @@ import (
"encoding/json"
"log"
"switchboard-core/models"
"switchboard-core/store"
"switchboard-core/triggers"
"armature/models"
"armature/store"
"armature/triggers"
)
// manifestTrigger is the manifest.json trigger declaration shape.

View File

@@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"switchboard-core/triggers"
"armature/store"
"armature/triggers"
)
// TriggerHandler provides admin CRUD for extension-declared triggers.

View File

@@ -8,9 +8,9 @@ import (
"net/http"
"testing"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/store"
"armature/database"
"armature/models"
"armature/store"
)
// ═══════════════════════════════════════════════

View File

@@ -22,7 +22,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"armature/store"
)
// allowedNonGlobalPermissions is the set of permissions that non-admin

View File

@@ -7,9 +7,9 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"switchboard-core/store"
"switchboard-core/workflow"
"armature/models"
"armature/store"
"armature/workflow"
)
// ── Assignment Handlers ─────────────────────

View File

@@ -6,9 +6,9 @@ import (
"strings"
"testing"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/workflow"
"armature/database"
"armature/models"
"armature/workflow"
)
// testEngine creates a workflow engine with nil bus and runner (safe for tests).

View File

@@ -7,8 +7,8 @@ import (
"go.starlark.net/starlark"
"switchboard-core/sandbox"
"switchboard-core/store"
"armature/sandbox"
"armature/store"
)
// ── on_advance Hook ─────────────────────────

View File

@@ -8,8 +8,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"switchboard-core/workflow"
"armature/store"
"armature/workflow"
)
// ── Instance Handlers ───────────────────────

View File

@@ -15,8 +15,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"switchboard-core/store"
"armature/models"
"armature/store"
)
// WorkflowPackageHandler handles workflow package export and install.

View File

@@ -7,8 +7,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/store"
"switchboard-core/workflow"
"armature/store"
"armature/workflow"
)
// ── Public Workflow Handlers ───────

View File

@@ -5,9 +5,9 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"switchboard-core/store"
"switchboard-core/workflow"
"armature/models"
"armature/store"
"armature/workflow"
)
// ── Signoff Handlers ─────────────────

View File

@@ -7,11 +7,11 @@ import (
"testing"
"time"
"switchboard-core/database"
"switchboard-core/models"
"switchboard-core/store"
"switchboard-core/store/postgres"
"switchboard-core/store/sqlite"
"armature/database"
"armature/models"
"armature/store"
"armature/store/postgres"
"armature/store/sqlite"
)
// jsonEq compares two JSON byte slices ignoring whitespace and key order

View File

@@ -6,7 +6,7 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"armature/models"
)
// ── Team-Scoped Workflow Wrappers ────────────────

View File

@@ -10,8 +10,8 @@ import (
"github.com/gin-gonic/gin"
"switchboard-core/models"
"switchboard-core/store"
"armature/models"
"armature/store"
)
// ── Workflow Handler ────────────────────────