I am not trying to read $all. I agree, Greg, that would be insane.
Here is some more clarification.
We are trying to create a prototype application to evaluate how, using MOM (Eventstore), we can integrate our Web based client application with our back-end system which is called Power Service. Yes the domain we are in is Power Control/Management.
So far we using in-memory Message Bus, however as we move forward with more integrations we want to move to out-of-band solution. The only approach I see for this eval app is using HTTP API (open for any other solution though)
So the only place it is used is in run.js and it is for testing purposes. as it says in the comments.
In fact I use the same “$http.defaults.headers.common.Authorization = 'Basic ’ + encoded;” way of doing it right before the actual call.
However it is setting Authorization header of the request that gets rejected with this message: “XMLHttpRequest cannot load http://127.0.0.1:2113/streams/%24stats-127.0.0.1%3A2113?format=json. Request header field Authorization is not allowed by Access-Control-Allow-Headers.” And looking at Response I see this: Access-Control-Allow-Headers:Content-Type, X-Requested-With, X-PINGOTHER
Seems like what it says - Authorizing this way is not allowed.
The problem with authentication seems to exist for v.2. where I do not see Authorization header in the allowed headers in the Response. (e.g. Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER) so passing it gives me rejection.
In v.3.0 RC2 however, I see Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER, Authorization and I authenticate with no problem.
Also, working on making AngularJS tweaks to Javascript polling solution since the example uses jQuery and some assumptions about the structure of the returned JSON which are not true anymore.