spring boot init

spring boot init
This commit is contained in:
shimingxy
2019-09-04 23:47:22 +08:00
parent 6181f5d657
commit fb15e2b070
1192 changed files with 2693 additions and 4070 deletions

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

View File

@@ -0,0 +1,2 @@
http\://www.springframework.org/schema/security/oauth2=org.springframework.security.oauth2.config.xml.OAuth2SecurityNamespaceHandler
http\://www.springframework.org/schema/security/oauth=org.springframework.security.oauth.config.OAuthSecurityNamespaceHandler

View File

@@ -0,0 +1,5 @@
http\://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd=org/springframework/security/oauth2/spring-security-oauth2-1.0.xsd
http\://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd=org/springframework/security/oauth2/spring-security-oauth2-2.0.xsd
http\://www.springframework.org/schema/security/spring-security-oauth2.xsd=org/springframework/security/oauth2/spring-security-oauth2-2.0.xsd
http\://www.springframework.org/schema/security/spring-security-oauth-1.0.xsd=org/springframework/security/oauth/spring-security-oauth-1.0.xsd
http\://www.springframework.org/schema/security/spring-security-oauth.xsd=org/springframework/security/oauth/spring-security-oauth-1.0.xsd

View File

@@ -5,6 +5,7 @@ dependencies {
compile fileTree(dir: '../maxkey-lib/*/', include: '*.jar')
compile project(":maxkey-core")
compile project(":maxkey-dao")
compile project(":maxkey-jose-jwt")
compile project(":maxkey-protocols:maxkey-protocol-authorize")

View File

@@ -1,57 +0,0 @@
package org.maxkey.authz.oauth2.common.util;
import java.io.*;
public class SerializationUtils {
public static byte[] serialize(Object state) {
ObjectOutputStream oos = null;
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(512);
oos = new ObjectOutputStream(bos);
oos.writeObject(state);
oos.flush();
return bos.toByteArray();
}
catch (IOException e) {
throw new IllegalArgumentException(e);
}
finally {
if (oos != null) {
try {
oos.close();
}
catch (IOException e) {
// eat it
}
}
}
}
public static <T> T deserialize(byte[] byteArray) {
ObjectInputStream oip = null;
try {
oip = new ObjectInputStream(new ByteArrayInputStream(byteArray));
@SuppressWarnings("unchecked")
T result = (T) oip.readObject();
return result;
}
catch (IOException e) {
throw new IllegalArgumentException(e);
}
catch (ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
finally {
if (oip != null) {
try {
oip.close();
}
catch (IOException e) {
// eat it
}
}
}
}
}

View File

@@ -6,8 +6,8 @@ import java.sql.Types;
import javax.sql.DataSource;
import org.maxkey.authz.oauth2.common.util.SerializationUtils;
import org.maxkey.authz.oauth2.provider.OAuth2Authentication;
import org.maxkey.util.SerializationUtils;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

View File

@@ -17,11 +17,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.maxkey.authz.oauth2.common.OAuth2AccessToken;
import org.maxkey.authz.oauth2.common.OAuth2RefreshToken;
import org.maxkey.authz.oauth2.common.util.SerializationUtils;
import org.maxkey.authz.oauth2.provider.OAuth2Authentication;
import org.maxkey.authz.oauth2.provider.token.AuthenticationKeyGenerator;
import org.maxkey.authz.oauth2.provider.token.DefaultAuthenticationKeyGenerator;
import org.maxkey.authz.oauth2.provider.token.TokenStore;
import org.maxkey.util.SerializationUtils;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;