Skip to content

Commit

Permalink
Exclude the RepositoryRestMvcAutoConfiguration class in order to avoi…
Browse files Browse the repository at this point in the history
…d repositories being directly exposed as REST API calls.
  • Loading branch information
gsmachado committed Sep 4, 2018
1 parent 4d85aa4 commit a5d18c5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import static org.springframework.boot.SpringApplication.run;

@SpringBootApplication
@SpringBootApplication(exclude = RepositoryRestMvcAutoConfiguration.class)
@EnableJpaRepositories({"io.iconator.commons.sql.dao"})
@EntityScan({"io.iconator.commons.model.db"})
@ComponentScan({
Expand All @@ -35,7 +36,7 @@ public static void main(String[] args) {
} catch (Throwable t) {
//ignore silent exception
if (!t.getClass().toString().endsWith("SilentExitException")) {
LOG.error("cannot execute core", t);
LOG.error("Cannot execute core.", t);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

import static org.springframework.boot.SpringApplication.run;

@SpringBootApplication
@SpringBootApplication(exclude = RepositoryRestMvcAutoConfiguration.class)
@ComponentScan({"io.iconator.commons.auth", "io.iconator.email"})
public class EmailApplication {
static { ConfigNaming.set("email.application"); }
Expand All @@ -20,7 +21,7 @@ public static void main(String[] args) {
} catch (Throwable t) {
//ignore silent exception
if (!t.getClass().toString().endsWith("SilentExitException")) {
LOG.error("cannot execute core", t);
LOG.error("Cannot execute email.", t);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import static org.springframework.boot.SpringApplication.run;

@SpringBootApplication
@SpringBootApplication(exclude = RepositoryRestMvcAutoConfiguration.class)
@EnableJpaRepositories({"io.iconator.commons.sql.dao"})
@EntityScan({"io.iconator.commons.model.db"})
@ComponentScan({
Expand All @@ -31,7 +32,7 @@ public static void main(String[] args) {
} catch (Throwable t) {
//ignore silent exception
if (!t.getClass().toString().endsWith("SilentExitException")) {
LOG.error("cannot execute kyc", t);
LOG.error("Cannot execute kyc.", t);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import static org.springframework.boot.SpringApplication.run;

@SpringBootApplication
@SpringBootApplication(exclude = RepositoryRestMvcAutoConfiguration.class)
@EnableJpaRepositories({"io.iconator.commons.sql.dao"})
@EntityScan({"io.iconator.commons.model.db"})
@ComponentScan({"io.iconator.commons.auth",
Expand All @@ -27,7 +28,7 @@ public static void main(String[] args) throws Exception {
} catch (Throwable t) {
//ignore silent exception
if (!t.getClass().toString().endsWith("SilentExitException")) {
LOG.error("cannot execute monitor", t);
LOG.error("Cannot execute monitor.", t);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import static org.springframework.boot.SpringApplication.run;

@SpringBootApplication
@SpringBootApplication(exclude = RepositoryRestMvcAutoConfiguration.class)
@EntityScan({"io.iconator.commons.model.db"})
@EnableJpaRepositories({"io.iconator.commons.sql.dao"})
@EnableAutoConfiguration
Expand All @@ -27,7 +28,7 @@ public static void main(String[] args) {
} catch (Throwable t) {
//ignore silent exception
if (!t.getClass().toString().endsWith("SilentExitException")) {
LOG.error("cannot execute rates", t);
LOG.error("Cannot execute rates.", t);
}
}
}
Expand Down

0 comments on commit a5d18c5

Please sign in to comment.