我很担心人们将机密信息记录到服务器日志中. 我已经看到生产中的服务器日志.一些开发人员不小心记录了安全相关信息,如password,clientId,clientSecret等.
是否有任何方法,如Eclipse插件或任何工具,在编写代码时警告开发人员?
`ex : log.info("usernam = " + username + "password = " + password) ;` //
Warn that confidential info is getting logged.
Run Code Online (Sandbox Code Playgroud)
我做了一些研究......我见过像sonarLint和FindBug这样的工具
但那些插件无法解决我的问题.
在我的html页面中,我想循环遍历我的Java类返回的属性,但是在<script>标记下进行.
目前我的html页面有这样的:
<div id="map_wrapper">
<div data-sly-use.ev="Foo"
class="mapping"
id="${ev.googleClass || ''"
>
</div>
</div>
<script>
....
var markers = [
['Bondi Beach', -33.890542, 151.274856],
['Coogee Beach', -33.923036, 151.259052],
['Cronulla Beach', -34.028249, 151.157507],
['Manly Beach', -33.80010128657071, 151.28747820854187],
['Maroubra Beach', -33.950198, 151.259302]
];
.....
</script>
Run Code Online (Sandbox Code Playgroud)
我的Java类有以下getter:
//returns [0] = "something, -33.89, 151.2" [1] = "beach, -33.9, 15.02" etc.
public List<String> getVals() {
return vals;
}
public String getGoogleClass() {
if (vals.size() == 0)
return "";
return "map_canvas";
}
Run Code Online (Sandbox Code Playgroud)
题
如何用返回的值替换标记中markers …
我创建了一个 aws Lambda 函数,它将 hello world 打印到控制台
使用类所在的包名称和要调用的方法名称配置 lambda,并将 jar 文件上传到 aws lambda 函数。
当我执行 lambda 时,出现异常,提示找不到类。
消息为
{
"errorMessage": "Class not found: com.coreservice.lambda.Handler",
"errorType": "class java.lang.ClassNotFoundException"
}
Run Code Online (Sandbox Code Playgroud)
无法理解为什么 aws 无法在 jar 中找到类。
以下详细信息是项目配置
public class Handler implements RequestHandler<SNSEvent, Object> {
@Override
public Object handleRequest(final SNSEvent input, final Context context) {
if (Objects.nonNull(input) && !CollectionUtils.isNullOrEmpty(input.getRecords())) {
context.getLogger().log("Hello World");
context.getLogger().log("queue = "+ SQS_URL);
}
return StringUtils.EMPTY;
}
}
Run Code Online (Sandbox Code Playgroud)
项目pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.coreservice</groupId>
<artifactId>SNS-SQS-Filter-Lambda</artifactId>
<packaging>jar</packaging>
<version>136.0.0-SNAPSHOT</version>
<name>SNS-SQS-Filter-Lambda</name>
<dependencies> …Run Code Online (Sandbox Code Playgroud) 我有用例,我需要创建角色,在crm实例中创建用户并将角色与用户相关联。
我已经探索了用于创建用户和创建角色的api。
下面是代码:
private void createUser(IntegrationUserDTO integrationUserDTO, STSDto stsDetails, CRMAuthContext crmAuthContext)
throws IntegrationsException {
Map<String, Object> requestBody = new HashMap<>();
URI uri = new MSCRMHttpDelegate().odataUriBuilder(crmAuthContext.getCrmApiUrl())
.appendEntitySetSegment("systemusers").build();
HttpPost httpPost = new HttpPost(uri.toString());
httpPost.setHeader("Authorization", "Bearer " + crmAuthContext.getAccessToken());
httpPost.setHeader("Accept", MediaType.APPLICATION_JSON);
httpPost.setHeader("OData-MaxVersion", "4.0");
httpPost.setHeader("OData-Version", "4.0");
httpPost.setHeader("Content-Type", "application/json");
requestBody.put("accessmode", "4");
requestBody.put("applicationid", UUID.fromString(stsDetails.getClientId()));
requestBody.put("firstname", integrationUserDTO.getUsername());
requestBody.put("lastname", integrationUserDTO.getSecretToken());
requestBody.put("internalemailaddress", integrationUserDTO.getExtraParams());
requestBody.put("isintegrationuser", true);
MSCRMUser user = getBusinessUnitId(crmAuthContext);
if (StringUtils.isNoneBlank(user.getBusinessUnitId())) {
requestBody.put("businessunitid@odata.bind",
"/businessunits(" + UUID.fromString(user.getBusinessUnitId()) + ")");
}
if (StringUtils.isNoneBlank(user.getOrganizationId())) {
requestBody.put("organizationid", UUID.fromString(user.getOrganizationId()));
}
try {
httpPost.setEntity(new StringEntity( …Run Code Online (Sandbox Code Playgroud) java microsoft-dynamics dynamics-crm dynamics-crm-online microsoft-dynamics-webapi
我们正面临与微服务架构有关的性能问题。
假设有用于用户和帐户管理的微服务。其中有 api 之类的
GET /users/{id}
GET /users (arrount 6 million users)
GET /accounts/{accountId}
GET /accounts
and Other Operations on user and account
Run Code Online (Sandbox Code Playgroud)
我们还有其他微服务,用于跟踪用户活动并列出用户在上次登录时所做的所有活动。
GET /user/activity/{userId} (on an average 1000 to 10000 records)
Run Code Online (Sandbox Code Playgroud)
我们为销售和营销团队提供基于搜索条件的个人用户活动和用户信息和帐户信息的保护,
let's say search criteria is like : get all user activies who are located in colombia
Algorithm :
1)Get /users ? location = colombia
2)then for individual user Get /user/activity/{userId}
Run Code Online (Sandbox Code Playgroud)
这就像连接来自不同数据库的两个表。
它非常慢并且会产生很多性能问题。
我所想到的是通过一项工作复制其他微服务中的用户表,以确保它是最新的并且只使用一个 api
GET /user/activities?location=colombia.
Run Code Online (Sandbox Code Playgroud)
但是复制表(用户)打破了微服务架构的主要基础
有没有其他方法可以做到或支持这种类型的过滤条件,这些条件连接来自不同微服务的表。
java ×3
aem ×1
architecture ×1
aws-lambda ×1
dynamics-crm ×1
findbugs ×1
java-8 ×1
javascript ×1
jetty ×1
maven ×1
maven-plugin ×1
osgi ×1
sightly ×1
sonarlint ×1