From 97e7018795d09a969f7ccd673d46230121829cea Mon Sep 17 00:00:00 2001
From: "Yangkai.Shen" <237497819@qq.com>
Date: Mon, 22 Jul 2019 20:08:34 +0800
Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=20lombok=20?=
=?UTF-8?q?=E5=BC=95=E5=85=A5=E9=97=AE=E9=A2=98=20[ISSUE#27](https://githu?=
=?UTF-8?q?b.com/zhangyd-c/JustAuth/issues/27)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 359 ++++++++++++++++++++++++++++----------------------------
1 file changed, 180 insertions(+), 179 deletions(-)
diff --git a/pom.xml b/pom.xml
index 48c3a41..9752151 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,192 +2,193 @@
- 4.0.0
+ 4.0.0
- me.zhyd.oauth
- JustAuth
- 1.9.2
+ me.zhyd.oauth
+ JustAuth
+ 1.9.2
- JustAuth
+ JustAuth
+ https://gitee.com/yadong.zhang/JustAuth
+
+ 史上最全的整合第三方登录的工具,目前已支持Github、Gitee、微博、钉钉、百度、Coding、腾讯云开发者平台、OSChina、支付宝、QQ、微信、淘宝、Google、Facebook、抖音、领英、小米、微软和今日头条等第三方平台的授权登录。
+ Login, so easy!
+
+
+
+
+ MIT
+ https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE
+
+
+
+
+ scm:git:https://gitee.com/yadong.zhang/JustAuth.git
+ scm:git:https://gitee.com/yadong.zhang/JustAuth.git
https://gitee.com/yadong.zhang/JustAuth
-
- 史上最全的整合第三方登录的工具,目前已支持Github、Gitee、微博、钉钉、百度、Coding、腾讯云开发者平台、OSChina、支付宝、QQ、微信、淘宝、Google、Facebook、抖音、领英、小米、微软和今日头条等第三方平台的授权登录。
- Login, so easy!
-
+
-
-
- MIT
- https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE
-
-
+
+
+ Yadong.Zhang
+ yadong.zhang0415@gmail.com
+ https://www.zhyd.me
+
+
+ Yangkai.Shen
+ shenyangkai1994@gmail.com
+ https://xkcoding.com
+
+
+ Hongwei.Peng
+ pengisgood@gmail.com
+ https://github.com/pengisgood
+
+
-
- scm:git:https://gitee.com/yadong.zhang/JustAuth.git
- scm:git:https://gitee.com/yadong.zhang/JustAuth.git
- https://gitee.com/yadong.zhang/JustAuth
-
+
+ UTF-8
+ 1.8
+ 1.8
+ 1.8
+ 2.2.1
+ 3.7.0
+ true
+ 4.5.15
+ 1.18.4
+ 4.11
+ 1.2.58
+ 3.7.4.ALL
+ 1.7.25
+
-
-
- Yadong.Zhang
- yadong.zhang0415@gmail.com
- https://www.zhyd.me
-
-
- Yangkai.Shen
- shenyangkai1994@gmail.com
- https://xkcoding.com
-
-
- Hongwei.Peng
- pengisgood@gmail.com
- https://github.com/pengisgood
-
-
+
+
+ org.projectlombok
+ lombok
+ ${lombok-version}
+ true
+
+
+ cn.hutool
+ hutool-http
+ ${hutool-version}
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+ com.alibaba
+ fastjson
+ ${fastjson-version}
+
+
+ com.alipay.sdk
+ alipay-sdk-java
+ ${alipay-sdk-version}
+ compile
+
+
+ org.slf4j
+ slf4j-simple
+ ${slf4j-version}
+
+
-
- UTF-8
- 1.8
- 1.8
- 1.8
- 2.2.1
- 3.7.0
- true
- 4.5.15
- 1.18.4
- 4.11
- 1.2.58
- 3.7.4.ALL
- 1.7.25
-
-
-
-
- org.projectlombok
- lombok
- ${lombok-version}
-
-
- cn.hutool
- hutool-http
- ${hutool-version}
-
-
- junit
- junit
- ${junit-version}
- test
-
-
- com.alibaba
- fastjson
- ${fastjson-version}
-
-
- com.alipay.sdk
- alipay-sdk-java
- ${alipay-sdk-version}
- compile
-
-
- org.slf4j
- slf4j-simple
- ${slf4j-version}
-
-
-
-
- ${project.artifactId}-${project.version}
+
+ ${project.artifactId}-${project.version}
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${maven-compiler.version}
+
+ ${project.build.sourceEncoding}
+ ${java.version}
+ ${java.version}
+
+
+
+ maven-source-plugin
+ ${maven-source.version}
+ true
+
+
+ package
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+
+
+
+
+
+ release
+
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${maven-compiler.version}
-
- ${project.build.sourceEncoding}
- ${java.version}
- ${java.version}
-
-
-
- maven-source-plugin
- ${maven-source.version}
- true
-
-
- package
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
-
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ ${maven-source.version}
+ true
+
+
+ package
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ package
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+
+
+ verify
+
+ sign
+
+
+
+
-
-
-
- release
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- ${maven-source.version}
- true
-
-
- package
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- package
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
-
-
- verify
-
- sign
-
-
-
-
-
-
-
-
- sonatype-nexus-snapshots
- https://oss.sonatype.org/content/repositories/snapshots/
-
-
- sonatype-nexus-staging
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
-
+
+
+
+ sonatype-nexus-snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
+ sonatype-nexus-staging
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+
From 66a68c4ead533b7a954b1735ab4947779f834090 Mon Sep 17 00:00:00 2001
From: "Yangkai.Shen" <237497819@qq.com>
Date: Tue, 23 Jul 2019 21:19:04 +0800
Subject: [PATCH 2/2] =?UTF-8?q?:recycle:=20=E9=87=8D=E8=BD=BD=20AuthState?=
=?UTF-8?q?=20=E6=96=B9=E6=B3=95=EF=BC=8C=E9=80=82=E9=85=8D=20justauth-spr?=
=?UTF-8?q?ing-boot-starter=20=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/me/zhyd/oauth/utils/AuthState.java | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/src/main/java/me/zhyd/oauth/utils/AuthState.java b/src/main/java/me/zhyd/oauth/utils/AuthState.java
index 948ac96..1ca1b70 100644
--- a/src/main/java/me/zhyd/oauth/utils/AuthState.java
+++ b/src/main/java/me/zhyd/oauth/utils/AuthState.java
@@ -51,6 +51,17 @@ public class AuthState {
return create(source, RandomUtil.randomString(4));
}
+ /**
+ * 创建state
+ *
+ * @param source oauth平台
+ * @param body 希望加密到state的消息体
+ * @return state
+ */
+ public static String create(AuthSource source, Object body) {
+ return create(source, JSON.toJSONString(body));
+ }
+
/**
* 创建state
*
@@ -62,6 +73,17 @@ public class AuthState {
return create(source, JSON.toJSONString(body));
}
+ /**
+ * 创建state
+ *
+ * @param source oauth平台
+ * @param body 希望加密到state的消息体
+ * @return state
+ */
+ public static String create(AuthSource source, String body) {
+ return create(source.name(), body);
+ }
+
/**
* 创建state
*
@@ -87,6 +109,16 @@ public class AuthState {
return state;
}
+ /**
+ * 获取state
+ *
+ * @param source oauth平台
+ * @return state
+ */
+ public static String get(AuthSource source) {
+ return get(source.name());
+ }
+
/**
* 获取state
*
@@ -101,6 +133,19 @@ public class AuthState {
return stateBucket.get(key);
}
+ /**
+ * 获取state中保存的body内容
+ *
+ * @param source oauth平台
+ * @param state 加密后的state
+ * @param clazz body的实际类型
+ * @param 需要转换的具体的class类型
+ * @return state
+ */
+ public static T getBody(AuthSource source, String state, Class clazz) {
+ return getBody(source.name(), state, clazz);
+ }
+
/**
* 获取state中保存的body内容
*