From d1d3b356990147101e2e1bebf77648a88d368f37 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Wed, 26 Sep 2018 11:35:26 +0100 Subject: [PATCH] Formatting --- .../Observations/ObservationsApplication.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/uk/co/neviyn/Observations/ObservationsApplication.java b/backend/src/main/java/uk/co/neviyn/Observations/ObservationsApplication.java index e095006..16eb017 100644 --- a/backend/src/main/java/uk/co/neviyn/Observations/ObservationsApplication.java +++ b/backend/src/main/java/uk/co/neviyn/Observations/ObservationsApplication.java @@ -25,17 +25,13 @@ import uk.co.neviyn.Observations.resources.TutorResource; public class ObservationsApplication extends Application { private final HibernateBundle hibernate = new HibernateBundle( - Observation.class, - Tutor.class, - Site.class - ) { + Observation.class, Tutor.class, Site.class) { @Override public DataSourceFactory getDataSourceFactory(ObservationsConfiguration configuration) { return configuration.getDataSourceFactory(); } }; - public static void main(String[] args) throws Exception { new ObservationsApplication().run(args); } @@ -50,12 +46,9 @@ public class ObservationsApplication extends Application() - .setAuthenticator(new SimpleAuthenticator(observationsConfiguration.getAdminPassword())) - .setRealm("SECURITY") - .buildAuthFilter() - )); + jersey.register(new AuthDynamicFeature(new BasicCredentialAuthFilter.Builder() + .setAuthenticator(new SimpleAuthenticator(observationsConfiguration.getAdminPassword())).setRealm("SECURITY") + .buildAuthFilter())); jersey.register(new AuthValueFactoryProvider.Binder<>(User.class)); TutorDao tutorDao = new TutorDao(hibernate.getSessionFactory()); SiteDao siteDao = new SiteDao(hibernate.getSessionFactory());