If you've ever seen a tutorial that says WIFI_PASSWORD = "my_real_password" right at the top of the code, you've seen the problem this feature is trying to solve. The moment you share that code — on GitHub, with a friend, in a school project folder — your real Wi-Fi password goes with it. The OMS Edge Gateway's idea is to keep secrets like Wi-Fi passwords and cloud API keys in a separate secure "Vault" on the device itself, so your actual program code never contains them at all.
[!IMPORTANT] This is the least complete extension in this chapter — read the Simulator Behavior section below before relying on it. Several blocks here don't yet do everything their name and tooltip suggest, in both languages, not just in the simulator. This page documents the real, current behavior plainly rather than the aspirational one.
1. Real-World Uses
The underlying idea — keeping secrets out of source code — is a genuinely important real-world practice, even though OMS's implementation of it here is still early:
- Sharing project code safely — publishing your Blockly project or exported code without accidentally leaking your home Wi-Fi password to anyone who reads it.
- Fleet identification — giving every deployed device its own unique ID (derived from its hardware MAC address) so a dashboard managing many boards can tell them apart.
- Separating secrets from logic — a general best practice in real professional IoT products: the code that reads a sensor shouldn't need to also contain the password to your cloud account.
2. Vault Provisioning Architecture
Device credentials (Wi-Fi SSID, Password, Auth Tokens) are meant to be flashed once into the board's secure non-volatile storage (ESP32 Preferences / MicroPython oms_vault.py), configured through the IDE's own Settings panel rather than typed into your Blockly project. Code blocks then reference the Vault at runtime instead of containing the actual secret values.
