What is right way to secure object's properties in configuration page using __meta property

@samuelpares,
Good Day!
you need to mention only the top-level key in the secure array, and it is not possible to mention the child keys.

eg:

function postConfigs() {
  var params = {
    param1: "value",
    authentication: {},
  };
  params.authentication = {
    fdDomain: $("#fd-domain").val(),
    fdUserID: $("#fd-user-id").val(),
    fdUserApiKey: $("#fd-api-key").val(),
    rtcServerURI: $("#rtc-server-uri").val(),
    rtcTunnel: $("#rtc-tunnel").val(),
    rtcUserName: $("#rtc-user-name").val(),
    rtcUserPassword: $("#rtc-user-pass").val(),
    wafUserName: $("#rtc-waf-user-name").val(),
    wafUserPassword: $("#rtc-waf-user-pass").val(),
    vtDomain: $("#vt-domain").val(),
    vtUsername: $("#vt-user-name").val(),
    vtPassword: $("#vt-user-pass").val(),
    pgHost: $("#pg-domain").val(),
    pgPort: $("#pg-port").val(),
    pgUser: $("#pg-user-name").val(),
    pgPassword: $("#pg-user-pass").val(),
    pgDatabase: $("#pg-database").val(),
  };
  params["__meta"] = {
    secure: [
      "authentication",
    ],
  };
  return params;
}

Hope it helps :slight_smile:

Thanks

3 Likes