Compare commits
6 Commits
es_rev1010
...
es_rev1010
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
603bedf71d | ||
|
|
5fedad7f2e | ||
|
|
e83f5654d8 | ||
|
|
ccff084642 | ||
|
|
830adbe10c | ||
|
|
e6d998953e |
@@ -1,10 +1,8 @@
|
||||
language: eiffel
|
||||
before_script:
|
||||
- export current_dir=$PWD ; echo current_dir=$current_dir ; cd ..
|
||||
- export ISE_VERSION=17.05; export ISE_BUILD=100416
|
||||
- curl -sSL http://downloads.sourceforge.net/eiffelstudio/Eiffel_${ISE_VERSION}_gpl_${ISE_BUILD}-linux-x86-64.tar.bz2 | tar -x --bzip2
|
||||
- export ISE_EIFFEL=$PWD/Eiffel_${ISE_VERSION} ; export ISE_PLATFORM=linux-x86-64
|
||||
- export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin:$PATH:$ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin
|
||||
- curl -sSL https://www.eiffel.org/setup/install.sh | bash
|
||||
- source eiffel_latest.rc
|
||||
- echo `ec -version`
|
||||
- cd $current_dir
|
||||
- echo Check projects compilation status...
|
||||
|
||||
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||
- `http_client`: added support for ciphers setting in the libcurl implementation only.
|
||||
- `http_client`: added convenient `get` and `custom` functions on HTTP_CLIENT directly.
|
||||
- `websocket`: added `on_timer` solution to allow the server to check for external events and send notification to websocket clients.
|
||||
- `wsf`: added `WSF_EXECUTE_HANDLER`, and `WSF_CGI_HANDLER`. Demonstration of `WSF_CGI_HANDLER` in the new `tools/httpd` project.
|
||||
|
||||
### Changed
|
||||
- adopted ecf version 1-16-0 and use a single .ecf file (the -safe.ecf are now redirection to normal .ecf)
|
||||
@@ -23,6 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||
- `http_client`: Added support for multiple file in form data. Made clear what is the meaning of `upload_filename`, `upload_data` and `form_data`.
|
||||
- `authentication`: HTTP_AUTHORIZATION acceps now READABLE_STRING_GENERAL for username and password argument.
|
||||
- `http_client`: fixed curl implementation by setting `Content-Type` to `x-www-form-urlencoded` (if not set) when POST send data as `x-www-form-urlencoded`.
|
||||
- `notification_email`: fixed the SMTP support for multiple recipients address.
|
||||
### Security
|
||||
|
||||
|
||||
|
||||
12
README.md
12
README.md
@@ -13,14 +13,14 @@ Currently EWF offers a collection of Eiffel libraries designed to be integrated
|
||||
|
||||
There is a growing ecosystem around EWF, that provides useful components:
|
||||
* OpenID and OAuth consumer library
|
||||
* Various hypermedia format such as HAL, Collection+json, …
|
||||
* 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.
|
||||
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.
|
||||
|
||||
@@ -51,11 +51,11 @@ Tasks and issues are managed with github issue system
|
||||
## How to get the source code?
|
||||
|
||||
Using git
|
||||
* git clone https://github.com/EiffelWebFramework/EWF.git
|
||||
* `git clone https://github.com/EiffelWebFramework/EWF.git`
|
||||
|
||||
* And to build the required and related Clibs
|
||||
* cd contrib/ise_library/cURL
|
||||
* geant compile
|
||||
* `cd contrib/ise_library/cURL`
|
||||
* `geant compile`
|
||||
|
||||
## Libraries under 'library'
|
||||
|
||||
@@ -64,7 +64,7 @@ Using git
|
||||
* connectors: various web server connectors for EWSGI
|
||||
* libfcgi: Wrapper for libfcgi SDK
|
||||
* __wsf__: Web Server Framework [read more](library/server/wsf)
|
||||
* __router__: URL dispatching/routing based on uri, uri_template, or custom [read more](library/server/wsf/router)
|
||||
* __router__: URL dispatching/routing based on `uri`, `uri_template`, or custom [read more](library/server/wsf/router)
|
||||
|
||||
### protocol
|
||||
* __http__: HTTP related classes, constants for status code, content types, ... [read more](library/network/protocol/http)
|
||||
|
||||
@@ -95,40 +95,67 @@ feature -- Basic operation
|
||||
l_email: EMAIL
|
||||
h: STRING
|
||||
i: INTEGER
|
||||
lst: LIST [READABLE_STRING_8]
|
||||
do
|
||||
create l_email.make_with_entry (a_email.from_address, addresses_to_header_line_value (a_email.to_addresses))
|
||||
if attached a_email.reply_to_address as l_reply_to then
|
||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_reply_to, l_reply_to)
|
||||
end
|
||||
|
||||
if attached a_email.cc_addresses as lst then
|
||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_cc, addresses_to_header_line_value (lst))
|
||||
end
|
||||
if attached a_email.bcc_addresses as lst then
|
||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_bcc, addresses_to_header_line_value (lst))
|
||||
end
|
||||
l_email.set_message (a_email.content)
|
||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.H_subject, a_email.subject)
|
||||
|
||||
create h.make_empty
|
||||
;(create {HTTP_DATE}.make_from_date_time (a_email.date)).append_to_rfc1123_string (h)
|
||||
l_email.add_header_entry ("Date", h)
|
||||
|
||||
if attached a_email.additional_header_lines as lst then
|
||||
across
|
||||
lst as ic
|
||||
loop
|
||||
h := ic.item
|
||||
i := h.index_of (':', 1)
|
||||
if i > 0 then
|
||||
l_email.add_header_entry (h.head (i - 1), h.substring (i + 1, h.count))
|
||||
else
|
||||
check is_header_line: False end
|
||||
lst := a_email.to_addresses
|
||||
if lst.is_empty then
|
||||
-- Error ...
|
||||
else
|
||||
-- With EMAIL, there should be a unique recipient at creation.
|
||||
create l_email.make_with_entry (a_email.from_address, lst.first)
|
||||
if lst.count > 1 then
|
||||
from
|
||||
lst.start
|
||||
lst.forth
|
||||
until
|
||||
lst.off
|
||||
loop
|
||||
l_email.add_recipient_address (lst.item)
|
||||
lst.forth
|
||||
end
|
||||
end
|
||||
end
|
||||
if attached a_email.reply_to_address as l_reply_to then
|
||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_reply_to, l_reply_to)
|
||||
end
|
||||
|
||||
smtp_send_email (l_email)
|
||||
if attached a_email.cc_addresses as l_cc_addresses then
|
||||
across
|
||||
l_cc_addresses as ic
|
||||
loop
|
||||
l_email.add_recipient_address_in_cc (ic.item)
|
||||
end
|
||||
end
|
||||
if attached a_email.bcc_addresses as l_bcc_addresses then
|
||||
across
|
||||
l_bcc_addresses as ic
|
||||
loop
|
||||
l_email.add_recipient_address_in_bcc (ic.item)
|
||||
end
|
||||
end
|
||||
l_email.set_message (a_email.content)
|
||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.H_subject, a_email.subject)
|
||||
|
||||
create h.make_empty
|
||||
;(create {HTTP_DATE}.make_from_date_time (a_email.date)).append_to_rfc1123_string (h)
|
||||
l_email.add_header_entry ("Date", h)
|
||||
|
||||
if attached a_email.additional_header_lines as l_lines then
|
||||
across
|
||||
l_lines as ic
|
||||
loop
|
||||
h := ic.item
|
||||
i := h.index_of (':', 1)
|
||||
if i > 0 then
|
||||
l_email.add_header_entry (h.head (i - 1), h.substring (i + 1, h.count))
|
||||
else
|
||||
check is_header_line: False end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
smtp_send_email (l_email)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
@@ -182,4 +209,3 @@ note
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
note
|
||||
description : "Objects that ..."
|
||||
author : "$Author$"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
description: "[
|
||||
Handler that can also play the role of a filter, i.e.
|
||||
than can pre-process incoming data and post-process outgoing data.
|
||||
]"
|
||||
author: "$Author$"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
WSF_EXECUTE_FILTER_HANDLER
|
||||
@@ -22,7 +25,7 @@ feature -- Execution
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
|
||||
@@ -8,10 +8,19 @@ deferred class
|
||||
WSF_URI_FILTER_HANDLER
|
||||
|
||||
inherit
|
||||
WSF_EXECUTE_FILTER_HANDLER
|
||||
WSF_FILTER_HANDLER [WSF_URI_HANDLER]
|
||||
|
||||
WSF_URI_HANDLER
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
if attached next as n then
|
||||
n.execute (req, res)
|
||||
end
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
|
||||
@@ -11,7 +11,9 @@ inherit
|
||||
WSF_EXECUTE_RESPONSE_AGENT_HANDLER
|
||||
|
||||
WSF_URI_RESPONSE_HANDLER
|
||||
|
||||
undefine
|
||||
execute
|
||||
end
|
||||
create
|
||||
make
|
||||
|
||||
|
||||
@@ -22,6 +22,14 @@ feature -- Response
|
||||
Result_attached: Result /= Void
|
||||
end
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- Execute request handler
|
||||
do
|
||||
res.send (response (req))
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
|
||||
@@ -8,10 +8,19 @@ deferred class
|
||||
WSF_URI_TEMPLATE_FILTER_HANDLER
|
||||
|
||||
inherit
|
||||
WSF_EXECUTE_FILTER_HANDLER
|
||||
WSF_FILTER_HANDLER [WSF_URI_TEMPLATE_HANDLER]
|
||||
|
||||
WSF_URI_TEMPLATE_HANDLER
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
if attached next as n then
|
||||
n.execute (req, res)
|
||||
end
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
|
||||
@@ -11,6 +11,9 @@ inherit
|
||||
WSF_EXECUTE_RESPONSE_AGENT_HANDLER
|
||||
|
||||
WSF_URI_TEMPLATE_RESPONSE_HANDLER
|
||||
undefine
|
||||
execute
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
@@ -22,6 +22,14 @@ feature -- Response
|
||||
Result_attached: Result /= Void
|
||||
end
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- Execute request handler
|
||||
do
|
||||
res.send (response (req))
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
|
||||
Reference in New Issue
Block a user