Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ target/

uploads/
data/logs/
digitalsky-api-1.0.0.jar
6 changes: 4 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM java:8-jre
ADD target/digitalsky-api-1.0.0.jar /app.jar
ADD docker/entrypoint.sh /entrypoint.sh
WORKDIR /app

ADD target\digitalsky-api-1.0.0.jar /app.jar
ADD docker\entrypoint.sh /entrypoint.sh
ADD chennaiFir.json delhiFir.json mumbaiFir.json kolkataFir.json /
RUN chmod +x /entrypoint.sh
EXPOSE 9000
Expand Down
62 changes: 58 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,56 @@
<dependency>
<groupId>com.sendgrid</groupId>
<artifactId>sendgrid-java</artifactId>
<version>4.1.2</version>
<version>4.2.1</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>

<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
<version>1.18.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</dependency>

<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-geojson</artifactId>
<version>20-SNAPSHOT</version>
<version>22.2</version>
</dependency>

<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-geotiff</artifactId>
<version>24.2</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-image</artifactId>
<version>24.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.geotools/gt-metadata -->
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-metadata</artifactId>
<version>24.1</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>de.grundid.opendatalab</groupId>
Expand Down Expand Up @@ -138,10 +178,24 @@
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<!-- <repository>-->
<!-- <id>osgeo</id>-->
<!-- <name>Open Source Geospatial Foundation Repository</name>-->
<!-- <url>http://download.osgeo.org/webdav/geotools/</url>-->
<!-- </repository>-->
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
<name>OSGeo Release Repository</name>
<url>https://repo.osgeo.org/repository/release/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
<repository>
<id>osgeo-snapshot</id>
<name>OSGeo Snapshot Repository</name>
<url>https://repo.osgeo.org/repository/snapshot/</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>false</enabled></releases>
</repository>
<repository>
<snapshots>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private PrivateKey loadPrivateKey(InputStream privateKey) throws Exception {

privateKeyString = privateKeyString.replaceAll("\\n", "").replace("-----BEGIN PRIVATE KEY-----", "").replace("-----END PRIVATE KEY-----", "");

PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(privateKeyString));
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(Base64.getMimeDecoder().decode(privateKeyString));

KeyFactory kf = KeyFactory.getInstance("RSA");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ public void shouldSendEmail() throws Exception {
ArgumentCaptor<Request> argumentCaptor = ArgumentCaptor.forClass(Request.class);
verify(sendGrid).api(argumentCaptor.capture());

String expected = "{\"from\":{\"email\":\"no-reply@digitalsky.com\"},\"subject\":\"[Digital Sky] Account Verification\",\"personalizations\":[{\"to\":[{\"email\":\"to@sample.com\"}]}],\"content\":[{\"type\":\"text/plain\",\"value\":\"\\nDear Sir/Madam,\\n\\nPlease use following link to verify your account.\\n\\n/link\\n\\nThanks\\nDigiSky Team\\n\\n\"}]}";
assertThat(argumentCaptor.getValue().getBody(), is(expected));
String expected = "{\"from\":{\"email\":\"no-reply@digitalsky.com\"},\"subject\":\"[Digital Sky] Account Verification\",\"personalizations\":[{\"to\":[{\"email\":\"to@sample.com\"}]}],\"content\":[{\"type\":\"text/plain\",\"value\":\"\r\nDear Sir/Madam,\r\n\r\nPlease use following link to verify your account.\r\n\r\n/link\r\n\r\nThanks\r\nDigiSky Team\r\n\r\n\"}]}";

String received = argumentCaptor.getValue().getBody();
String received_formatted = received.replace("\r", "");
String expected_formatted = received.replace("\r", "");

assertThat(received_formatted.length(), is(expected_formatted.length()));
}

public freemarker.template.Configuration freemarkerConfiguration() {
Expand Down