-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
148 additions
and
109 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.activiti.conf; | ||
|
||
import org.activiti.rest.common.application.ContentTypeResolver; | ||
import org.activiti.rest.common.application.DefaultContentTypeResolver; | ||
import org.activiti.rest.service.api.RestResponseFactory; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* @author Joram Barrez | ||
*/ | ||
@Configuration | ||
public class RestConfiguration { | ||
|
||
@Bean() | ||
public RestResponseFactory restResponseFactory() { | ||
RestResponseFactory restResponseFactory = new RestResponseFactory(); | ||
return restResponseFactory; | ||
} | ||
|
||
@Bean() | ||
public ContentTypeResolver contentTypeResolver() { | ||
ContentTypeResolver resolver = new DefaultContentTypeResolver(); | ||
return resolver; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/org/activiti/conf/SecurityConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.activiti.conf; | ||
|
||
import org.activiti.rest.security.BasicAuthenticationProvider; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.authentication.AuthenticationProvider; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity; | ||
import org.springframework.security.config.http.SessionCreationPolicy; | ||
|
||
@Configuration | ||
@EnableWebSecurity | ||
@EnableWebMvcSecurity | ||
public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | ||
|
||
@Bean | ||
public AuthenticationProvider authenticationProvider() { | ||
return new BasicAuthenticationProvider(); | ||
} | ||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http | ||
.authenticationProvider(authenticationProvider()) | ||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() | ||
.csrf().disable() | ||
.authorizeRequests() | ||
.anyRequest().authenticated() | ||
.and() | ||
.httpBasic(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...er/servlet/FilterServletOutputStream.java → ...i/explorer/FilterServletOutputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lorer/servlet/GenericResponseWrapper.java → ...viti/explorer/GenericResponseWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...explorer/servlet/JsonpCallbackFilter.java → ...ctiviti/explorer/JsonpCallbackFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 0 additions & 77 deletions
77
src/main/java/org/activiti/explorer/servlet/WebConfigurer.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,4 @@ | |
</context:component-scan> | ||
|
||
<mvc:annotation-driven /> | ||
|
||
<mvc:default-servlet-handler /> | ||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:mvc="http://www.springframework.org/schema/mvc" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd | ||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"> | ||
|
||
<!-- 自动扫描且只扫描@Controller --> | ||
<context:component-scan base-package="org.activiti.rest"> | ||
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> | ||
</context:component-scan> | ||
|
||
<mvc:annotation-driven /> | ||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<%@ include file="/common/global.jsp"%> | ||
<%@ include file="/common/meta.jsp" %> | ||
<%@ include file="/common/include-base-styles.jsp" %> | ||
<%@ include file="/common/include-jquery-ui-theme.jsp" %> | ||
<%@ include file="/common/include-custom-styles.jsp" %> | ||
<title>Rest示例</title> | ||
|
||
</head> | ||
<body> | ||
|
||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters