Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Wecube Platform
Commits
f63488dc
Commit
f63488dc
authored
4 years ago
by
gavin2lee
Browse files
Options
Download
Email Patches
Plain Diff
#2046 add encryption service
parent
44caa210
dev3_platform_refactor
2046_batch_execution_update
2048_enhance_for_workflow_excution
2109_itsm_support
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
platform-core/src/main/java/com/webank/wecube/platform/core/service/BatchExecutionService.java
+6
-2
...k/wecube/platform/core/service/BatchExecutionService.java
platform-core/src/main/java/com/webank/wecube/platform/core/service/workflow/EncryptionService.java
+30
-0
...ube/platform/core/service/workflow/EncryptionService.java
with
36 additions
and
2 deletions
+36
-2
platform-core/src/main/java/com/webank/wecube/platform/core/service/BatchExecutionService.java
+
6
-
2
View file @
f63488dc
...
...
@@ -48,6 +48,7 @@ import com.webank.wecube.platform.core.jpa.PluginConfigInterfaceRepository;
import
com.webank.wecube.platform.core.service.dme.EntityOperationRootCondition
;
import
com.webank.wecube.platform.core.service.dme.StandardEntityOperationService
;
import
com.webank.wecube.platform.core.service.plugin.PluginInstanceService
;
import
com.webank.wecube.platform.core.service.workflow.EncryptionService
;
import
com.webank.wecube.platform.core.support.plugin.PluginServiceStub
;
import
com.webank.wecube.platform.core.support.plugin.dto.PluginResponse.ResultData
;
import
com.webank.wecube.platform.core.support.plugin.dto.PluginResponseStationaryOutput
;
...
...
@@ -55,7 +56,6 @@ import com.webank.wecube.platform.core.utils.Constants;
import
com.webank.wecube.platform.core.utils.JsonUtils
;
@Service
@Transactional
public
class
BatchExecutionService
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
...
...
@@ -77,9 +77,13 @@ public class BatchExecutionService {
@Autowired
@Qualifier
(
"userJwtSsoTokenRestTemplate"
)
private
RestTemplate
userJwtSsoTokenRestTemplate
;
@Autowired
private
EncryptionService
encryptionService
;
private
ObjectMapper
objectMapper
=
new
ObjectMapper
().
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
@Transactional
public
Map
<
String
,
ExecutionJobResponseDto
>
handleBatchExecutionJob
(
BatchExecutionRequestDto
batchExecutionRequest
)
throws
IOException
{
verifyParameters
(
batchExecutionRequest
.
getInputParameterDefinitions
());
...
...
@@ -189,7 +193,7 @@ public class BatchExecutionService {
return
executionJobParameters
;
}
p
ublic
ResultData
<?>
performExecutionJob
(
ExecutionJob
exeJob
)
throws
IOException
{
p
rotected
ResultData
<?>
performExecutionJob
(
ExecutionJob
exeJob
)
throws
IOException
{
if
(
exeJob
==
null
)
{
throw
new
WecubeCoreException
(
"3002"
,
"execution job as input argument cannot be null."
);
}
...
...
This diff is collapsed.
Click to expand it.
platform-core/src/main/java/com/webank/wecube/platform/core/service/workflow/EncryptionService.java
0 → 100644
+
30
-
0
View file @
f63488dc
package
com.webank.wecube.platform.core.service.workflow
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
com.webank.wecube.platform.core.utils.EncryptionUtils
;
@Service
public
class
EncryptionService
{
private
static
final
String
AES_SEED
=
"platform-aes-seed-2020"
;
private
static
final
String
AES_SALT
=
"platform-aes-salt-2020"
;
public
String
encodeToAesBase64
(
String
raw
)
{
if
(
StringUtils
.
isBlank
(
raw
))
{
return
raw
;
}
return
EncryptionUtils
.
encryptWithAes
(
raw
,
AES_SEED
,
AES_SALT
);
}
public
String
decodeFromAesBase64
(
String
aesBase64
)
{
if
(
StringUtils
.
isBlank
(
aesBase64
))
{
return
aesBase64
;
}
return
EncryptionUtils
.
decryptWithAes
(
aesBase64
,
AES_SEED
,
AES_SALT
);
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help