Giter Club home page Giter Club logo

eiffelwebframework / ewf Goto Github PK

View Code? Open in Web Editor NEW
44.0 7.0 26.0 17.49 MB

Eiffel Web Framework -- Provide a common framework to build easily web server application in Eiffel (portable on various connector and platforms)

Home Page: http://eiffelweb.projects.eiffel.org/

License: Other

Eiffel 64.21% JavaScript 20.03% CSS 3.00% HTML 1.08% Shell 0.20% CoffeeScript 2.56% Smarty 0.13% C 6.92% C++ 0.33% Makefile 0.89% Python 0.12% Batchfile 0.53% Euphoria 0.01%
eiffel web-dev server httpd

ewf's Introduction

Eiffel Web Framework

Build Status

Overview

The Eiffel Web Framework (EWF) provides Eiffel users with a layer to build anything on top of the http protocol such as websites, web API/services.

This layer is multi-platform: it can be set on Windows, Linux operating systems, and in addition it can run on top of any httpd servers such as Apache2, IIS, nginx, lighttpd. EWF includes as well a standalone httpd web server component, written in Eiffel, which enables users to run easily a web server on their machine, or even embed this component in any application written with Eiffel.

Currently EWF offers a collection of Eiffel libraries designed to be integrated with each others, and among other functionalities, it give simple access to the request data, to handle content negotiation, url dispatcher, integrate with openid system, and so on.

There is a growing ecosystem around EWF, that provides useful components:

  • OpenID and OAuth consumer library
  • Various hypermedia format such as HAL, Collection+json, ...
  • Websocket server and client
  • Template engine
  • API Auto-documentation with swagger
  • A simple experimental CMS.
  • ...

So if you want to build a website, a web api, RESTful service, ... or even if you want to consume other web api, EWF is a solution.

EWF brings with it all the advantages of the Eiffel technology and tools with its powerful features such as Design by Contract, debugging, testing tools which enable to build efficient systems expected to be repeatedly refined, extended, and improved in a predictable and controllable way so as to become with time bugfree systems. Enjoy the full power of debugging your web server application from the IDE.

Project

Official project site for Eiffel Web Framework:

For more information please have a look at the related wiki:

For download, check

Tasks and issues are managed with github issue system

Requirements

  • Compiling from EiffelStudio 16.05 to 17.05 and more recent version of the compiler.
  • Currently being developped using EiffelStudio 17.01 (on Windows, Linux)
  • Tested using EiffelStudio 17.01 with "jenkins" CI server.
  • The code have to allow void-safe compilation and non void-safe system (see more about void-safety

How to get the source code?

Using git

  • git clone https://github.com/EiffelWebFramework/EWF.git

  • And to build the required and related Clibs

    • cd contrib/ise_library/cURL
    • geant compile

Libraries under 'library'

server

  • ewsgi: Eiffel Web Server Gateway Interface read more
    • connectors: various web server connectors for EWSGI
  • libfcgi: Wrapper for libfcgi SDK
  • wsf: Web Server Framework read more
    • router: URL dispatching/routing based on uri, uri_template, or custom read more

protocol

  • http: HTTP related classes, constants for status code, content types, ... read more
  • uri_template: URI Template library (parsing and expander) read more
  • CONNEG: Content negotiation library (Content-type Negociation) read more

client

  • http_client: simple HTTP client based on cURL read more

text

  • encoder: Various simpler encoders: base64, url-encoder, xml entities, html entities read more

Others

  • error: very simple/basic library to handle error

Draft folder = call for contribution

Examples

..

Contributing to this project

Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.

Community

Keep track of development and community news.

For more information please have a look at the related workbook documentation

ewf's People

Contributors

berenddeboer avatar colin-adams avatar fjacky avatar jocelyn avatar jvelilla avatar pacoispaco avatar souvarin avatar ynh avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ewf's Issues

Error during C compilation using libfcgi connector

Issue

C compilation fails when using libfcgi as a connetor (rather than nino or cgi).

Error message

Compiling C code in C7
Compiling C code in C6
In file included from big_file_C6_c.c:16:
fc170.c: In function ‘inline_F170_2831’:
fc170.c:41: error: ‘environ’ undeclared (first use in this function)
fc170.c:41: error: (Each undeclared identifier is reported only once
fc170.c:41: error: for each function it appears in.)
Compiling C code in C5

How to reproduce

Use the "simple" example that comes with EWF and choose "simple_libfcgi" as target.

System used

EiffelStudio 7.2
OS X 10.7
gcc i686-apple-darwin11-llvm-gcc-4.2
EWF - git revision (rev: 09f32e7)

Graphviz server: example, ...

Install on OpenShift: done
Install somewhere else: ... not needed
Add a profile link to add application semantic (APLS): ?
Add queries: ?

Make WSF_RESPONSE more user friendly / flexible : without content-length

Allow code to put content back to the client without specifying a content-length

On HTTP/1.1 this could be implemented using chunked encoding
On HTTP/1.0 .. chunked encoding is not permitted, so we could buffer the content, and send everything including computed content-length when the request processing is done.

(i.e when the system call WGI_RESPONSE.push)

I guess this could be achieved using WGI_FILTER_RESPONSE.

OpenID consumer

Being able to connect an OpenID provider.

So far integrated with the CMS component.

HEAD response not returning same headers as GET response

The GET response has Date, Server, Content-length and Content-type. The HEAD response only has the first two.
Server is provided by Apache (this is libfcgi connector).

Debugging shows that at the time of committing the response, the WSF_HEAD_RESPONSE_WRAPPER.header has all three fields.

Perhaps this is a problem with libfcgi or Apache, rather than EWF.

Needs further investigation.

Google API based on cypress

Provide an Eiffel library that abstract the notion of web api, to be able to manipulate Google API as any Eiffel library.

This is not critical, but could really help to build mashup application.

Provide notion of EWF app

We could have a WSF_APP that would be easily attached to a WSF_SERVICE ... I mean mainly Router
and the idea would be to have reusable application component.

For instance we could have a WSF_USER_APP .. that would handle the login,register, reset password ... and that could be reused easily.

Nino SCOOP -> EWF

Integrate nino/concurrent with EWF

suspended for now due to non obvious design issue

Conditional router

For now router dispatch request based on

  • request methods
  • mapping (could be URI, URI-template, ...)

It would be convenient to have an optional condition ... that could be for instance

  • Content-type checking ... if Accept is text/html for instance ...
  • could also be Accept-Language ...
  • and ... any condition the user could think of.

Add void-safe assertions for non void-safe code

In order to generate autotests in non void-safe mode
this would be pleasant to have assertion related to attachement status.

This is useless in void-safe mode, and make the code heavier,
but in non void-safe mode, this is still valuable.

Note that only public interface would need that, no need to put such assertion in implementation feature of EWF, since EWF is regularly compiled in void-safe mode, and thus tests for such assertion.

Need to detect connection closure within a handler

As well as being able to close the connection within a handler (needed, for example, if streaming, and there is an error, so close connection before sending end chunk), it would be good to be able to being informed of the closure of a connection (perhaps by a callback?).

I have a specific need to manage connections to a back-end server (which does the real work). Connections to a database server might be another use case.

Provide a WSF service dedicated to website

Provide a WSF_SERVICE dedicated to website.
That is to say ...

  • handling correctly the various status code
  • handling file system
  • more assertions
  • check document under /doc folder

We could use a specific WSF_RESPONSE that check the header is coherent as well.

Colin had idea/request about such task

Automatically generate a response entity for custom errors

When using the policy-driven framework, the author of a handler is expected to call req.error_handler.add_custom_error in routines such as check_resource_exists. For example, if the handler handles URI templates, and not all values for a template variable are valid.

The framework generates a response using the supplied status code, but the name and message arguments are ignored - no response entity is generated.

A response entity ought to be generated using the name as a title/heading and the message as a body. This can be done automatically.

Normally the status code will be 404 or 400. I suppose it is possible that authors might use other codes that automatically generated responses won't be able to meet all SHOULDs for. I think probably that ONLY 400, 404 and 500 should be allowed in these routines, and we could add postconditions to limit the errors to these.

add Date/Time format support

From RFC2616 sec 3.3
HTTP applications have historically allowed three different formats for the representation of date/time stamps:

  Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
  Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
  Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format

The first format is preferred as an Internet standard and represents a fixed-length subset of that defined by RFC 1123 [8](an update to RFC 822 [9]). The second format is in common use, but is based on the obsolete RFC 850 [12] date format and lacks a four-digit year. HTTP/1.1 clients and servers that parse the date value MUST accept all three formats (for compatibility with HTTP/1.0), though they MUST only generate the RFC 1123 format for representing HTTP-date values in header fields. See section 19.3 for further information.
More documentation here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3

Github API based on cypress

provide Eiffel lib based on cypress to access github web api.
This should abstract the notion of OAuth ... and be simple to use.

Support chunked encoding from input data

Currently if the request input data are sent using the Transfer-Encoding: chunked we do not handle it
so either support it in the MIME handler system from WSF_REQUEST
or directly from WSF_INPUT_STREAM

Parsed version of server_protocol

I propose a new class, WSF_PROTOCOL_VERSION. And a detachable attribute of this type in WSF_REQUEST.

It will contain fields such as:

protocol: IMMUTABLE_STRING_8
major, minor: NATURAL
extension_tokens: ???

Then VERY early on in the handling of a request, req.server_protocol is parsed into one of these (and response code 506 returned if parsing fails, or it is not an HTTP protocol).

Then subsequent processing can require this is attached. And it can be used for faster checking of HTTP/1.0.

Query parameters without any value are ignored.

Parsing ?foo=123&bar&foobar=456

will add on foo' andfoobar' to the query parameters, and ignore `bar'

Solution: handle `bar' as empty parameters, then have foo, bar and foobar query parameters.

note: this also impact the URI template matcher code.

Class Relies on other Class with Less Strict Void Safety Settings

The following error stops the clean compile of the "simple" project when opening for the first time in Windows.

    Description Location    Position    
2   VD88: A class relies on another class with less strict void safety settings. Provider class: WSF_DEFAULT_SERVICE.   APPLICATION (simple)    10, 2   
    Error code: VD88

Configuration error: a class relies on another class with less strict void safety settings.
What to do: change void safety options so that ancestor or supplier provides higher or equal void safety.

Class: APPLICATION
Other class: WSF_DEFAULT_SERVICE
Line: 10
inherit
-> WSF_DEFAULT_SERVICE
redefine

I have double-checked each target to ensure it is set to Complete Void Safety. Not sure what is wrong.

Bug in CONNEG_SERVER_SIDE

The postcondition mime_default_set of make is in error. It should read:

mime_default_set: mime_default = a_mime

As it is, gelint issues a VWEQ error as MIME_PARSER is being compared with READABLE_STRING_8

IDEA: what about getting rid of WSF_ prefix and rename some classes

Renaming

WSF_REQUEST -> SERVER_REQUEST
WSF_RESPONSE -> SERVER_RESPONSE
WSF_SERVICE -> SERVER_SERVICE

But if we start that, we should get rid of any WSF_ prefix ... here are the classes starting with WSF_

WSF_APPLICATION_X_WWW_FORM_URLENCODED_HANDLER
WSF_ERROR
WSF_FILE_RESPONSE
WSF_MIME_HANDLER
WSF_MIME_HANDLER_HELPER
WSF_MULTIPART_FORM_DATA_HANDLER
WSF_MULTIPLE_STRING
WSF_REQUEST
WSF_RESPONSE
WSF_RESPONSE_MESSAGE
WSF_SERVICE
WSF_STRING
WSF_TABLE
WSF_VALUE
WSF_VALUE_VISITOR
WSF_DOWNLOAD_RESPONSE
WSF_FORCE_DOWNLOAD_RESPONSE
WSF_HEADER
WSF_PAGE_RESPONSE
WSF_VALUE_AGENT_ITERATOR
WSF_VALUE_ITERATOR
WSF_VALUE_NULL_VISITOR

Web socket / client

Implement client side websocket
Could be useful to build vision2 application consuming web api for instance.

Concrete case firebase web api.

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.