1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

extension appsettings with runtime loadable props

This commit is contained in:
Kyle Spearrin 2017-08-07 21:08:15 -04:00
parent 0271c223a6
commit 4c46317f24
8 changed files with 25 additions and 6 deletions

View File

@ -71,7 +71,8 @@ gulp.task('min:js', ['clean:js'], function () {
'!' + paths.minJs,
'!' + paths.jsDir + 'fallback*.js',
'!' + paths.jsDir + 'u2f-connector.js',
'!' + paths.jsDir + 'duo.js'
'!' + paths.jsDir + 'duo.js',
'!' + paths.jsDir + 'settings.js'
], { base: '.' })
.pipe(concat(paths.concatJsDest))
.pipe(uglify())
@ -332,6 +333,10 @@ gulp.task('dist:move', function () {
src: paths.jsDir + 'duo.js',
dest: paths.dist + 'js'
},
{
src: paths.jsDir + 'settings.js',
dest: paths.dist + 'js'
},
{
src: paths.jsDir + 'bw.min.js',
dest: paths.dist + 'js'

View File

@ -3,6 +3,9 @@
"apiUri": "https://preview-api.bitwarden.com",
"identityUri": "https://preview-identity.bitwarden.com",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2"
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
"whitelistDomains": [
"preview-api.bitwarden.com"
]
}
}

View File

@ -3,6 +3,9 @@
"apiUri": "https://api.bitwarden.com",
"identityUri": "https://identity.bitwarden.com",
"stripeKey": "pk_live_bpN0P37nMxrMQkcaHXtAybJk",
"braintreeKey": "production_qfbsv8kc_njj2zjtyngtjmbjd"
"braintreeKey": "production_qfbsv8kc_njj2zjtyngtjmbjd",
"whitelistDomains": [
"api.bitwarden.com"
]
}
}

View File

@ -3,6 +3,9 @@
"apiUri": "http://localhost:4000",
"identityUri": "http://localhost:33656",
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2"
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
"whitelistDomains": [
"localhost"
]
}
}

View File

@ -3,11 +3,13 @@ angular
.config(function ($stateProvider, $urlRouterProvider, $httpProvider, jwtInterceptorProvider, jwtOptionsProvider,
$uibTooltipProvider, toastrConfig, $locationProvider, $qProvider, stripeProvider, appSettings) {
angular.extend(appSettings, window.bitwardenAppSettings);
$qProvider.errorOnUnhandledRejections(false);
$locationProvider.hashPrefix('');
jwtOptionsProvider.config({
urlParam: 'access_token3',
whiteListedDomains: ['api.bitwarden.com', 'preview-api.bitwarden.com', 'localhost', '192.168.1.3']
whiteListedDomains: appSettings.whitelistDomains
});
var refreshPromise;
jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (options, tokenService, authService) {

View File

@ -1,2 +1,2 @@
angular.module("bit")
.constant("appSettings", {"apiUri":"https://api.bitwarden.com","identityUri":"https://identity.bitwarden.com","stripeKey":"pk_live_bpN0P37nMxrMQkcaHXtAybJk","braintreeKey":"production_qfbsv8kc_njj2zjtyngtjmbjd","version":"1.14.3","environment":"Production"});
.constant("appSettings", {"apiUri":"https://api.bitwarden.com","identityUri":"https://identity.bitwarden.com","stripeKey":"pk_live_bpN0P37nMxrMQkcaHXtAybJk","braintreeKey":"production_qfbsv8kc_njj2zjtyngtjmbjd","whitelistDomains":["api.bitwarden.com"],"version":"1.14.3","environment":"Production"});

View File

@ -85,6 +85,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js"
integrity="sha384-AH/e+s4V4kUifvnNED2x1XZqArO5qTFU4YKRzUXbz4IgPG1H0Xmz6fP1XUmO4vT/" crossorigin="anonymous"></script>
<script src="js/fallback-scripts.min.js?v=<!-- @echo cacheTag !>"></script>
<script src="js/settings.js?v=<!-- @echo cacheTag !>"></script>
<script src="js/lib.min.js?v=<!-- @echo cacheTag !>"></script>
<script src="js/bw.min.js?v=<!-- @echo cacheTag !>"></script>
@ -102,6 +103,7 @@
<script src="lib/clipboard/clipboard.js"></script>
<script src="js/duo.js"></script>
<script src="js/webcrypto-shim.js"></script>
<script src="js/settings.js"></script>
<script src="lib/angular/angular.js"></script>
<script src="lib/angular-promise-polyfill/index.js"></script>

1
src/js/settings.js Normal file
View File

@ -0,0 +1 @@
var bitwardenAppSettings = {};