make H2 database console available

This commit is contained in:
2016-07-16 23:10:04 +02:00
parent 3bcd040867
commit 3b711d47c5
3 changed files with 8 additions and 5 deletions
@@ -17,7 +17,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("adam@mail.com").password("test").roles("USER", "ADMIN").and()
.withUser("betty@mail.com").password("test").roles("USER");
.withUser("tilman").password("test").roles("USER", "ADMIN").and()
.withUser("anica").password("test").roles("USER");
}
@Override
@@ -25,11 +26,13 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
// Basis-Schutz: Nur autorisierte Zugriffe (feingranulare Steuerung über Assertions)
http.authorizeRequests()
.antMatchers(HttpMethod.GET, "/public/**").permitAll()
.antMatchers("/console/**").permitAll()
.anyRequest().authenticated();
http.httpBasic(); // XXX mit HTTP Basic Auth funktioniert der Logout nicht richtig
// http.formLogin();
http.csrf().disable(); // XXX später wieder aktivieren
http.headers().frameOptions().disable();
}
}
+1 -1
View File
@@ -19,7 +19,6 @@ INSERT INTO Transaction (id, amount, account_id, category_id, date, description,
(NULL, -4.81, 1, 3, '2016-04-18', 'Currywurst (Auslage Adam)', 1),
(NULL, -4.50, 1, 3, '2016-04-19', 'Currywurst', null),
(NULL, -4.50, 1, 3, '2016-04-20', 'Currywurst', null),
(NULL, -4.50, 2, 3, '2016-04-20', 'Currywurst', null),
(NULL, -4.09, 1, 3, '2016-04-18', 'Currywurst-Frühstück', null),
(NULL, -4.90, 1, 3, '2016-04-18', 'Currywurst (Auslage Betty)', 2),
(NULL, -8.90, 1, 3, '2016-04-18', 'Curry beim Inder (Auslage Adam)', 1),
@@ -28,6 +27,7 @@ INSERT INTO Transaction (id, amount, account_id, category_id, date, description,
(NULL, -10, 1, 4, '2016-04-14 10:03:00', 'Entnahme Adam', 1),
(NULL, 1340.22, 2, 5, '2016-04-02', 'Gehalt Adam', null),
(NULL, -4.50, 2, 6, '2016-04-20', 'WebPack', null),
(NULL, -12.90, 2, 6, '2016-04-16', 'Host Europe', null);
+3 -3
View File
@@ -80,7 +80,7 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
}
// get recent transactions
var transactions = $resource('http://localhost:8080/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc' }).get();
var transactions = $resource('/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc' }).get();
transactions.$promise.then(function(data) {
$scope.transactions = transactions._embedded.transactions;
$scope.nextPageAvailable = (transactions.page.totalPages !== transactions.page.number + 1);
@@ -172,7 +172,7 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
$scope.moreTransactions = function() {
if ($scope.nextPageAvailable) {
$scope.pageNumber++;
var transactions = $resource('http://localhost:8080/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc', page: $scope.pageNumber }).get();
var transactions = $resource('/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc', page: $scope.pageNumber }).get();
transactions.$promise.then(function(data) {
for (i = 0; i < transactions._embedded.transactions.length; i++) {
transactions._embedded.transactions[i].amount = numberToAmount(transactions._embedded.transactions[i].amount);
@@ -187,7 +187,7 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
};
$scope.updateSuggestions = function(val) {
var suggestions = $resource('http://localhost:8080/transactions/search/descriptions', { accountId: $scope.account.id, prefix: val.toLowerCase() }).get();
var suggestions = $resource('/transactions/search/descriptions', { accountId: $scope.account.id, prefix: val.toLowerCase() }).get();
return suggestions.$promise.then(function(data) {
var newSuggestions = new Array(suggestions._embedded.transactions.length);
for (i = 0; i < suggestions._embedded.transactions.length; i++) {