Skip to content

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

CommandParametersReturnsDescription
scan_profilesconfigPath, credentialsPathCloudProfile[]Read ~/.aws/config + SSO/STS cache
sync_profiles_for_identity_providerregion, startUrl, orgName, configPathSyncResultCall AWS SSO API to enumerate accounts/roles
login_profileprofileName, grantedUrl, grantedRegionvoidExecute aws sso login
logout_profileprofileName, configPath, credentialsPathvoidClear active profile + cache
try_silent_refreshprofileName, configPathbooleanAttempt aws sso login --no-browser
check_auth_statusprofileName, configPath, credentialsPathAuthStatusCheck SSO cache expiry
load_app_confignoneAppConfigRead ~/.config/mimic/config.json
save_app_configconfigvoidWrite ~/.config/mimic/config.json
set_default_profileprofileNamevoidWrite active_profile.sh
clear_default_profilenonevoidClear active_profile.sh
set_app_presencemodevoidShow/hide dock icon
cancel_loginprofileNamevoidSIGKILL child process
cancel_identity_syncsessionNamevoidCancel in-progress sync
update_trayprofilesvoidRebuild 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)
  • localStorage for 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.