[Lazarus] New feature: SQLDB Rest bridge

Michael Van Canneyt michael at freepascal.org
Mon Feb 25 08:07:40 CET 2019

On Mon, 25 Feb 2019, Sven Barth via lazarus wrote:

> Michael Van Canneyt via lazarus <lazarus at lists.lazarus-ide.org> schrieb am
> So., 24. Feb. 2019, 17:46:
>> Hello,
>> We received some feedback about Pas2JS - our effort to bring Pascal to the
>> browser - that easy database connectivity is an issue, hampering easy
>> development.
>> To alleviate the problem I have created the SQLDB Rest bridge.
>> This is a set of components that allow you to expose any database supported
>> by FPC's SQLDB as a REST service. It is designed to be simple to use, yet
>> extensible.
> Cool! Great work!
> Now I only need to get the parts for implementing an Interface using RTTI
> working and I'd be all but set :D

You mean for an RPC mechanism ?

Isn't Invoke() working already ? I have a JSON RPC implemention on my list,
and thought to use Invoke() for that.

>> * Authentication is handled using the HTTP protocol.
>> * Basic authentication is included by default, but is completely pluggable.
>> * Basic authentication can look up valid users in a database (by default
>> the database being exposed)
> How would one check whether the user is allowed to execute an action?

There is an OnAllowResource event, after the authentication. One of the
parameters is the operation: GET, PUT etc.
If you set the 'allow' to false, you'll get a 403, 'Forbidden'. 
It's not yet committed, because I wanted that together with the business processor component, 
which will make implementing all kinds of events simpler. 
There are stilll several improvements waiting to be tested and committed.


More information about the lazarus mailing list