Conversation
- Replace hand-rolled base64 with base64 crate (wiki_connector.rs) - Replace XOR encryption with AES-GCM authenticated encryption - Fix mask_sensitive UTF-8 panic (chars().take(4) instead of byte slice) - Fix WebDAV first-entry removal safety (filter self-references) - Fix SFTP thread safety with actor pattern (dedicated worker thread) - Migrate TenantManager from in-memory JSON to SQLite - Migrate RbacManager from in-memory JSON to SQLite - Update memoryos-admin to use new async SQLite init - 22 new unit tests for tenant/rbac SQLite backend Co-Authored-By: smile_less_now@live.com <io.ivixivi@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…audit - config 0.15 drops yaml-rust dep (RUSTSEC-2024-0320) - git2 0.20 fixes unsound Buf deref (RUSTSEC-2026-0008) Co-Authored-By: smile_less_now@live.com <io.ivixivi@gmail.com>
…sqlx 0.8) Co-Authored-By: smile_less_now@live.com <io.ivixivi@gmail.com>
- Merge 3 separate cache steps into 1 with actions/cache@v4 + restore-keys - Remove redundant 'cargo build' step (cargo test already compiles) - Security Audit: use cargo-binstall for pre-built binary (~10s vs ~90s compile) - Dockerfile: add cargo-chef 3-phase build for dependency layer caching - Dockerfile: switch from nightly-slim to rust:1.83-slim-bookworm (stable) - Add CARGO_INCREMENTAL=0 for faster CI builds Co-Authored-By: smile_less_now@live.com <io.ivixivi@gmail.com>
Co-Authored-By: smile_less_now@live.com <io.ivixivi@gmail.com>
… MSRV 1.91+ Co-Authored-By: smile_less_now@live.com <io.ivixivi@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: review checklist fixes + migrate Tenant/RBAC to SQLite + CI optimization
Summary
Addresses 5 high-risk items from the PR #36 review checklist, migrates Tenant and RBAC persistence from in-memory JSON to SQLite, upgrades two flagged dependencies to resolve CI Security Audit failures, and optimizes CI pipeline speed.
Security fixes (wiki_connector.rs):
base64crate (v0.22)aes-gcmv0.10)mask_sensitiveUTF-8 panic: usechars().take(4)instead of byte slice&s[..4]Storage connector fixes:
ssh2::Sessionis notSend/Sync. ReplacedArc<Session>with actor pattern — dedicated worker thread receivesSftpCommandenums overmpscchannel, replies viaoneshotentries.remove(0)with path-basedretain()filter to properly exclude self-referencesTenant/RBAC migration:
TenantManagerandRbacManagerrewritten fromHashMap+ JSON file persistence to SQLite viasqlxwith_persistence(path)toasync fn new(db_path)memoryos-gatewayandmemoryos-admincallersDependency upgrades (CI Security Audit fix):
config0.13 → 0.15: dropsyaml-rustdependency (RUSTSEC-2024-0320)git20.19 → 0.20: fixes unsoundBufderef (RUSTSEC-2026-0008)--ignore RUSTSEC-2024-0363for sqlx 0.7.4 advisory (fix requires sqlx 0.8 major bump)CI pipeline optimization:
actions/cache@v4withrestore-keysfallbackcargo build --verbosestep (cargo test already compiles)cargo install cargo-audit(source compilation ~90s) tocargo binstall(pre-built binary ~10s)CARGO_INCREMENTAL=0for faster CI buildscargo-chef3-phase build (planner → dependencies → application) for Docker layer cachingrust:1.85-slim-bookwormtorust:slim-bookworm(latest stable) to satisfy AWS SDK MSRV ≥1.91Review & Testing Checklist for Human
rbac_users.json,tenants.json) are not migrated to new SQLite databases (rbac.db,tenants.db). If you have production data, you'll need a migration script or manual recreation.High Priority:
configcrate 0.13→0.15 is a major version jump. Underlying parsers changed (yaml-rust→yaml-rust2, toml 0.5→0.9, rust-ini 0.18→0.21). VerifyConfigManagerloads your existingconfig.tomlcorrectly — subtle parsing behavior differences are possible.rust:slim-bookwormtag. Will track latest stable Rust. If a future Rust version introduces breaking changes, Docker builds could fail. Consider pinning torust:1.93-slim-bookwormif reproducibility is critical.SftpConnectoris dropped, does the worker thread exit cleanly? (It should, since droppingcmd_txcausesblocking_recv()to returnNone)enabledcolumn stored as INTEGER (0/1) but queried asbool. Verifysqlx::FromRowhandles this correctly.Medium Priority:
/and verify it doesn't include itself in results.git20.20 upgrade didn't break wiki-gen Git connector: clone a repo, list files, read file contents.recipe.json, Docker builds will fail with "package not found" errors.Test Plan
~/.memoryos/, create tenant + user, restart services, verify data persistsconfig.tomlstill loads correctly afterconfigcrate upgradelist_files()/read_file()concurrently from multiple tasks, verify no panics/, verify no empty entriesgit20.20Notes
sftpsubsession per command (could be optimized to reuse one session)sqlx-postgrespulled in as transitive dep even though only sqlite is used (not a blocker)Link to Devin run: https://app.devin.ai/sessions/ac6bb92809d143ce8415f99c8b559904
Requested by: @ioivixivi-application