<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How should Cloud Code read a Global Property flagged Secret?]]></title><description><![CDATA[<p dir="auto">A Global Property (<code>String</code>, Category <code>internal</code>, <strong>Secret: checked</strong>) holds a bearer token that two scheduled Cloud Code scripts need in order to call our own backend. Cloud Code cannot read it.</p>
<p dir="auto">The script does:</p>
<pre><code class="language-javascript">var res = bridge.getGlobalAppServiceProxy().readSelectedProperties(["MY_SECRET_PROPERTY"]);
if (!res || res.status !== 200 || !res.data || !res.data["MY_SECRET_PROPERTY"]) {
    bridge.logError("failed to read MY_SECRET_PROPERTY");
}
</code></pre>
<p dir="auto">Running it from the portal returns:</p>
<pre><code class="language-json">{
  "response": {
    "logList": [
      { "level": "error", "message": "failed to read MY_SECRET_PROPERTY" },
      { "level": "error", "message": "skipped POST: bearer token unavailable" }
    ],
    "callStats": { "globalApp": { "READ_SELECTED_PROPERTIES": 1 } },
    "callCounts": { "total": 4, "api": 2 },
    "status": 200
  },
  "duration": 17
}
</code></pre>
<p dir="auto">So the call is made and succeeds — <code>READ_SELECTED_PROPERTIES: 1</code>, <code>status 200</code>, no exception — but the requested key is absent from <code>data</code>. It is silently filtered rather than reported.</p>
<p dir="auto">A <strong>non-secret</strong> property in the same app is read successfully by the same proxy on every run. The Secret flag is the only difference between the two. Support confirmed this behavior is expected, and I see no <code>Sys</code>-prefixed read method for properties in the docs — only <code>SysCreateProperty*</code> / <code>SysUpdateProperty*</code>.</p>
<p dir="auto">The suggested workaround was to keep the secret in our server environment and read it from there, but Cloud Code runs on brainCloud's infrastructure — a <code>.ccjs</code> script has no access to our environment variables or secrets manager. Global Properties appears to be the only config store Cloud Code can read, so flagging one Secret makes it unreachable by the layer that needs it.</p>
<h3>Questions</h3>
<ol>
<li>Is there any supported way to read a Secret Global Property from Cloud Code?</li>
<li>If not: what is the recommended pattern for a secret that <strong>Cloud Code itself</strong> consumes, rather than one our backend consumes? Unchecking Secret would expose the token to any authenticated client via <code>GlobalApp.ReadProperties()</code>, which we can't accept in production.</li>
</ol>
<p dir="auto">Thank you.</p>
]]></description><link>https://forums.getbraincloud.com/topic/384/how-should-cloud-code-read-a-global-property-flagged-secret</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 19:21:25 GMT</lastBuildDate><atom:link href="https://forums.getbraincloud.com/topic/384.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Aug 2026 11:14:16 GMT</pubDate><ttl>60</ttl></channel></rss>