Commit Graph

179 Commits

Author SHA1 Message Date
Olivier Ligot
35729b4ab6 Use port number 9090 instead of 80
Port 80 is often already used by standard webservers (Apache, nginx, ...).
Moreover, on Linux, ports below 1024 can only be opened by root.
2013-05-27 09:15:12 +02:00
Jocelyn Fiat
01cab452d8 Removed WSF_URI_*_ROUTER_HELPER and use instead the WSF_URI_*_HELPER_FOR_ROUTED_SERVICE
(the removed class were not in latest release, so this is safe to use the new name)
Cosmetic
2013-03-27 17:00:58 +01:00
Colin Adams
4875ca9ff1 now all-safe.ecf compiles again 2013-03-27 14:44:14 +00:00
Colin Adams
a74fcd0575 delete ecf 2013-03-27 14:37:56 +00:00
Jocelyn Fiat
178a48cd7e Updated all-safe.ecf
(add all-stable-safe.ecf that includes only the library, examples and specific draft lib)
2013-03-27 15:22:32 +01:00
Colin Adams
f11dbd9080 fix merge conflict from master 2013-03-21 15:55:14 +00:00
Jocelyn Fiat
3f237c737d mimic design of WSF_ROUTED_SERVICE for WSF_FILTERED_SERVICE
and update the filter example to make it simpler and reuse code.
2013-03-19 22:00:25 +01:00
Jocelyn Fiat
b629bba5cc WSF_CORS_OPTIONS_FILTER should not inherit from WSF_URI_TEMPLATE_HANDLER 2013-03-19 17:09:18 +01:00
Jocelyn Fiat
3faa2ab815 Moved all *_CONTEXT_* router related classes into wsf_router_context.ecf library
This makes wsf simpler to discover.
And advanced context enabled handler, mapping, ... are still available for now in wsf_router_context.ecf library
2013-03-19 11:54:01 +01:00
Colin Adams
7435b4f454 refactored for WSF_ROUTED_SKELETON_SERVICE 2013-03-18 14:45:04 +00:00
Colin Adams
d56f4e6c7d prior to refactoring for WSF_ROUTED_SKELETON_SERVICE 2013-03-18 14:21:53 +00:00
Colin Adams
d01f47f1ee Implemented 414 and 503 responses on WSF_ROUTED_SERVICE 2013-03-16 15:12:58 +00:00
Olivier Ligot
c8845e7354 Fix indentation 2013-03-15 14:18:13 +01:00
Olivier Ligot
69495e69a9 Filter example: remove unused libraries in ecf file 2013-03-15 13:44:24 +01:00
Olivier Ligot
496b831956 Merge remote-tracking branch 'jocelyn/flexible_response' into cors
Conflicts:
	examples/filter/filter-safe.ecf
	examples/filter/src/filter_server.e
	library/network/protocol/http/src/http_header.e
	library/server/wsf/src/wsf_response.e
2013-03-15 13:33:13 +01:00
Jocelyn Fiat
56df2b085e Fixing global EWF compilation 2013-01-31 16:21:16 +01:00
Jocelyn Fiat
a5c9329ada Fixing global EWF compilation 2013-01-31 16:20:38 +01:00
Jocelyn Fiat
860959879c Removed eel and eapml contrib/library from EWF
Since there are available from $ISE_LIBRARY
2013-01-23 18:13:22 +01:00
Jocelyn Fiat
393a4fc1bf Removed useless dependencies on other lib. 2013-01-23 16:22:03 +01:00
Jocelyn Fiat
d1873d9645 Merge pull request #26 from oligot/no-context
Use execution_variable instead of context
2013-01-23 02:00:38 -08:00
Olivier Ligot
10c02219e3 Use execution_variable instead of context
This is mainly to be compatibe with other classes API.

In a lot of classes, we define methods like this:
```Eiffel
 method (req: WSF_REQUEST; res: WSF_RESPONSE)
    do
        ...
    end
```

With the context, the signature becomes:
```Eiffel
 method (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
    do
        ...
    end
```

So, I can't build a filter chain where one filter is with context
and one is without context (I can't call
WSF_FILTER.set_next (a_next: WSF_FILTER) with a filter that is a
descendant of WSF_CONTEXT_HANDLER).

Moreover, having to play with generic types just to pass some
data from one filter to another is a bit overkill imho.
Because this is really what I use contexts for:
to pass data from one filter to the next one.

Regarding execution_variable and strong typing, if we want to achieve these,
I realize we could write a class with one getter and one setter like this:

```Eiffel
  class
    TYPED_DATA

  feature -- Access

  user (req: WSF_REQUEST): detachable USER
    do
        if attached {USER} req.execution_variable ("user") as l_user then
            Result := l_user
        end
    end

  feature -- Element change

  set_user (req: WSF_REQUEST; a_user: USER)
    do
        req.set_execution_variable ("user", a_user)
    end
```

Now, I realize this is a major change since the last time we talked about this,
but at the end, after having played with both, I prefer the one with
execution_variable.
2013-01-23 10:20:03 +01:00
Olivier Ligot
af58d87d79 Filter example: all libraries are now readonly 2013-01-22 16:42:53 +01:00
Olivier Ligot
ff57d0ecd4 Cross-Origin Resource Sharing initial support
Initial support for the Cross-Origin Resource Sharing specification.
This allows JavaScript to make requests across domain boundaries.

Also reviewed the filter example to get rid of the context and
the generic classes (we can actually use {WSF_REQUEST}.execution_variable
and {WSF_REQUEST}.set_execution_variable).

Links:
* How to enable server-side: http://enable-cors.org/server.html
* Specification: http://www.w3.org/TR/cors/
* Github: http://developer.github.com/v3/#cross-origin-resource-sharing
2013-01-09 17:34:50 +01:00
Jocelyn Fiat
619be9a8cd Added a few library_target to .ecf to be able to build the tests/all-safe.ecf
that enables us to check quickly the compilation state of EWF, and also perform refactorying over many projects.
2012-12-19 16:45:45 +01:00
Jocelyn Fiat
aa65c16957 Breaking changes:
added `a_request_methods' argument to WSF_ROUTER_SELF_DOCUMENTATION_HANDLER.mapping_documentation
 added similar argument to WSF_ROUTER_SELF_DOCUMENTATION_ROUTER_MAPPING.documentation
Renamed WSF_ROUTER_METHODS as WSF_REQUEST_METHODS
Enhanced WSF_REQUEST_METHODS with new has_... function
Added WSF_ROUTER_VISITOR and WSF_ROUTER_ITERATOR that may be useful to iterate inside the router.
   we may improve the implementation of the router using those visitors in the future.
Improved the WSF_DEFAULT_RESPONSE to embedded suggested items (typically based on pseudo self documented router)
2012-12-19 16:42:26 +01:00
Jocelyn Fiat
f3aeb67e16 changed UUID since this is the same a restbuckCRUD example. 2012-12-19 00:26:11 +01:00
Colin Adams
eafb04719d Actioned Jocelyns comments re. a_req and a_res 2012-12-11 19:26:06 +00:00
Colin Adams
365da7e30a merged from upstream 2012-12-08 08:25:47 +00:00
Colin Adams
58f26fdc1b Revert do_get_head patch 2012-12-06 19:48:13 +00:00
Olivier Ligot
075ac1d628 Logging filter
The logging filter is now part of EWF core (before it was only available in
the filter example) and can therefore be reused by others needing it.
Note that this is a first implementation. It can certainly be improved in
the future to support more fine grained logging.
2012-12-05 22:30:12 +01:00
Jocelyn Fiat
156406f9ac Fixed various compilation issue with new self documentation
Improved the self documentation handler to provide a make_hidden creation procedure
2012-12-03 12:20:12 +01:00
Jocelyn Fiat
63b4f6509e Fixed compilation due to recent changes from http_client and corrected design. 2012-11-25 17:28:27 +01:00
Colin Adams
a9d83f97a8 Completed first pass for HTTP 1.1 conformace contracts 2012-11-24 15:45:42 +00:00
Colin Adams
17ce1be582 Added framework for HTTP-conforming contracts 2012-11-24 11:55:10 +00:00
Jocelyn Fiat
aa743c0a7d Removed generic parameter in WSF_FILTER_HANDLER, since it is useless and make code heavy
Signed-off-by: Olivier Ligot <oligot@gmail.com>
Signed-off-by: Jocelyn Fiat <jfiat@eiffel.com>
2012-10-08 10:40:44 +02:00
Jocelyn Fiat
2d3151e45f Removed unwanted commented line 2012-10-08 09:27:03 +02:00
Jocelyn Fiat
146fd3cc7d Updated "filter" example
Signed-off-by: Olivier Ligot <oligot@gmail.com>
2012-10-08 09:24:19 +02:00
Jocelyn Fiat
d9990df23f updated copyright 2012-10-04 15:01:02 +02:00
Jocelyn Fiat
9333d9c5be Updated filter example to demonstrate the use of context.
(note: this commit is a merged of pull request from Olivier Ligot, and changes from Jocelyn Fiat)

Signed-off-by: Jocelyn Fiat <jfiat@eiffel.com>
Signed-off-by: Olivier Ligot <oligot@gmail.com>
2012-10-04 15:00:44 +02:00
Jocelyn Fiat
f7615edec9 fixed wsf_extension path in filter-safe.ecf file 2012-10-03 15:54:22 +02:00
jvelilla
a0ebdb6098 Fixed wsf_extension.ecf path, in the example RestBucksCRUD.
Replace the assigment attempt with attached syntax
2012-10-02 07:12:42 -03:00
Jocelyn Fiat
e01c5bec57 Reviewed the semantic of the handler context.
Adapted existing code to fit the new router design.
2012-09-27 15:09:41 +02:00
Jocelyn Fiat
cdb88059bc Fixed Restbuck examples with new router design 2012-09-26 16:41:13 +02:00
Jocelyn Fiat
28186efbe7 Applied new ROUTER design to the whole EWF project. 2012-09-25 23:18:17 +02:00
Jocelyn Fiat
ace897ea2b New ROUTER design, much simpler, less generic, easier to extend, and now one can mix uri map, uri_template map and so on.
Update the "tutorial" example.
2012-09-19 10:50:27 +02:00
Olivier Ligot
b33d471cf8 [FIX] Path to libraries 2012-09-05 14:18:43 +02:00
Olivier Ligot
74334e665d [ADD] Filter: pre-process incoming data and post-process outgoing data
Filters are part of a filter chain, thus following the chain of responsability
design pattern.
More information are available in library/server/wsf/src/filter/README.md
2012-08-10 10:09:59 +02:00
Jocelyn Fiat
c62a4d2c49 Update master 2012-07-05 13:46:07 +03:00
Jocelyn Fiat
480abdec51 Better code for tutorial example. 2012-06-29 10:27:23 +02:00
Jocelyn Fiat
1509d68ca6 Final version of the install scripts. 2012-06-18 16:11:01 +02:00