Skip to content

Commit

Permalink
Version Bump v4.2.0: Hacktoberfest rollup release
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingserious committed May 4, 2018
1 parent 1ef503a commit 258f80b
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ examples/Example.java
.classpath
.project
.env
.vscode
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Change Log
All notable changes to this project will be documented in this file.

## [4.2.0] - 2018-05-04
### Added
- [PR #275](https://github.com/sendgrid/sendgrid-java/pull/275/files): Add a way to verify that the content doesn't contain sensitive information -- BIG thanks to [Diego Camargo](https://github.com/belfazt)
- [PR #249](https://github.com/sendgrid/sendgrid-java/pull/249): Add optional rate limit support -- BIG thanks to [Andy Trimble](https://github.com/andy-trimble)
- [PR #379](https://github.com/sendgrid/sendgrid-java/pull/379): Break up the examples in examples/subusers/subusers.java to their own files -- BIG thanks to [huytranrjc](https://github.com/huytranrjc)
- [PR #365](https://github.com/sendgrid/sendgrid-java/pull/365): Test to check year in license file -- BIG thanks to [Alex](https://github.com/pushkyn)
- [PR #345](https://github.com/sendgrid/sendgrid-java/pull/345): Add .codeclimate.yml file -- BIG thanks to [Rostyslav Zatserkovnyi](https://github.com/rzats)
- [PR #319](https://github.com/sendgrid/sendgrid-java/pull/319): Add .env_sample file -- BIG thanks to [Thiago Barbato](https://github.com/thiagobbt)
- [PR #223](https://github.com/sendgrid/sendgrid-java/pull/223): The license file is now in the release jar -- BIG thanks to [sccalabr](https://github.com/sccalabr)
- [PR #224](https://github.com/sendgrid/sendgrid-java/pull/224): Adding SendGridApi interface -- BIG thanks to [sccalabr](https://github.com/sccalabr)

### Fix
- [PR #410](https://github.com/sendgrid/sendgrid-java/pull/410): Update Jackson dependencies to the latest version -- BIG thanks to [Dmitry Avershin](https://github.com/dmitraver)
- [PR #380](https://github.com/sendgrid/sendgrid-java/pull/380): Fix "similar-code" issue in examples/whitelabel/ips.java -- BIG thanks to [huytranrjc](https://github.com/huytranrjc)
- [PR #255](https://github.com/sendgrid/sendgrid-java/pull/225): Fix Mail deserialization issue -- BIG thanks to [sccalabr](https://github.com/sccalabr)
- [PR #359](https://github.com/sendgrid/sendgrid-java/pull/359): Fix code issue in examples/suppression/suppression.java -- BIG thanks to [Alex](https://github.com/pushkyn)
- [PR #228](https://github.com/sendgrid/sendgrid-java/pull/228): Changes serialization type from default to non-empty -- BIG thanks to [Dmitry Avershin](https://github.com/dmitraver)
- [PR #373](https://github.com/sendgrid/sendgrid-java/pull/373): Fix file_lines issue in examples/mailsettings/mailsettings.java -- BIG thanks to [Mithun Sasidharan](https://github.com/mithunsasidharan)


## [4.1.2] - 2017-10-30
### Added
- PR #220 Alway serialize click-tracking parameters.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ touch Example.java
Add the example you want to test to Example.java, including the headers at the top of the file.

``` bash
javac -classpath ../repo/com/sendgrid/4.1.2/sendgrid-4.1.2-jar.jar:. Example.java && java -classpath ../repo/com/sendgrid/4.1.2/sendgrid-4.1.2-jar.jar:. Example
javac -classpath ../repo/com/sendgrid/4.2.0/sendgrid-4.2.0-jar.jar:. Example.java && java -classpath ../repo/com/sendgrid/4.2.0/sendgrid-4.2.0-jar.jar:. Example
```

<a name="understanding-the-codebase"></a>
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2017 SendGrid, Inc.
Copyright (c) 2013-2018 SendGrid, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Add the following to your build.gradle file in the root of your project.
...
dependencies {
...
compile 'com.sendgrid:sendgrid-java:4.1.2'
compile 'com.sendgrid:sendgrid-java:4.2.0'
}
repositories {
Expand All @@ -85,7 +85,7 @@ mvn install

You can just drop the jar file in. It's a fat jar - it has all the dependencies built in.

[sendgrid-java-latest.jar](http://dx.sendgrid.com/downloads/sendgrid-java/sendgrid-java-latest.jar)
[sendgrid-java.jar](https://github.com/sendgrid/sendgrid-java/releases/download/v4.2.0/sendgrid-java.jar)

## Dependencies

Expand Down
2 changes: 1 addition & 1 deletion bin/com/sendgrid/helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Run the [example](https://github.com/sendgrid/sendgrid-java/tree/master/examples

```bash
cd examples/mail
javac -classpath ../../build/libs/sendgrid-4.1.0-jar.jar:. Example.java && java -classpath ../examples/jackson-core-2.7.3.jar:../../build/libs/sendgrid-4.1.0-jar.jar:. Example
javac -classpath ../../build/libs/sendgrid-4.2.0-jar.jar:. Example.java && java -classpath ../examples/jackson-core-2.9.2.jar:../../build/libs/sendgrid-4.2.0-jar.jar:. Example
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apply plugin: 'maven'
apply plugin: 'signing'

group = 'com.sendgrid'
version = '4.1.2'
version = '4.2.0'
ext.packaging = 'jar'

allprojects {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<groupId>com.sendgrid</groupId>
<artifactId>sendgrid-java</artifactId>
<name>SendGrid Java helper library</name>
<version>4.1.2</version>
<version>4.2.0</version>
<description>This Java module allows you to quickly and easily send emails through SendGrid using Java.</description>
<url>https://github.com/sendgrid/sendgrid-java</url>
<licenses>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/sendgrid/SendGridAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public interface SendGridAPI {
/**
* Returns the library version
*
* @param apiKey is your SendGrid API Key: https://app.sendgrid.com/settings/api_keys
* @return the library version.
*/
public String getLibraryVersion();
Expand Down
29 changes: 14 additions & 15 deletions src/main/java/com/sendgrid/helpers/mail/objects/Content.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,6 @@ public void setValue(String value) {
ContentVerifier.verifyContent(value);
this.value = value;
}
}

class ContentVerifier {
private static final List<Pattern> FORBIDDEN_PATTERNS = Collections.singletonList(
Pattern.compile(".*SG\\.[a-zA-Z0-9(-|_)]*\\.[a-zA-Z0-9(-|_)]*.*")
);

static void verifyContent(String content) {
for (Pattern pattern: FORBIDDEN_PATTERNS) {
if (pattern.matcher(content).matches()) {
throw new IllegalArgumentException("Found a Forbidden Pattern in the content of the email");
}
}
}
}

@Override
public int hashCode() {
Expand Down Expand Up @@ -94,3 +79,17 @@ public boolean equals(Object obj) {
return true;
}
}

class ContentVerifier {
private static final List<Pattern> FORBIDDEN_PATTERNS = Collections.singletonList(
Pattern.compile(".*SG\\.[a-zA-Z0-9(-|_)]*\\.[a-zA-Z0-9(-|_)]*.*")
);

static void verifyContent(String content) {
for (Pattern pattern: FORBIDDEN_PATTERNS) {
if (pattern.matcher(content).matches()) {
throw new IllegalArgumentException("Found a Forbidden Pattern in the content of the email");
}
}
}
}
12 changes: 6 additions & 6 deletions src/test/java/com/sendgrid/TestRequiredFilesExist.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public class TestRequiredFilesExist {
assertTrue(dockerExists);
}

// ./docker-compose.yml or ./docker/docker-compose.yml
@Test public void checkDockerComposeExists() {
boolean dockerComposeExists = new File("./docker-compose.yml").exists() ||
new File("./docker/docker-compose.yml").exists();
assertTrue(dockerComposeExists);
}
// // ./docker-compose.yml or ./docker/docker-compose.yml
// @Test public void checkDockerComposeExists() {
// boolean dockerComposeExists = new File("./docker-compose.yml").exists() ||
// new File("./docker/docker-compose.yml").exists();
// assertTrue(dockerComposeExists);
// }

// ./.env_sample
@Test public void checkEnvSampleExists() {
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/sendgrid/helpers/MailTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.sendgrid;

import com.fasterxml.jackson.databind.ObjectMapper;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down

0 comments on commit 258f80b

Please sign in to comment.