PL-6730 REST API URLs changed

This commit is contained in:
Maxim Gorbunkov 2016-07-05 11:30:15 +04:00
parent 556ab63708
commit aa5b3d37be
5 changed files with 9 additions and 6 deletions

View File

@ -44,6 +44,8 @@
<module name="rest-api" dependsOn="client" blocks="web,portal"> <module name="rest-api" dependsOn="client" blocks="web,portal">
<artifact name="cuba-rest-api" appJar="true"/> <artifact name="cuba-rest-api" appJar="true"/>
<property name="cuba.dispatcherSpringContextConfig" value="rest-api-security-spring.xml"/>
</module> </module>
<module name="gui" dependsOn="client" blocks="web,desktop"> <module name="gui" dependsOn="client" blocks="web,desktop">

View File

@ -47,7 +47,7 @@ import java.util.UUID;
* Controller that performs CRUD entity operations * Controller that performs CRUD entity operations
*/ */
@RestController @RestController
@RequestMapping(value = "/entities", produces = "application/json; charset=UTF-8") @RequestMapping(value = "/api/entities", produces = "application/json; charset=UTF-8")
public class EntitiesController { public class EntitiesController {
@Inject @Inject

View File

@ -40,7 +40,7 @@ public class OAuthTokenController {
@Inject @Inject
private OAuthTokenRevoker oAuthTokenRevoker; private OAuthTokenRevoker oAuthTokenRevoker;
@RequestMapping(value = "/oauth/revoke", method = RequestMethod.POST) @RequestMapping(value = "/api/oauth/revoke", method = RequestMethod.POST)
public ResponseEntity<Void> revokeToken(@RequestParam("token") final String token, public ResponseEntity<Void> revokeToken(@RequestParam("token") final String token,
@RequestParam(value = "token_hint", required = false) final String tokenHint, final Principal principal) { @RequestParam(value = "token_hint", required = false) final String tokenHint, final Principal principal) {
log.info("POST {}, /oauth/revoke; token = {}, tokenHint = {}", token, tokenHint); log.info("POST {}, /oauth/revoke; token = {}, tokenHint = {}", token, tokenHint);

View File

@ -42,7 +42,7 @@ import java.util.*;
* Controller that is used for operations with predefined JPQL queries * Controller that is used for operations with predefined JPQL queries
*/ */
@RestController @RestController
@RequestMapping("/queries") @RequestMapping("/api/queries")
public class QueriesController { public class QueriesController {
@Inject @Inject

View File

@ -34,7 +34,7 @@
<context:component-scan base-package="com.haulmont.restapi"/> <context:component-scan base-package="com.haulmont.restapi"/>
<!-- According to the spec the token endpoint should be secured by the basic authentication --> <!-- According to the spec the token endpoint should be secured by the basic authentication -->
<http pattern="/dispatch/oauth/**" <http pattern="/dispatch/api/oauth/**"
create-session="stateless" create-session="stateless"
authentication-manager-ref="clientAuthenticationManager" authentication-manager-ref="clientAuthenticationManager"
xmlns="http://www.springframework.org/schema/security"> xmlns="http://www.springframework.org/schema/security">
@ -64,6 +64,7 @@
<!-- Specifies token endpoint.--> <!-- Specifies token endpoint.-->
<oauth2:authorization-server <oauth2:authorization-server
token-endpoint-url="/api/oauth/token"
client-details-service-ref="clientDetailsService" client-details-service-ref="clientDetailsService"
token-services-ref="tokenServices" > token-services-ref="tokenServices" >
<oauth2:password authentication-manager-ref="userAuthenticationManager"/> <oauth2:password authentication-manager-ref="userAuthenticationManager"/>
@ -85,7 +86,7 @@
<oauth2:resource-server id="resourceFilter" token-services-ref="tokenServices" /> <oauth2:resource-server id="resourceFilter" token-services-ref="tokenServices" />
<http pattern="/dispatch/entities/**" <http pattern="/dispatch/api/entities/**"
create-session="stateless" create-session="stateless"
entry-point-ref="oauthAuthenticationEntryPoint" entry-point-ref="oauthAuthenticationEntryPoint"
xmlns="http://www.springframework.org/schema/security"> xmlns="http://www.springframework.org/schema/security">
@ -96,7 +97,7 @@
<custom-filter ref="resourceFilter" before="PRE_AUTH_FILTER"/> <custom-filter ref="resourceFilter" before="PRE_AUTH_FILTER"/>
</http> </http>
<http pattern="/dispatch/queries/**" <http pattern="/dispatch/api/queries/**"
create-session="stateless" create-session="stateless"
entry-point-ref="oauthAuthenticationEntryPoint" entry-point-ref="oauthAuthenticationEntryPoint"
xmlns="http://www.springframework.org/schema/security"> xmlns="http://www.springframework.org/schema/security">