arduino_secrets.h
removal system corrupts sketch code if #include
directive is commented
#2489
Open
3 tasks done
Labels
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
Arduino Web Editor has a "Secret tab" feature that makes it easy to share sketches without accidentally exposing sensitive data (e.g., passwords or tokens).
The values of these secrets can be defined on Arduino Cloud via a form in the "Secret" tab in Arduino Web Editor.
On Arduino Cloud, secrets are stored in a secure database and the secret macro values populated from there.
The secrets database capability is not available when using the Arduino IDE, so a more conventional approach is taken by defining the secrets macros in a header file named
arduino_secrets.h
, then adding an#include
directive for the file to sketch files that reference the macros. When a Cloud sketch is pushed to the Arduino Cloud server, these#include
directives are removed from the sketch cod.🐛 If the
#include
directive is commented out, the removal code leaves the comment in place and moves the next line of code up, resulting in that code being incorrectly commented out. Depending on what that line is, this could completely break the sketch program.To reproduce
A new sketch will open in an Arduino IDE window.
🐛 The sketch code has been corrupted:
Expected behavior
Only real
#include
directives forarduino_secrets.h
are removed. If the string happens to be present in a comment, Arduino IDE should just leave it alone.Removal of
#include "arduino_secrets.h"
never harms the other code in the sketch.Arduino IDE version
aa9b10d
Operating system
Operating system version
Additional context
Originally reported at https://forum.arduino.cc/t/web-editor-deletes-include-from-pushed-code/1289947
Related
#include
directives forarduino_secrets.h
#447Issue checklist
The text was updated successfully, but these errors were encountered: