Git Product home page Git Product logo

datapine-test's Introduction

Datapine Java Developer Test (Solution)

Test for Datapine

This solution uses SpringBoot 1.4.3 and Java 8. It's very simple to package or run

It uses maven 3 so you can:

  • run using command-line mvn spring-boot:run
  • create a fat jar using mvn clean package
  • to run the package you will use java -jar datapine_test.jar

It uses an embedded jetty and an embedded H2 DB instance.

There are two users created at startup

  • login: admin

  • password: admin

  • access level: ROLE_ADMIN

  • login: user

  • password: user

  • access level: ROLE_USER

Using the endpoint http://localhost:8080/register is possible to create new users with ROLE_USER access level.

=============================================

INSTRUCTIONS:

You will now receive an application skeleton with a number of tasks to complete. The application is a web application, which uses Maven, JPA and Spring. It comes with an embedded H2 database and the Maven Jetty plugin configured, so running it should be easy.

You should clone this git repository https://github.com/datamint/datapine-test-app and work on the following tasks.

Your tasks:

  • Implement the UserDAO using JPA.
  • Implement the UserService using the UserDAO and transactions.
  • Implement a RESTful UserController to manage users.
  • Implement a simple user login dialog to login a user. Use HttpSession to store the user credentials to save time, Spring Security can also be used.
  • Use Spring AOP to log all login attempts via console output or log4j.

Big Bonus:

  • In addition to securing the URLs, secure access to ItemDAO (has to be created along side with Item domain) via spring security.
  • Restrict ItemDAO access if user is not authenticated by session. Filter any findBy~ and findAll method within ItemDAO. ACL has to be used in order to secure domain.
  • You can either create an API or prepare jUnit tests for adding&viewing Item object (only authenticated users can insert and view objects).

Flow to follow:

  • when a user is registered, create domain object as it is.
  • when an item is added, create domain object as well as an Acl entry for item domain
  • when item object is requested via find* methods filter out non authorized items. //item object must linked to user domain (acl_sid table has User.id as sid).

ACL domain security is actively used in datapine backend, so completing big bonus is most likely to be decisive for our application process. ItemDAO can include any attribute (it is just used to demonstrate ACL usage). Overall the test is fairly basic and straight forward and should give you enough room to show off some great things around it.

datapine-test's People

Contributors

antuneslucas avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.