aki-angular-secure-config
Version:
The `aki-angular-secure-config` is a new npm package developed to address a security vulnerability in Angular applications. This package ensures that sensitive configuration data in `config.json` is protected from being inspected or extracted via browser
3 lines (2 loc) • 4.93 kB
JavaScript
const _0x1c1ca8=_0xf819;(function(_0x5cf3ae,_0x4e89b0){const _0xe1d8c7=_0xf819,_0x5ced4b=_0x5cf3ae();while(!![]){try{const _0x1861ea=parseInt(_0xe1d8c7(0x13d))/0x1*(-parseInt(_0xe1d8c7(0x148))/0x2)+-parseInt(_0xe1d8c7(0x157))/0x3+-parseInt(_0xe1d8c7(0x146))/0x4*(parseInt(_0xe1d8c7(0x152))/0x5)+-parseInt(_0xe1d8c7(0x153))/0x6*(parseInt(_0xe1d8c7(0x150))/0x7)+-parseInt(_0xe1d8c7(0x155))/0x8+parseInt(_0xe1d8c7(0x13c))/0x9+parseInt(_0xe1d8c7(0x154))/0xa;if(_0x1861ea===_0x4e89b0)break;else _0x5ced4b['push'](_0x5ced4b['shift']());}catch(_0x4ab563){_0x5ced4b['push'](_0x5ced4b['shift']());}}}(_0x1b98,0xb9a71));function _0x1b98(){const _0x239714=['--npmrc-username','916cAylUe','log','95002mRTCHZ','join','argv','\x0aUsage:\x20aki-angular-secure-config\x20<command>\x20[options]\x0a\x0aMore\x20info:\x20aki-angular-secure-config\x20help\x20\x0a\x20\x20','message','--include-dockerfile','--config-file-name','slice','663733KbLpdu','includes','5615qYctJY','6xmuOsS','30990030pCfMAn','9308376NZIdfq','indexOf','2722173cuycbq','run','Error\x20executing\x20script:\x20','--npmrc-username\x20','Script\x20stdout:\x20','--npmrc-pat','Script\x20stderr:\x20','--npmrc-pat\x20','--config-file-name\x20','9309366lifToi','20kKjzYR','--include-dockerfile\x20','exit','config.json','dirname','--npmrc-src','--use-yarn','--npmrc-src\x20'];_0x1b98=function(){return _0x239714;};return _0x1b98();}import _0x1d933f from'path';import{fileURLToPath}from'url';import{exec}from'child_process';function _0xf819(_0x48a2e3,_0x3cfee5){const _0x1b98dc=_0x1b98();return _0xf819=function(_0xf819ba,_0x4cf031){_0xf819ba=_0xf819ba-0x138;let _0x350371=_0x1b98dc[_0xf819ba];return _0x350371;},_0xf819(_0x48a2e3,_0x3cfee5);}const __filename=fileURLToPath(import.meta['url']),__dirname=_0x1d933f[_0x1c1ca8(0x141)](__filename),scriptPath=_0x1d933f[_0x1c1ca8(0x149)](__dirname,'../index.js'),args=process[_0x1c1ca8(0x14a)][_0x1c1ca8(0x14f)](0x2),showHelp=()=>{console['log']('\x0aUsage:\x20aki-angular-secure-config\x20<command>\x20[options]\x0a\x0aCommands:\x0a\x20\x20help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20package\x20help\x0a\x20\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Execute\x20the\x20main\x20script\x20to\x20download\x20files\x20and\x20install\x20dependencies\x0a\x0aOptions:\x0a\x20\x20--use-yarn\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Use\x20yarn\x20instead\x20of\x20npm\x20to\x20install\x20dependencies\x0a\x20\x20--include-dockerfile\x20\x20\x20\x20Download\x20Dockerfile\x20with\x20its\x20dependencies\x0a\x20\x20--config-file-name\x20\x20\x20\x20\x20\x20Specify\x20the\x20name\x20of\x20the\x20configuration\x20file\x20(default:\x20config.json)\x0a\x20\x20--npmrc-src\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Specify\x20the\x20npm\x20registry\x20source\x0a\x20\x20--npmrc-username\x20\x20\x20\x20\x20\x20\x20\x20Specify\x20the\x20npm\x20registry\x20username\x0a\x20\x20--npmrc-pat\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Specify\x20the\x20npm\x20registry\x20personal\x20access\x20token\x0a\x0aExamples:\x0a\x20\x20aki-angular-secure-config\x20help\x0a\x20\x20aki-angular-secure-config\x20run\x0a\x20\x20aki-angular-secure-config\x20run\x20--use-yarn\x0a\x20\x20aki-angular-secure-config\x20run\x20--include-dockerfile\x0a\x20\x20aki-angular-secure-config\x20run\x20--config-file-name\x20custom-config.json\x0a\x20\x20aki-angular-secure-config\x20run\x20--npmrc-src\x20my-registry\x20--npmrc-username\x20my-username\x20--npmrc-pat\x20my-pat\x0a\x20\x20');};if(args[_0x1c1ca8(0x151)]('help'))showHelp();else{if(args[_0x1c1ca8(0x151)](_0x1c1ca8(0x158))){let runArgs='',configFileName=_0x1c1ca8(0x140);if(args[_0x1c1ca8(0x151)](_0x1c1ca8(0x143)))runArgs+='--use-yarn\x20';if(args[_0x1c1ca8(0x151)](_0x1c1ca8(0x14d)))runArgs+=_0x1c1ca8(0x13e);const configFileNameIndex=args[_0x1c1ca8(0x156)](_0x1c1ca8(0x14e));configFileNameIndex!==-0x1&&args[configFileNameIndex+0x1]&&(configFileName=args[configFileNameIndex+0x1],runArgs+=_0x1c1ca8(0x13b)+configFileName+'\x20');const npmrcSrcIndex=args[_0x1c1ca8(0x156)](_0x1c1ca8(0x142)),npmrcUsernameIndex=args[_0x1c1ca8(0x156)](_0x1c1ca8(0x145)),npmrcPatIndex=args['indexOf'](_0x1c1ca8(0x138));npmrcSrcIndex!==-0x1&&args[npmrcSrcIndex+0x1]&&(runArgs+=_0x1c1ca8(0x144)+args[npmrcSrcIndex+0x1]+'\x20'),npmrcUsernameIndex!==-0x1&&args[npmrcUsernameIndex+0x1]&&(runArgs+=_0x1c1ca8(0x15a)+args[npmrcUsernameIndex+0x1]+'\x20'),npmrcPatIndex!==-0x1&&args[npmrcPatIndex+0x1]&&(runArgs+=_0x1c1ca8(0x13a)+args[npmrcPatIndex+0x1]+'\x20'),exec('node\x20\x22'+scriptPath+'\x22\x20'+runArgs,(_0x1766c0,_0xd116cb,_0x5c4c10)=>{const _0x82baa8=_0x1c1ca8;_0x1766c0&&(console['error'](_0x82baa8(0x159)+_0x1766c0[_0x82baa8(0x14c)]),process[_0x82baa8(0x13f)](0x1)),_0x5c4c10&&(console['error'](_0x82baa8(0x139)+_0x5c4c10),process[_0x82baa8(0x13f)](0x1)),console[_0x82baa8(0x147)](_0x82baa8(0x15b)+_0xd116cb);});}else console[_0x1c1ca8(0x147)](_0x1c1ca8(0x14b));}