fixed authentication
This commit is contained in:
@@ -48,7 +48,8 @@ public class AuthConfiguration extends WebSecurityConfigurerAdapter {
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf().disable()
|
||||
.authorizeRequests()
|
||||
.antMatchers("/**").permitAll()
|
||||
.antMatchers("/index.html", "/", "/**.js", "/**.css").permitAll()
|
||||
.antMatchers(HttpMethod.POST, "/customers", "/login").permitAll()
|
||||
.anyRequest().authenticated().and()
|
||||
.addFilterBefore(new StatelessAuthenticationFilter(tokenAuthenticationService), UsernamePasswordAuthenticationFilter.class);
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ public class CustomerController {
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST)
|
||||
public Observable<CustomerResponse> createCustomer(@Validated @RequestBody CustomerInfo request) {
|
||||
return customerService.createCustomer(request)
|
||||
.map(entityAndEventInfo -> new CustomerResponse(entityAndEventInfo.getEntityIdentifier().getId(), request));
|
||||
public Observable<CustomerResponse> createCustomer(@Validated @RequestBody CustomerInfo customer) {
|
||||
return customerService.createCustomer(customer)
|
||||
.map(entityAndEventInfo -> new CustomerResponse(entityAndEventInfo.getEntityIdentifier().getId(), customer));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{id}/toaccounts", method = RequestMethod.POST)
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
"description": "customer",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/CreateCustomerRequest"
|
||||
"$ref": "#/definitions/CustomerInfo"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -260,6 +260,9 @@
|
||||
"CustomerInfo": {
|
||||
"required": [ "email" ],
|
||||
"properties": {
|
||||
"name": {
|
||||
"$ref": "#/definitions/Name"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -315,26 +318,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"CreateCustomerRequest": {
|
||||
"required": [ "email", "ssn", "phoneNumber" ],
|
||||
"Name": {
|
||||
"required": [ "firstName", "lastName" ],
|
||||
"properties": {
|
||||
"firstName": {
|
||||
"type": "string"
|
||||
},
|
||||
"lastName": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"ssn": {
|
||||
"type": "string"
|
||||
},
|
||||
"phoneNumber": {
|
||||
"type": "string"
|
||||
},
|
||||
"address": {
|
||||
"$ref": "#/definitions/Address"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user