Giter Club home page Giter Club logo

gastolibro's People

Contributors

dvalfrid avatar

Watchers

 avatar  avatar  avatar  avatar

gastolibro's Issues

API for WebTokens

For admin functionalities.

Function for Logging in and Recieving a Token or some form of signature.
Function for Verifying signature.

Multiple Servlets mapping to Root

INFO [2017-07-04 18|44| 17,431] org.eclipse.jetty.util.log: Logging initialized @881ms to org.eclipse.jetty.util.log.Slf4jLog
||
INFO [2017-07-04 18|44| 17,476] io.dropwizard.server.SimpleServerFactory: Registering jersey handler with root path prefix: /
||
INFO [2017-07-04 18|44| 17,477] io.dropwizard.server.SimpleServerFactory: Registering admin handler with root path prefix: /admin
||
INFO [2017-07-04 18|44| 17,478] io.dropwizard.assets.AssetsBundle: Registering AssetBundle with name: home for path /*
||
INFO [2017-07-04 18|44| 17,566] io.dropwizard.server.SimpleServerFactory: Registering jersey handler with root path prefix: /
||
INFO [2017-07-04 18|44| 17,566] io.dropwizard.server.SimpleServerFactory: Registering admin handler with root path prefix: /admin
||
INFO [2017-07-04 18|44| 17,567] io.dropwizard.server.ServerFactory: Starting gastolibro
||
INFO [2017-07-04 18|44| 17,648] org.eclipse.jetty.setuid.SetUIDListener: Opened gastolibro@277b8fa4{HTTP/1.1,[http/1.1]}{0.0.0.0:3000}
||
INFO [2017-07-04 18|44| 17,650] org.eclipse.jetty.server.Server: jetty-9.4.z-SNAPSHOT
||
INFO [2017-07-04 18|44| 17,835] org.eclipse.jetty.server.AbstractConnector: Started gastolibro@277b8fa4{HTTP/1.1,[http/1.1]}{0.0.0.0:3000}
||
ERROR [2017-07-04 18|44| 17,837] io.dropwizard.cli.ServerCommand: Unable to start server, shutting down
|| ! java.lang.IllegalStateException: Multiple servlets map to path /: home[mapped:JAVAX_API:null],io.dropwizard.jersey.setup.JerseyServletContainer-5f172d4a[mapped:EMBEDDED:null]
|| ! at org.eclipse.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1414)
|| ! at org.eclipse.jetty.servlet.ServletHandler.doStart(ServletHandler.java:156)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
|| ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
|| ! at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:120)
|| ! at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:830)
|| ! at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
|| ! at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:799)
|| ! at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
|| ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
|| ! at com.codahale.metrics.jetty9.InstrumentedHandler.doStart(InstrumentedHandler.java:103)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
|| ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
|| ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
|| ! at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:290)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
|| ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
|| ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
|| ! at org.eclipse.jetty.server.handler.StatisticsHandler.doStart(StatisticsHandler.java:252)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
|| ! at org.eclipse.jetty.server.Server.start(Server.java:452)
|| ! at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
|| ! at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
|| ! at org.eclipse.jetty.server.Server.doStart(Server.java:419)
|| ! at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
|| ! at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
|| ! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
|| ! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:85)
|| ! at io.dropwizard.cli.Cli.run(Cli.java:74)
|| ! at io.dropwizard.Application.run(Application.java:89)
|| ! at net.valfridsson.gastolibro.GastolibroApplication.main(GastolibroApplication.java:21)
||
INFO [2017-07-04 18|44| 17,846] org.eclipse.jetty.server.AbstractConnector: Stopped gastolibro@277b8fa4{HTTP/1.1,[http/1.1]}{0.0.0.0:3000}
||
INFO [2017-07-04 18|44| 17,846] org.eclipse.jetty.server.handler.ContextHandler: Stopped i.d.j.MutableServletContextHandler@4596f8f3{/,null,UNAVAILABLE}
||
|| Multiple servlets map to path /
: home[mapped:JAVAX_API:null],io.dropwizard.jersey.setup.JerseyServletContainer-5f172d4a[mapped:EMBEDDED:null]
||
|| [Finished in 4 seconds with code 1]

API for Captchas

Get Source and Id for captcha.. verify Captcha answer and wether or not to present captcha.

Need Fuzzy Search API

Using Postgres or self-implemented Suffix Tree, whichever works!

https://www.postgresql.org/docs/8.3/static/fuzzystrmatch.html PSQL Fuzzy Search

Fuzzy Search Should return a JSON object with two fields

  • suggestions which should contain an Array or strings, "the suggestions"
  • entries which should contain an array of entries corresponding to the suggestions

At the moment the db will be Queried every keypress, this might become a performance issue, if it does. We'll solve that problem when it arises! 🥇

Api for fecthing countries and cities

Suggestion:

GET /api/countries?term=SEARCHEDTERM -> JSON list of countries
GET /api/cities?country=COUNTRY&term=SEARCHEDTERM -> JSON list of cities

Tests keep fail

|| Tests run: 4, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.362 sec <<< FAILURE!
src/test/java/net/valfridsson/gastolibro/jdbi/EntryDaoTest.java|<findAll>|
|| java.lang.AssertionError:
|| Expecting:
|| <[net.valfridsson.gastolibro.core.Entry@2d480e69,
|| net.valfridsson.gastolibro.core.Entry@878fbb0,
|| net.valfridsson.gastolibro.core.Entry@392096f7,
|| net.valfridsson.gastolibro.core.Entry@b8b803e,
|| net.valfridsson.gastolibro.core.Entry@af0bfa79,
|| net.valfridsson.gastolibro.core.Entry@6cd25058]>
|| to contain only:
|| <[net.valfridsson.gastolibro.core.Entry@b8b803e,
|| net.valfridsson.gastolibro.core.Entry@392096f7,
|| net.valfridsson.gastolibro.core.Entry@878fbb0,
|| net.valfridsson.gastolibro.core.Entry@2d480e69]>
|| but the following elements were unexpected:
|| <[net.valfridsson.gastolibro.core.Entry@af0bfa79,
|| net.valfridsson.gastolibro.core.Entry@6cd25058]>
||
|| at net.valfridsson.gastolibro.jdbi.EntryDaoTest.findAll(EntryDaoTest.java:32)
|| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|| at java.lang.reflect.Method.invoke(Method.java:498)
|| at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
|| at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
|| at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
|| at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
|| at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
|| at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
|| at org.junit.rules.RunRules.evaluate(RunRules.java:20)
|| at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
|| at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
|| at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
|| at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
|| at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
|| at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
|| at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
|| at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
|| at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
|| at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
|| at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
|| at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
|| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|| at java.lang.reflect.Method.invoke(Method.java:498)
|| at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
|| at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
|| at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
|| at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
|| at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
||
src/test/java/net/valfridsson/gastolibro/jdbi/EntryDaoTest.java|<findX>|
|| java.lang.AssertionError:
|| Expecting:
|| <[net.valfridsson.gastolibro.core.Entry@7be8ba4d,
|| net.valfridsson.gastolibro.core.Entry@ff6ee0d4,
|| net.valfridsson.gastolibro.core.Entry@2559ca1b,
|| net.valfridsson.gastolibro.core.Entry@1d64562,
|| net.valfridsson.gastolibro.core.Entry@856c76e9,
|| net.valfridsson.gastolibro.core.Entry@5c729d70,
|| net.valfridsson.gastolibro.core.Entry@eab01cf7,
|| net.valfridsson.gastolibro.core.Entry@bd1b063e]>
|| to contain only:
|| <[net.valfridsson.gastolibro.core.Entry@7be8ba4d,
|| net.valfridsson.gastolibro.core.Entry@ff6ee0d4]>
|| but the following elements were unexpected:
|| <[net.valfridsson.gastolibro.core.Entry@2559ca1b,
|| net.valfridsson.gastolibro.core.Entry@1d64562,
|| net.valfridsson.gastolibro.core.Entry@856c76e9,
|| net.valfridsson.gastolibro.core.Entry@5c729d70,
|| net.valfridsson.gastolibro.core.Entry@eab01cf7,
|| net.valfridsson.gastolibro.core.Entry@bd1b063e]>
||
|| at net.valfridsson.gastolibro.jdbi.EntryDaoTest.findX(EntryDaoTest.java:48)
|| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|| at java.lang.reflect.Method.invoke(Method.java:498)
|| at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
|| at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
|| at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
|| at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
|| at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
|| at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
|| at org.junit.rules.RunRules.evaluate(RunRules.java:20)
|| at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
|| at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
|| at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
|| at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
|| at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
|| at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
|| at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
|| at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
|| at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
|| at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
|| at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
|| at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
|| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|| at java.lang.reflect.Method.invoke(Method.java:498)
|| at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
|| at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
|| at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
|| at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
|| at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
||
||
|| Results :
||
src/test/java/net/valfridsson/gastolibro/jdbi/EntryDaoTest.java|<findAll>| (..)
|| findX(net.valfridsson.gastolibro.jdbi.EntryDaoTest): (..)
||
|| Tests in error:
|| net.valfridsson.gastolibro.GastolibroApplicationTest: Multiple servlets map to path /*: home[mapped:JAVAX_API:null],io.dropwizard.jersey.setup.JerseyServletContainer-60e9c3a5[mapped:EMBEDDED:null]
||
|| Tests run: 7, Failures: 2, Errors: 1, Skipped: 0
||

Final Issue

API för Captchat.

Strukturer

Submit strukturen ser nu annorlunda ut
POST mot /api/entries (samma som förut, förväntar mig inget svar. Såvida inte vi vill lägga in en verifikation, finns ingen för tillfället.)
{
captcha: {
id: ETT_ID,
answer: ETT_SVAR
}
entry: {
title: EN_TITEL,
text: EN_TEXT,
time: TID,
name: NAMN,
email: EN_EMAIL,
country: ETT_LAND,
city: EN_STAD
}
}

NYA APIpunkter

GET /api/captcha (Kommer skicka dit 1gång varje gång någon öppnar fliken där man skriver in inlägg)

förväntar mig ett svar med följande struktur.

{
check: BOOL,
captcha: {
id: CAPTCHA_ID,
description: BESKRIVNING_AV_VAD_DE_SKA_GÖRA,
images: [LISTA_AV_FULLA_URL_LÄNKAR_TILL_BILDERNA] (ex, "captchas/captcha1/image1.jpg")
}
}

captcha kan vara null eller inte ens finnas där ifall BOOL = false

POST /api/captcha/check
Du får följande

{
answer: [LISTA_AV_FULLA_URL_LÄNKAR], (De som valts som svar)
id: CATCHA_ID
}

Förväntar mig endast en statuskod tillbaka

200 ifall det var rätt svar... något annat än 200 ifall det var fel svar.

Denna funktionen kommer kallas relativt ofta, varje gång de klickar på en bild, så se till att jämförelsefunktionen inte är allt för tung :)

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.