Code Monkey home page Code Monkey logo

jivago's People

Contributors

dependabot[bot] avatar keotl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jivago-python

jivago's Issues

Streams().first()

AS a user of the Stream class of Jivago I would like to have a first() function to retrieve the first element of a given Stream.

Acceptance Criteria

a_list = [1,2,3]

first = Stream(a_list).first()

assertEqual(1, first)
an_empty_list = []

first = Stream(an_empty_list).first()

assertIsNone(first)

Note: A java Optional equivalent could be implemented to handle second case.

Error when getting root static folder

Static file served from "/". When getting "/", the server returns 500 internal server error.

2019-01-24 10:29:52 [ExceptionFilter] [ERROR] Traceback (most recent call last):
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/error_handling/unknown_exception_filter.py", line 17, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/templating/template_filter.py", line 23, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/request/json_serialization_filter.py", line 17, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/request/http_form_deserialization_filter.py", line 16, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/body_serialization_filter.py", line 16, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/error_handling/application_exception_filter.py", line 27, in doFilter
raise e
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/error_handling/application_exception_filter.py", line 21, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/jivago_banner_filter.py", line 13, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 20, in doFilter
gotten_response = invoker.invoke(request)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/invocation/rewrite/path_rewriting_route_handler_decorator.py", line 16, in invoke
return self.decorated.invoke(ModifiedPathFlyweightRequest(request, self.new_path))
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/invocation/resource_invoker.py", line 29, in invoke
function_return = method(*parameters)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/routing/serving/static_file_serving_resource.py", line 12, in serve_file
with open(self.filepath, 'rb') as f:
IsADirectoryError: [Errno 21] Is a directory: '/home/atreides/Documents/lecture-bingo/web_ui/build/'

Simple redirects

e.g. redirect "/" to "/index.html"

  • Using a RoutingRule
  • Using a simple return from a resource class

Websockets integration

Add new RouterConfigRule which rewrites request to a background worker/routing table.
Might become a separate package. (i.e. jivago-websockets)

Wrong filter order in DebugJivagoContext

    @Override
    def get_filters(self, path: str) -> List[Type[Filter]]:
        return [NoCorsFilter, DebugExceptionFilter] + super().get_filters(path)

Otherwise, it interferes with default exception mappers.

Deserialization of map into typed dict

As a user of jivago's ObjectMapper, I would like to be able to deserialize into typed Dict, SO that I can deserialize more complex objects.
Acceptance criteria:
This json

{
"stats": {
        "0": {
            "rank": 1,
            "score": 41480
        },
        "1": {
            "rank": 2,
            "score": 40847
        }
    }
}

can be deserialized into

@Serializable
class AnyObject(object):
    def __init__(self, stats: Dict[str, Stat)):
        self.stats: Dict[str, Stat] = stats

class Stat(object):
    def __init__(self, rank: int, score: int):
        self.rank: int = rank
        self.score: int = score

Failing on OPTION http request due to cors requests.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Additionally, for HTTP request methods that can cause side-effects on user data (in particular, for HTTP methods other than GET, or for POST usage with certain MIME types), the specification mandates that browsers "preflight" the request, soliciting supported methods from the server with an HTTP OPTIONS request method, and then, upon "approval" from the server, sending the actual request with the actual HTTP request method. Servers can also notify clients whether "credentials" (including Cookies and HTTP Authentication data) should be sent with requests.

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.