Merge branch 'tb-buildev' into tb-65-protocol
This commit is contained in:
Коммит
0a2cc606e0
|
@ -0,0 +1,21 @@
|
|||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
# File take from the VSCode repo at:
|
||||
# https://github.com/Microsoft/vscode/blob/master/.editorconfig
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Tab indentation
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.xml]
|
||||
indent_size = 2
|
|
@ -249,11 +249,8 @@
|
|||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -16,7 +16,6 @@ import com.microsoft.rest.ServiceCallback;
|
|||
import com.microsoft.rest.ServiceFuture;
|
||||
import com.microsoft.rest.ServiceResponse;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import rx.Observable;
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,7 +23,6 @@ import com.microsoft.bot.schema.models.Transcript;
|
|||
import com.microsoft.rest.ServiceCallback;
|
||||
import com.microsoft.rest.ServiceFuture;
|
||||
import com.microsoft.rest.ServiceResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import rx.Observable;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
package com.microsoft.bot.connector.authentication;
|
||||
|
||||
import com.microsoft.aad.adal4j.AuthenticationException;
|
||||
import com.microsoft.bot.connector.authentication.JwtTokenExtractor;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class CredentialProviderImpl extends BotCredentials implements Credential
|
|||
|
||||
@Override
|
||||
public CompletableFuture<String> getAppPasswordAsync(String appId) {
|
||||
return CompletableFuture.completedFuture((this.appId.equals(appId) ? this.appPassword : null));
|
||||
return CompletableFuture.completedFuture(this.appId.equals(appId) ? this.appPassword : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,6 @@ package com.microsoft.bot.connector.authentication;
|
|||
import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.microsoft.aad.adal4j.AuthenticationException;
|
||||
import com.microsoft.bot.connector.authentication.JwtTokenExtractor;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
|
|
@ -9,9 +9,6 @@ import com.auth0.jwt.exceptions.JWTVerificationException;
|
|||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.auth0.jwt.interfaces.Verification;
|
||||
import com.microsoft.aad.adal4j.AuthenticationException;
|
||||
import com.microsoft.bot.connector.authentication.ClaimsIdentity;
|
||||
import com.microsoft.bot.connector.authentication.ClaimsIdentityImpl;
|
||||
import com.microsoft.bot.connector.authentication.TokenValidationParameters;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -20,7 +17,6 @@ import java.util.Map;
|
|||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
|
|
@ -3,11 +3,7 @@
|
|||
|
||||
package com.microsoft.bot.connector.authentication;
|
||||
|
||||
import com.auth0.jwt.interfaces.Claim;
|
||||
import com.microsoft.aad.adal4j.AuthenticationException;
|
||||
import com.microsoft.bot.connector.authentication.MicrosoftAppCredentials;
|
||||
import com.microsoft.bot.connector.authentication.ClaimsIdentityImpl;
|
||||
import com.microsoft.bot.connector.authentication.EmulatorValidation;
|
||||
import com.microsoft.bot.schema.models.Activity;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
|
|
@ -31,11 +31,11 @@ public class MicrosoftAppCredentials implements ServiceClientCredentials {
|
|||
|
||||
private String currentToken = null;
|
||||
private long expiredTime = 0;
|
||||
private static final Object cacheSync = new Object();
|
||||
//private static final Object cacheSync = new Object();
|
||||
protected static final HashMap<String, OAuthResponse> cache = new HashMap<String, OAuthResponse>();
|
||||
|
||||
public final String OAuthEndpoint = AuthenticationConstants.ToChannelFromBotLoginUrl;
|
||||
public final String OAuthScope = AuthenticationConstants.ToChannelFromBotOAuthScope;
|
||||
public final String OAuthEndpoint = ToChannelFromBotLoginUrl;
|
||||
public final String OAuthScope = ToChannelFromBotOAuthScope;
|
||||
|
||||
|
||||
public String getTokenCacheKey() {
|
||||
|
@ -83,7 +83,7 @@ public class MicrosoftAppCredentials implements ServiceClientCredentials {
|
|||
}
|
||||
|
||||
|
||||
private boolean ShouldSetToken(String url) {
|
||||
protected boolean ShouldSetToken(String url) {
|
||||
if (isTrustedServiceUrl(url)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -121,6 +121,8 @@ public class MicrosoftAppCredentials implements ServiceClientCredentials {
|
|||
URL url = new URL(serviceUrl);
|
||||
trustServiceUrl(url, expirationTime);
|
||||
} catch (MalformedURLException e) {
|
||||
//TODO: What's missing here?
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
package com.microsoft.bot.connector.authentication;
|
||||
|
||||
import com.microsoft.bot.connector.authentication.MicrosoftAppCredentials;
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
|
|
@ -84,7 +84,7 @@ public class OAuthClient extends ServiceClient {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.collect(joining("&", (uri.endsWith("?") ? uri : uri + "?"), ""));
|
||||
.collect(joining("&", uri.endsWith("?") ? uri : uri + "?", ""));
|
||||
return new URI(newUri);
|
||||
|
||||
|
||||
|
@ -177,8 +177,6 @@ public class OAuthClient extends ServiceClient {
|
|||
}
|
||||
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
String invocationId = null;
|
||||
|
||||
// Construct URL
|
||||
HashMap<String, String> qstrings = new HashMap<>();
|
||||
qstrings.put("userId", userId);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.microsoft.bot.connector.authentication;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -43,6 +42,6 @@ public class OAuthResponse
|
|||
}
|
||||
|
||||
@JsonAnySetter
|
||||
private HashMap<String, String> properties;
|
||||
public HashMap<String, String> properties;
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import retrofit2.Retrofit;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the ConnectorClientImpl class.
|
||||
|
|
|
@ -197,10 +197,8 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -4,8 +4,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||
import com.fasterxml.jackson.core.TreeNode;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.microsoft.bot.schema.ContactRelationUpdateActivity;
|
||||
import com.microsoft.bot.schema.TraceActivity;
|
||||
import com.microsoft.bot.schema.models.*;
|
||||
|
||||
|
||||
|
@ -160,7 +158,7 @@ public class ActivityImpl extends Activity {
|
|||
reply.withType(ActivityTypes.TRACE);
|
||||
reply.withTimestamp(DateTime.now());
|
||||
reply.withAttachments(new ArrayList<Attachment>());
|
||||
reply.withEntities(new ArrayList<EntityImpl>());;
|
||||
reply.withEntities(new ArrayList<EntityImpl>());
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
@ -665,7 +663,7 @@ public class ActivityImpl extends Activity {
|
|||
return false;
|
||||
}
|
||||
|
||||
private Mention convertToMention(JsonNode node) {
|
||||
public Mention convertToMention(JsonNode node) {
|
||||
try {
|
||||
return ActivityImpl.mapper.treeToValue(node, Mention.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
|
@ -699,7 +697,7 @@ public class ActivityImpl extends Activity {
|
|||
return null;
|
||||
|
||||
if (classType.isInstance(this.channelData())) {
|
||||
return ((TypeT) this.channelData());
|
||||
return (TypeT) this.channelData();
|
||||
}
|
||||
JsonNode node = mapper.valueToTree(this.channelData());
|
||||
return mapper.treeToValue((TreeNode) node, classType);
|
||||
|
|
|
@ -142,6 +142,5 @@ public class EntityImpl extends Entity {
|
|||
return true;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
package com.microsoft.bot.schema.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Conversation account represents the identity of the conversation within a channel.
|
||||
|
@ -203,7 +200,7 @@ public class ConversationAccount {
|
|||
* while maintaining the object.
|
||||
*
|
||||
*/
|
||||
private HashMap<String, JsonNode> properties = new HashMap<String, JsonNode>();
|
||||
// private HashMap<String, JsonNode> properties = new HashMap<String, JsonNode>();
|
||||
|
||||
/**
|
||||
* Overflow properties.
|
||||
|
|
|
@ -18,7 +18,7 @@ public class ConversationReferenceHelper {
|
|||
.withType(ActivityTypes.MESSAGE)
|
||||
.withId(UUID.randomUUID().toString())
|
||||
.withRecipient(new ChannelAccount()
|
||||
.withId((reference.bot().id()))
|
||||
.withId(reference.bot().id())
|
||||
.withName(reference.bot().name()))
|
||||
.withChannelId(reference.channelId())
|
||||
.withServiceUrl(reference.serviceUrl())
|
||||
|
|
|
@ -181,6 +181,16 @@
|
|||
<aggregate>true</aggregate>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<analysisCache>true</analysisCache>
|
||||
<excludes>
|
||||
<exclude>**/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
@ -265,10 +275,8 @@
|
|||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -135,7 +135,6 @@ public abstract class BotAdapter {
|
|||
callback.accept(context);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
39
pom.xml
39
pom.xml
|
@ -16,6 +16,19 @@
|
|||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>build</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<modules>
|
||||
<module>libraries/botbuilder-schema</module>
|
||||
<module>libraries/botbuilder</module>
|
||||
|
@ -66,7 +79,33 @@
|
|||
<aggregate>true</aggregate>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.12.0</version>
|
||||
<configuration>
|
||||
<printFailingErrors>true</printFailingErrors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
|
@ -125,6 +125,16 @@
|
|||
<aggregate>true</aggregate>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<analysisCache>true</analysisCache>
|
||||
<excludes>
|
||||
<exclude>**/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
Загрузка…
Ссылка в новой задаче