middleware

Managing redundant typedefs from multiple vendors

What are some of the best ways to manage redundant typedefs used for platform independence from multiple middleware (operating systems, protocol stacks) vendors in the C programming language. e.g.: target.h /* inclusion lock etc */ typedef char CHAR; typedef unsigned char BYTE; typedef unsigned short int WORD; /* ... more of the same ....

Middleware Authentication

I have a DJANGO application divide in two sites(A middleware called site A and a front end called site B) and I need to share authentication between them. The site A is called by B to send username and password. Then A return an HTTP response to B and use HTTPResponseRedirect('/welcome') to redirect in a local function (protected by @l...

What is the appropriate way to intercept WSGI start_response?

I have WSGI middleware that needs to capture the HTTP status (e.g. 200 OK) that inner layers of middleware return by calling start_response. Currently I'm doing the following, but abusing a list doesn't seem to be the “right” solution to me: class TransactionalMiddlewareInterface(object): def __init__(self, application, **config): ...

Creating Mobile Cross-Platform Scripting Solution

I am having the dream to design a Mobile cross-platform scripting solution to achieve Developer only need to code once by scripting language(it's possible be Javascript or others need further investigation), then the solution will be able to generate the installation files for multiple mobile platforms like J2me, Android, Symbian, BlackB...

Make CSRF middleware work in Django's 404 error pages

I put a login box alone with a keyword search box in 404.html in a Django project so in case a 404 error is raised, visitors get more options to jump to other parts. But the CSRF middleware doesn't work in 404 error page with no csrf token rendered. I tried move 'django.middleware.csrf.CsrfViewMiddleware' to first of MIDDLEWARE_CLASSES ...

Modify Django settings variables in a middleware

I set a variable MAX_REQUEST = 100 in settings.py I write a middleware which may lower this value for request origining from a proxy ip address by the following code: settings.MAX_REQUEST = 10 However, looks like the above modification affects all legitimate users. Is it normal? ...

Can you let users upload Sinatra apps and run them inside Rails as middleware?

I want to let users write small custom apps (think themes or plugins on Wordpress) and upload/run them on my site. I'm thinking about using Sinatra apps for this since it would give the users a lot of flexibility, and then running them as middleware inside my rails app. But I can't figure out the security implications of this. I tried...

Rails 3 as Rack middleware

Since Rails is fully compliant with Rack I was wandering how I would set up a rackup file so that a Rails application is just a piece of middleware and then a request could hit another app further down the middleware stack. What I really want is to use a Rails app to handle authentication and authorization for smaller rack-apps later on...

Using ZeroC Middleware

I'm currently looking at various middleware solutions that will allow me to create applications in a variety of languages which are able to communicate amongst each other. The ZeroC product suite seems ideal as it provides a language agnostic way of defining data and the services that operate on the data (via its ICE idl) and provides s...

Any WSGI middleware to make HTTP redirect on specific status code?

I'm using Pylons and want to add some middleware to it so that it catches 401 status codes and makes HTTP Redirect (302) to Signin page. I know there is built-in StatusCodeRedirect in Pylons that acts in a similar fashion, but it does not produce HTTP redirect, and rather redirects internally (this is what I do not want). Is there any ...

Windows NT Service shutdown issues

I have developed middleware that provides RPC functionality to multiple client applications on multiple platforms within our organization. The middleware is written in C# and runs as a Windows NT Service. It handles things like file access to network shares, database access, etc. The middleware is hosted on two high end systems runnin...

How to get a handle on all this middleware?

My organization has recently been wrestling the question of whether we should be incorporating different middleware products / concepts into our applications. Products we are looking at are things like Pegasystems, Oracle BPM / BPEL, BizTalk, Fair Isaac Blaze, etc., etc., etc. But I'm having a hard time getting a handle on all this. B...

Facebook Open Graph without a browser

Hello, For a middleware system with internet (which works inside a set-top box) I want to develop a primitive Facebook interface where users can type their user-names and password, showing their latest notification, messages and other casual stuff on the TV screen by using the recent Facebook Graph API. This middleware program uses Jav...

Modify headers in Pylons using Middleware

Hi all, I'm trying to modify a header using Middleware in Pylons to make my application RESTful, basically, if the user request "application/json" via GET that is what he get back. The question I have is, the variable headers is basically a long list. Looking something like this: [('Content-Type', 'text/html; charset=utf-8'), ('Pragma...

Is it possible to render a template from middleware?

I have a middleware that does some processing. On certain conditions it raises an exception and the user sees my 500.html template - correctly responding to 500 http status. Now, on some exceptions I would like to render different template than default 500.html. Is it possible/how to achieve that? ...

what is middleware exactly?

I hear a lot of people talking last days about middleware, but what is the exact definition of middleware. If I look in information about middleware I found a lot of information and some definitions, but while reading this information and defintions it seems that mostly all 'wares' are in the middle of something. So from my opinion all t...

Non-global middleware in Django

In Django there is a settings file that defines the middleware to be run on each request. This middleware setting is global. Is there a way to specify a set of middleware on a per-view basis? I want to have specific urls use a set of middleware different from the global set. ...

add extra data to response object to render in template

İ ned to write a code sniplet that enables to disable connection to some parts of a site. Admin and the mainpage will be displayable, but user section (which uses ajax) will be displayed, but can not be used (vith a transparent div set over the page). Also there is a few pages which will be disabled. my logic is that, i write a middlewa...

Is there any material on Android middleware developement?

Hi, I am working on Android applictions since last 8 months. Iam interested in learning android middleware devlopement.I searched on google for this.But i haven't found any material.please send me,is there any material or tutorial or links to learn. Give me guidance to quick learning? Regards, Rajendar ...

Where do I place this hit counter incrementer code?

Snippet taken from this question from django.db.models import F ... MyModel.objects.filter(id=...).update(hit_count=F(hit_count)+1) It was suggested to put in the middleware and I read up a bit on middleware but would greatly appreciate if someone could point out what they would do in this situation. Using my Bug model as an example i...