How to hide the source data generated pages

  1. #1

    How to hide the source data generated pages

    I'm in the IE browser, use the View Source and found the data to see Store, this should be unsafe, is there any way to hide the data.

    In the example: https://examples1.ext.net/Examples/G...ta/DataReader/
    , View the source code as follows:
    <![CDATA[
    Ext.net.ResourceMgr.init({id:"ctl04",BLANK_IMAGE_U RL:"/extjs/resources/images/default/s-gif/ext.axd",aspForm:"ctl01",theme:"blue"});Ext.onRead y(function(){Ext.QuickTips.init();this.Store1=new Ext.ux.data.PagingStore({proxyId:"Store1",autoLoad :true,reader:new Ext.data.JsonReader({fields:[{name:"SupplierID"},{name:"CompanyName"},{name:"Co ntactName"},{name:"ContactTitle"}]}),directEventConfig:{},proxy:new Ext.data.PagingMemoryProxy([{"SupplierID":1,"CompanyName":"Exotic Liquids222","ContactName":"Charlotte Cooper","ContactTitle":"Purchasing Manager"},{"SupplierID":2,"CompanyName":"New Orleans Cajun Delights","ContactName":"Shelley Burke","ContactTitle":"Order Administrator"},{"SupplierID":3,"CompanyName":"Gra ndma Kelly's Homestead","ContactName":"Regina Murphy","ContactTitle":"Sales Representative"},{"SupplierID":4,"CompanyName":"To kyo Traders","ContactName":"Yoshi Nagase","ContactTitle":"Marketing Manager"},{"SupplierID":5,"CompanyName":"Cooperati va de Quesos 'Las Cabras'","ContactName":"Antonio del Valle Saavedra","ContactTitle":"89089Export Administrator"},{"SupplierID":6,"CompanyName":"May umi's Testing Data","ContactName":"Mayumi Ohno","ContactTitle":"Marketing Representative"},{"SupplierID":7,"CompanyName":"Pa vlova, Ltd.","ContactName":"Ian Devling","ContactTitle":"Marketing Manager"},{"SupplierID":8,"CompanyName":"Specialty Biscuits, Ltd.","ContactName":"Peter Wilson","ContactTitle":""},{"SupplierID":9,"Compan yName":"PB Knackebrod AB","ContactName":"Lars Peterson","ContactTitle":"Sales Agent"},{"SupplierID":10,"CompanyName":"Refrescos Americanas LTDA","ContactName":"Carlos Diaz","ContactTitle":"Marketing Manager"},{"SupplierID":11,"CompanyName":"Heli Su?waren GmbH & Co. KG","ContactName":"Petra Winkler","ContactTitle":"fhfgh"},{"SupplierID":12, "CompanyName":"Plutzer Lebensmittelgro?markte AG","ContactName":"Martin Bein","ContactTitle":"International Marketing Mgr."},{"SupplierID":13,"CompanyName":"Nord-Ost-Fisch Handelsgesellschaft mbH","ContactName":"ghgfhfhgf","ContactTitle":"Coo rdinator Foreign Markets"},{"SupplierID":14,"CompanyName":"Formaggi Fortini s.r.l.","ContactName":"Elio Rossi","ContactTitle":"Sales Representative"},{"SupplierID":15,"CompanyName":"N orske Meierier","ContactName":"Beate Vileid","ContactTitle":"Marketing Manager"},{"SupplierID":16,"CompanyName":"Bigfoot Breweries","ContactName":"Cheryl Saylor","ContactTitle":"Regional Account Rep."},{"SupplierID":17,"CompanyName":"Svensk Sjofoda AB","ContactName":"Michael Bjorn","ContactTitle":"Sales Representative"},{"SupplierID":18,"CompanyName":"A ux joyeux ecclesiastiquesdflkj","ContactName":"cvxvlk","Cont actTitle":"Sales Managghdfgderlkj"},{"SupplierID":19,"CompanyName": "New England Seafood Cannery","ContactName":"Robb Merchant","ContactTitle":"Wholesale Account Agent"},{"SupplierID":20,"CompanyName":"Leka Trading","ContactName":"Chandra Leka","ContactTitle":"Owner"},{"SupplierID":21,"Co mpanyName":"Lyngbysild","ContactName":"Niels Petersen","ContactTitle":"Sales Manager"},{"SupplierID":22,"CompanyName":"Zaanse Snoepfabriek","ContactName":"Dirk Luchte","ContactTitle":"Accounting Managerasdasd"},{"SupplierID":23,"CompanyName":"Ka rkki Oy","ContactName":"Anne Heikkonen","ContactTitle":"Product Manager"},{"SupplierID":24,"CompanyName":"G'day, Matehhhh","ContactName":"Wendy Mackenzie","ContactTitle":"Sales Rep"},{"SupplierID":25,"CompanyName":"Ma Maisonwsfd","ContactName":"Jean-Guy Lauzon","ContactTitle":"fghgfh"},{"SupplierID":26, "CompanyName":"Pasta Buttini s.r.l.1","ContactName":"Giovanni Giudici","ContactTitle":"Order Administrator"},{"SupplierID":27,"CompanyName":"Es cargots Nouveauxa","ContactName":"Marie Delamarefdsf","ContactTitle":"Sales Manager"},{"SupplierID":28,"CompanyName":"Gai paturage","ContactName":"Eliane Noz","ContactTitle":"Sales Representativeghghgfh"},{"SupplierID":29,"CompanyN ame":"Forets d'erablesa","ContactName":"Chantal Goulet","ContactTitle":"Accounting Manager"},{"SupplierID":35,"CompanyName":"sdfdf"," ContactName":null,"ContactTitle":"jg"},{"SupplierI D":37,"CompanyName":"asdfkjh","ContactName":"laksj hdfalksfh","ContactTitle":"alskjdhalkshasdasd"},{" SupplierID":42,"CompanyName":"sgsdf","ContactName" :"sfdgggggggggggg","ContactTitle":""},{"SupplierID ":48,"CompanyName":"dfdf","ContactName":"","Contac tTitle":"asdasd"},{"SupplierID":61,"CompanyName":" Mới","ContactName":"","ContactTitle":""},{"Supplie rID":62,"CompanyName":"dasdas","ContactName":"","C ontactTitle":""},{"SupplierID":72,"CompanyName":"C Labs","ContactName":null,"ContactTitle":"Consultan t"},{"SupplierID":74,"CompanyName":"test","Contact Name":"test1","ContactTitle":""},{"SupplierID":78, "CompanyName":"trg","ContactName":"","ContactTitle ":""},{"SupplierID":79,"CompanyName":"labhhhhhhhh" ,"ContactName":"jose","ContactTitle":"sales"},{"Su pplierID":80,"CompanyName":"jkk","ContactName":"kj k","ContactTitle":"k"},{"SupplierID":83,"CompanyNa me":"aS ","ContactName":"","ContactTitle":""},{"SupplierID ":93,"CompanyName":"wwww","ContactName":"","Contac tTitle":""},{"SupplierID":95,"CompanyName":"","Con tactName":"","ContactTitle":""},{"SupplierID":96," CompanyName":"","ContactName":"","ContactTitle":"" },{"SupplierID":97,"CompanyName":"yuyuu","ContactN ame":"","ContactTitle":""}], false),beforeLoadParams:function(store,options){if (!options.params){options.params = {};};Ext.apply(options.params,{});Ext.applyIf(opti ons.params,{"start":0,"limit":10});}});new Ext.net.GridPanel({id:"GridPanel1",renderTo:"GridP anel1_Container",height:320,width:600,bbar:{id:"ct l07",xtype:"ux.paging",displayInfo:true,pageSize:1 0,store:Store1,prependButtons:true},title:"DataRea der Grid",autoExpandColumn:"CompanyName",loadMask:{sho wMask:true},sm:this.ctl05=new Ext.grid.RowSelectionModel({proxyId:"ctl05"}),stor e:Store1,selectionSavingBuffer:10,cm:this.ctl06=ne w Ext.grid.ColumnModel({proxyId:"ctl06",columns:[{dataIndex:"SupplierID",header:"Supplier ID"},{dataIndex:"CompanyName",header:"Company Name",id:"CompanyName"},{dataIndex:"ContactName",h eader:"Contact Name"},{dataIndex:"ContactTitle",header:"Contact Title"}]})});});
    //]]>
    </script>
    Will the data like this: {"SupplierID": 62, "CompanyName": "dasdas", "ContactName": "", "ContactTitle": ""}
    Can not display?

    sorry, my English is bad, above content is to use Google Translate, please forgive me.
  2. #2

    How to hide the source data generated pages

    Hello,
    please I have the same question as was mentioned in text above. Please does any solution exist ?

    Regards
    Rosta
  3. #3
    Can you explain what it is that you wish to protect against? A safe assumption is that anything sent to the browser can be known by the user. If your only goal is to make the data not human-readable from View Source, you could either have the store make its own separate load request or obfuscate it using base64 to encode the JSON on the server and then decode on the client before loading, but neither of these will protect the data from someone who knows how to use the browser's developer tools. Alternatively, if your concern is about the data being visible in transit, then you should be using HTTPS.
  4. #4
    One option to "hide" the inline source is to set initScriptMode="Linked" within the <extnet> section of your Web.config.

    <extnet initScriptMode="Linked" />
    You can also set the value on the ResourceManager.

    <ext:ResourceManager runat="server" InitScriptMode="Linked" />
    Of course this doesn't actually "hide" the JavaScript source, which is always discoverable in a web app, but it does remove the source from being rendered inline on the Page.

    Hope this helps.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 2
    Last Post: Feb 07, 2013, 1:59 PM
  2. Replies: 0
    Last Post: Nov 08, 2011, 12:20 PM
  3. combobox data source
    By studentdev in forum 1.x Help
    Replies: 1
    Last Post: Feb 05, 2010, 5:50 AM
  4. [CLOSED] Web.Sitemap as data source for TreePanel
    By Steve in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Mar 16, 2009, 4:06 AM
  5. [CLOSED] Data Source as static web method
    By marcellus in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Dec 29, 2008, 11:29 AM

Posting Permissions