File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Version: 2.4
2525
2626Future:
27271 . 统一配置配置文件
28- 2 . 使用rsa保证rpc通信安全
28+ 2 . 使用rsa保证rpc通信安全
29293 . swift_rpc完善RQ异步任务队列
30304 . 增加request json body的识别,在这基础上做安全的封装
3131
Original file line number Diff line number Diff line change 1515REMOTE_IP_MODE = False
1616REMOTE_ALLOW = ['' ]
1717
18+ ENCRYPTION_AES = "123xiaorui456789"
19+
1820LOGCONFIG = {
1921 "version" : 1 ,
2022 "disable_existing_loggers" : False ,
Original file line number Diff line number Diff line change @@ -42,11 +42,14 @@ def prepare(self):
4242 @gen .coroutine
4343 def args_kwargs (self ):
4444 args = []
45- # support positional arguments
4645 if self .request .headers .get ('Content-Type' ) == "application/json" :
4746 de_string = self .request .body
48- if self .request .headers .get ('Encryption' ) == "base64" :
47+ encryption = self .request .headers .get ('Encryption' )
48+ if encryption == "base64" :
4949 de_string = base64 .decodestring (self .request .body )
50+ elif encryption == "aes" :
51+ salt = prpcrypt (self .config .ENCRYPTION_AES )
52+ de_string = salt .decrypt (self .request .body )
5053 data = json .loads (de_string )
5154 args = data .get ('args' ,[])
5255 kwargs = data .get ('kwargs' ,{})
You can’t perform that action at this time.
0 commit comments