sitemule / ILEastic

Embedded application server for ILE on IBM i
Apache License 2.0
58 stars 29 forks source link

Add support for request filter #12

Closed m1h43l closed 5 years ago

m1h43l commented 6 years ago

It would be nice to be able to register a request filter at the service. Every request before routing it to the endpoint would need to pass through the filter. The filter would decide if the request is valid or not.

This would also enable us to implement Basic Authentication.

NielsLiisberg commented 5 years ago

How about a il_addPlugin (%paddr(myFilter)) - In that case you can also can handle cookies and therefor also session?

m1h43l commented 5 years ago

I would call it a filter ... il_addFilter(config : %paddr(basicAuthFilter));

And the cookie/session would probably be available through the request?

m1h43l commented 5 years ago

And I think we need more than just a function. For example in the basic auth filter you would probably store some information on how to authenticate, f. e. using system accounts or a validation list and if a validation list is used you would need a path to the validation list object.

NielsLiisberg commented 5 years ago

the il_addPlugin was implemented