Skip to content

Commit 22036b0

Browse files
authored
Merge pull request #110 from microsoftgraph/dev
1.0.7 release
2 parents 76e3517 + 317c35f commit 22036b0

File tree

7 files changed

+62
-9
lines changed

7 files changed

+62
-9
lines changed

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [[email protected]](mailto:[email protected]) with questions or concerns

SECURITY.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
2+
3+
## Security
4+
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14+
15+
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mavenGroupId = com.microsoft.graph
2525
mavenArtifactId = microsoft-graph-core
2626
mavenMajorVersion = 1
2727
mavenMinorVersion = 0
28-
mavenPatchVersion = 6
28+
mavenPatchVersion = 7
2929
mavenArtifactSuffix =
3030
nightliesUrl = http://dl.bintray.com/MicrosoftGraph/Maven
3131

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repositories {
2020
2121
dependencies {
2222
// Include the sdk as a dependency
23-
implementation 'com.microsoft.graph:microsoft-graph-core:1.0.6'
23+
implementation 'com.microsoft.graph:microsoft-graph-core:1.0.7'
2424
}
2525
```
2626

@@ -32,7 +32,7 @@ Add the dependency in `dependencies` in pom.xml
3232
<dependency>
3333
<groupId>com.microsoft.graph</groupId>
3434
<artifactId>microsoft-graph-core</artifactId>
35-
<version>1.0.6</version>
35+
<version>1.0.7</version>
3636
</dependency>
3737
```
3838

src/main/java/com/microsoft/graph/content/MSBatchRequestStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public MSBatchRequestStep(String requestId, Request request, List<String> arrayO
1515
if(requestId.length() == 0)
1616
throw new IllegalArgumentException("Request Id cannot be empty.");
1717
if(request == null)
18-
new IllegalArgumentException("Request cannot be null.");
18+
throw new IllegalArgumentException("Request cannot be null.");
1919

2020
this.requestId = requestId;
2121
this.request = request;

src/main/java/com/microsoft/graph/httpcore/TelemetryHandler.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
public class TelemetryHandler implements Interceptor{
1313

1414
public static final String SDK_VERSION = "SdkVersion";
15-
public static final String VERSION = "v1.0.6";
15+
public static final String VERSION = "v1.0.7";
1616
public static final String GRAPH_VERSION_PREFIX = "graph-java-core";
1717
public static final String JAVA_VERSION_PREFIX = "java";
1818
public static final String ANDROID_VERSION_PREFIX = "android";
1919
public static final String CLIENT_REQUEST_ID = "client-request-id";
20+
private static final String DEFAULT_VERSION_VALUE = "0";
2021

2122
@Override
2223
public Response intercept(Chain chain) throws IOException {
@@ -30,7 +31,9 @@ public Response intercept(Chain chain) throws IOException {
3031
final String featureUsage = "(featureUsage=" + telemetryOptions.getFeatureUsage() + ")";
3132
final String javaVersion = System.getProperty("java.version");
3233
final String androidVersion = getAndroidAPILevel();
33-
final String sdkversion_value = GRAPH_VERSION_PREFIX + "/" + VERSION + " " + featureUsage + " " + JAVA_VERSION_PREFIX + "/" + javaVersion + " " + ANDROID_VERSION_PREFIX + "/" + androidVersion;
34+
final String sdkversion_value = GRAPH_VERSION_PREFIX + "/" + VERSION + " " + featureUsage +
35+
(javaVersion == DEFAULT_VERSION_VALUE ? "" : (", " + JAVA_VERSION_PREFIX + "/" + javaVersion)) +
36+
(androidVersion == DEFAULT_VERSION_VALUE ? "" : (", " + ANDROID_VERSION_PREFIX + "/" + androidVersion));
3437
telemetryAddedBuilder.addHeader(SDK_VERSION, sdkversion_value);
3538

3639
if(request.header(CLIENT_REQUEST_ID) == null) {
@@ -61,10 +64,10 @@ private String getAndroidAPILevelInternal() {
6164
final Field sdkVersionField = versionClass.getField("SDK_INT");
6265
final Object value = sdkVersionField.get(null);
6366
final String valueStr = String.valueOf(value);
64-
return valueStr == null || valueStr == "" ? "0" : valueStr;
67+
return valueStr == null || valueStr == "" ? DEFAULT_VERSION_VALUE : valueStr;
6568
} catch (IllegalAccessException | ClassNotFoundException | NoSuchFieldException ex) {
6669
// we're not on android and return "0" to align with java version which returns "0" when running on android
67-
return "0";
70+
return DEFAULT_VERSION_VALUE;
6871
}
6972
}
7073
}

src/test/java/com/microsoft/graph/httpcore/TelemetryHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public Request authenticateRequest(Request request) {
3333
final Response response = client.newCall(request).execute();
3434
assertNotNull(response);
3535
assertTrue(response.request().header(TelemetryHandler.SDK_VERSION).contains(expectedHeader));
36-
assertTrue(response.request().header(TelemetryHandler.SDK_VERSION).contains(TelemetryHandler.ANDROID_VERSION_PREFIX));
36+
assertTrue(!response.request().header(TelemetryHandler.SDK_VERSION).contains(TelemetryHandler.ANDROID_VERSION_PREFIX)); // Android version is not going to be present on unit tests runnning on java platform
3737
assertTrue(response.request().header(TelemetryHandler.SDK_VERSION).contains(TelemetryHandler.JAVA_VERSION_PREFIX));
3838
}
3939

0 commit comments

Comments
 (0)