package cabana import ( "time" "gorm.io/gorm" ) // AdminAPIRoutes exposes the admin API route inventory (method plus // prefix-relative path) to the external conformance test. func AdminAPIRoutes() []string { out := make([]string, 0, len(phase09Routes)) for _, route := range phase09Routes { if !route.spa { out = append(out, route.key) } } return out } // IssueTestAPIToken mints a personal API token for ownerID with the given // scopes and optional expiry. Used by external Postgres smoke tests before // the HTTP create route exists. func IssueTestAPIToken(db *gorm.DB, ownerID uint, scopes []string, expiresAt *time.Time) (plain string, err error) { plain, _, err = insertAPIToken(db, ownerID, "test", scopes, expiresAt) return plain, err }