IPC layer
Mimic uses Tauri's invoke() for all Rust ↔ TypeScript communication. src/lib/ipc.ts wraps every IPC call and provides mock fallbacks for browser preview.
Commands
| Command | Parameters | Returns | Description |
|---|---|---|---|
scan_profiles | configPath, credentialsPath | CloudProfile[] | Read ~/.aws/config + SSO/STS cache |
sync_profiles_for_identity_provider | region, startUrl, orgName, configPath | SyncResult | Call AWS SSO API to enumerate accounts/roles |
login_profile | profileName, grantedUrl, grantedRegion | void | Execute aws sso login |
logout_profile | profileName, configPath, credentialsPath | void | Clear active profile + cache |
try_silent_refresh | profileName, configPath | boolean | Attempt aws sso login --no-browser |
check_auth_status | profileName, configPath, credentialsPath | AuthStatus | Check SSO cache expiry |
load_app_config | none | AppConfig | Read ~/.config/mimic/config.json |
save_app_config | config | void | Write ~/.config/mimic/config.json |
set_default_profile | profileName | void | Write active_profile.sh |
clear_default_profile | none | void | Clear active_profile.sh |
set_app_presence | mode | void | Show/hide dock icon |
cancel_login | profileName | void | SIGKILL child process |
cancel_identity_sync | sessionName | void | Cancel in-progress sync |
update_tray | profiles | void | Rebuild tray menu |
Browser preview fallback
When __TAURI_INTERNALS__ is not available (browser preview via npm run dev), IPC calls fall back to:
- Mock data (
src/lib/mockData.ts) localStoragefor config operations
This allows frontend development without the Tauri backend running.
Throttling
The sync_profiles_for_identity_provider command enforces a 50ms minimum interval between API calls to avoid throttling from Identity Center.