[Zope-dev] support for low level HTTP Response logging?

2003-02-25 Thread Romain Slootmaekers
Yo,

searching the zope site and googling yielded too many data and no info, 
so I might as well ask it here.

We are very interested in finding out the exact HTTP Responses that the 
zope server pushes towards the client.

So is there a low level hook for logging the http responses ?
We want the exact response, complete with all header info etc.
Why not just sniff, you might ask? Well, we are developing a web 
application for mobile microbrowsers, and most these clients have no 
hooks for attaching a sniffer client side. Installing a sniffer server 
side is not possible for other reasons.

TIA,

Sloot.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] support for low level HTTP Response logging?

2003-02-25 Thread Andreas Jung
http://hathaway.freezope.org/Software/TCPWatch

--On Dienstag, 25. Februar 2003 11:24 +0100 Romain Slootmaekers 
[EMAIL PROTECTED] wrote:

Yo,

searching the zope site and googling yielded too many data and no info,
so I might as well ask it here.
We are very interested in finding out the exact HTTP Responses that the
zope server pushes towards the client.
So is there a low level hook for logging the http responses ?
We want the exact response, complete with all header info etc.
Why not just sniff, you might ask? Well, we are developing a web
application for mobile microbrowsers, and most these clients have no
hooks for attaching a sniffer client side. Installing a sniffer server
side is not possible for other reasons.
TIA,

Sloot.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )




--
   -
  -Andreas Jung http://www.andreas-jung.com   -
 -   EMail: andreas at andreas-jung.com  -
  -Life is too short to (re)write parsers   -
   -
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] support for low level HTTP Response logging?

2003-02-25 Thread Romain Slootmaekers
Andreas Jung wrote:
http://hathaway.freezope.org/Software/TCPWatch
Apparantly, I forgot to mention this:
proxying isn't an option either.
You can't just, on the fly, put a proxy between several components in a 
production setup.

Sloot.


--On Dienstag, 25. Februar 2003 11:24 +0100 Romain Slootmaekers 
[EMAIL PROTECTED] wrote:

Yo,

searching the zope site and googling yielded too many data and no info,
so I might as well ask it here.
We are very interested in finding out the exact HTTP Responses that the
zope server pushes towards the client.
So is there a low level hook for logging the http responses ?
We want the exact response, complete with all header info etc.
Why not just sniff, you might ask? Well, we are developing a web
application for mobile microbrowsers, and most these clients have no
hooks for attaching a sniffer client side. Installing a sniffer server
side is not possible for other reasons.
TIA,

Sloot.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )







___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] LOTS of roles?

2003-02-25 Thread Oliver Bleutgen
Paul Winkler wrote:
On Mon, Feb 24, 2003 at 12:41:01PM +0100, Oliver Bleutgen wrote:

Since your application might not be suited for that scheme, it might be 
worth throwing out roles altogether. How about creating a role for each 
user (i.e. user user_id get's just the role user_id, instead of 
creating a role for for each possible (task,location) tuple.
When creating a new user, the admin would have to just assign the 
permissions, instead of roles. This task could be made easier by 
creating template permission sets.


Interesting idea... tell me if I'm wrong, but I see two obvious
problems with this approach:

1)  for one-role-per-user:  we'd have to visit the security management for
N objects in Zope and adjust the permissions every time we add a user.
Whereas in my proposal, we only need to do that every time we add
a site or change the tasks, which happens much less frequently.  

2) for one-role-per-user, changing a user's privileges means wanding around
the ZMI setting permissions on N objects.
Whereas in my scheme, we can do that in one place (LDAP) by 
adding or removing a role or two.


You might wind up with less roles and I bet administration is a lot easier.


my guess is that in our case, the number of roles would be comparable.
200 sites * 10 tasks = 2000 roles
200 sites * 10 users = 2000 roles
I think I still don't get all the characteristics of you application. So 
I'll try to post what I had in mind:

- implement a kind of permission matrix: tasksxsites,i.e. permission 
1X says that the user who has this permission is allowed to call 
taskX(site=1,...). Then in taskX you could check if the user has the 
permission 1X, and otherwise throw an exception.

- write an UI which hides the existance of roles, instead let the admin 
assign permissions directly to users (by implictly creating one role 
named user_id with all the permissions the admin choose). Optionally 
give the admin some knobs to use permission templates or other 
helpers. Note that this could still be combined with normal roles for 
everything which has nothing to do with your sites.

So I don't see why your point 1) and 2) could be an issue, unless you 
also need stuff like local roles for other things etc. - but that seems 
to be solvable through an UI too.

Then you'd have sites*tasks permissions, and as many roles as you have 
users. And maybe you steered around the complexity problem w.r.t roles too.

cheers,
oliver




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] support for low level HTTP Response logging?

2003-02-25 Thread Clemens Robbenhaar

Hi Romain,

  Yo,
  
  searching the zope site and googling yielded too many data and no info, 
  so I might as well ask it here.
  
  We are very interested in finding out the exact HTTP Responses that the 
  zope server pushes towards the client.
  
  So is there a low level hook for logging the http responses ?
  We want the exact response, complete with all header info etc.

 There is no  explicit hook, but you might add Your logging code in 
Zope/lib/python/ZPublicher/HTTPResponse.py, for example in the 'write'
method of the HTTPResponse, or by wrapping the 'self.stdout' in __init__
by something that also logs the output before writing to the passed
'stdout' stream. 
 Of course this most probably will bring performance down (or even the
complete Zope, if there is a simple typo in the hacked code ;-) I assume
You only need this for testing.

Cheers,
Clemens

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] support for low level HTTP Response logging?

2003-02-25 Thread Romain Slootmaekers
Clemens Robbenhaar wrote:
Hi Romain,

  Yo,
  
  searching the zope site and googling yielded too many data and no info, 
  so I might as well ask it here.
  
  We are very interested in finding out the exact HTTP Responses that the 
  zope server pushes towards the client.
  
  So is there a low level hook for logging the http responses ?
  We want the exact response, complete with all header info etc.

 There is no  explicit hook, but you might add Your logging code in 
Zope/lib/python/ZPublicher/HTTPResponse.py, for example in the 'write'
method of the HTTPResponse, or by wrapping the 'self.stdout' in __init__
by something that also logs the output before writing to the passed
'stdout' stream. 

 Of course this most probably will bring performance down (or even the
complete Zope, if there is a simple typo in the hacked code ;-) I assume
You only need this for testing.
No. actually, it is for a production setup, so it would be preferable if 
it could be done without changing the zope source code [this gives all 
kinds of problems, extra work,... when we need to update a server]

We need this in our 3th line support, were we want to be able to follow 
all ins and outs for singled out user (fi filtered on cookie).
We also need to be able to turn this on/off at runtime.

We can sift out the user we want, turn off/on the logging, aso
in our own code, if we could just have a low level zope hook.
For the requests, we already have done this since there are plenty of 
hooks available. (yes, grep -i someString $(find ./ -name *.py) is 
my friend ;) )

for Test/Development setups, we have plenty of options: proxying, 
sniffing, source code hacking, stepping with debugger,.

Romain.



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] support for low level HTTP Response logging?

2003-02-25 Thread Toby Dickenson
On Tuesday 25 February 2003 12:08 pm, Romain Slootmaekers wrote:

 We need this in our 3th line support, were we want to be able to follow
 all ins and outs for singled out user (fi filtered on cookie).
 We also need to be able to turn this on/off at runtime.

I would do this in the front-end proxy. Set up a squid acl to catch this one 
user, and send his requests via tcpwatch (or similar) rather than direct to 
zope.


-- 
Toby Dickenson
http://www.geminidataloggers.com/people/tdickenson

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Creating a fully stand-alone Zope Page Templates

2003-02-25 Thread Kevin Smith
This works!!  Thank you!  Do you keep your Page Templates up-to-date 
with Zope's, or is this version going to stay the way it is from now 
on?  It looks like you did what I was trying to do (i.e. put a wrapper 
around the existing code) so that updates only required you to get the 
newest version of Page Templates from Zope and plug them in.

On Tuesday, February 25, 2003, at 01:52  AM, Richard Jones wrote:

On Tue, 25 Feb 2003 11:07 am, Kevin Smith wrote:
I am trying to make a stand-alone Page Templates packages that doesn't
have any Zope dependencies.  I was able to short circuit security and
acquisition.  I re-implemented MultiMapping in plain Python and made
the Base class just an empty class.
This is passing most of the regression tests, but there is one big
issue left.  When a page template invokes something that is a 
function,
it prints the equivalent of 'repr(function)' instead of 'function()'.
What magic that goes on within Zope am I missing in my wrapper?
Hurm. I can't answer this directly, but I have done the same as you and
divorced ZPT completely from Zope for Roundup. See 
http://roundup.sf.net/ in
the roundup.cgi.[PageTemplates|TAL|ZTUtils] packages.

Richard


Kevin Smith
[EMAIL PROTECTED]
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Creating a fully stand-alone Zope Page Templates

2003-02-25 Thread Guido van Rossum
 Hurm. I can't answer this directly, but I have done the same as you and 
 divorced ZPT completely from Zope for Roundup. See http://roundup.sf.net/ in 
 the roundup.cgi.[PageTemplates|TAL|ZTUtils] packages.

I wonder if it would be worth our while to make sure that ZPT is
separately usable, just like we do for ZODB?

Just how much did you have to change to divorce ZPT from Zope?

--Guido van Rossum (home page: http://www.python.org/~guido/)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


RE: [Zope-dev] support for low level HTTP Response logging?

2003-02-25 Thread sean . upton
Are you mainly concerned about the http headers in the response, or the
response body?  If it is just the headers, Squid's log_mime_hdrs feature
will log all HTTP headers from both the request and response for you for
each request.  If nothing else, perhaps it's a start...

Sean

-Original Message-
From: Romain Slootmaekers [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 2:25 AM
To: [EMAIL PROTECTED]
Subject: [Zope-dev] support for low level HTTP Response logging?


Yo,

searching the zope site and googling yielded too many data and no info, 
so I might as well ask it here.

We are very interested in finding out the exact HTTP Responses that the 
zope server pushes towards the client.

So is there a low level hook for logging the http responses ?
We want the exact response, complete with all header info etc.


Why not just sniff, you might ask? Well, we are developing a web 
application for mobile microbrowsers, and most these clients have no 
hooks for attaching a sniffer client side. Installing a sniffer server 
side is not possible for other reasons.

TIA,

Sloot.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] LOTS of roles?

2003-02-25 Thread Florent Guillaume
Leonardo Rochael Almeida  [EMAIL PROTECTED] wrote:
 So I think you need dynamically calculated local roles. This can be
 achieved by a user folder that returns a user object that overrides
 .getRolesInContext(object) to take the location (or any other
 attribute, such as an acquired site) of object and check it against
 your central authorization source (eg. LDAP).

Note that you'll also want to change validate() if you go that route.
It has a short-circuited version of getRolesInContext in it.

Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:[EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] REQUEST.args

2003-02-25 Thread Dieter Maurer
Brian Brinegar wrote at 2003-2-24 16:10 -0500:
  After some more poking around, I've simplified the problem. I have a 
  product I created with a __call__ method:
  
 def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):
 
 Call the selected template in the context of myself.
 
 print REQUEST = 
 print str(REQUEST)
  
  When this is called from DTML like this: dtml-var object REQUEST is {} 
  when this is called directly REQUEST is the real request information, 
  when it is called from python object(context, REQUEST) this works as 
  well.

This is as it should be.

You need to define the attribute isDocTemp=1 to tell
DTML to call an object with parameters None,_, i.e. like
a DTML object.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Creating a fully stand-alone Zope Page Templates

2003-02-25 Thread Richard Jones
On Wed, 26 Feb 2003 1:26 am, Kevin Smith wrote:
 This works!!  Thank you!  Do you keep your Page Templates up-to-date
 with Zope's, or is this version going to stay the way it is from now
 on?  It looks like you did what I was trying to do (i.e. put a wrapper
 around the existing code) so that updates only required you to get the
 newest version of Page Templates from Zope and plug them in.

I keep track of bug fixes, but nothing else. ZPT is a stable product, so bug 
reports are rare. The multilingual implementation (which I'm not completely 
up to speed with) was happening while I was doing my port, so I don't have 
any of that. I also can't just update from the ZPT CVS any more.


Richard


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] LOTS of roles?

2003-02-25 Thread Dieter Maurer
Paul Winkler wrote at 2003-2-24 16:27 -0500:
  ...
 It is easy to optimize this to u + a (via a dictionary),
 then thousands of roles should not be a problem.
  
  would that mean you have to build a (potentially huge) dictionary every 
  time?  I'd greatly appreciate it if you could expand on this suggestion.

Even when you create the dictionary anew each time, it will have
(almost) u+a complexity.

However, the dict might be cachable in volatile variables
(i.e. _v_ variables).

As it is not my problem, I am a bit reluctant to search
for optimazation possibilities.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Creating a fully stand-alone Zope Page Templates

2003-02-25 Thread Richard Jones
On Wed, 26 Feb 2003 1:53 am, Guido van Rossum wrote:
  Hurm. I can't answer this directly, but I have done the same as you and
  divorced ZPT completely from Zope for Roundup. See http://roundup.sf.net/
  in the roundup.cgi.[PageTemplates|TAL|ZTUtils] packages.

 I wonder if it would be worth our while to make sure that ZPT is
 separately usable, just like we do for ZODB?

I've made that suggestion numerous times on the ZPT mailing list, with zero 
response.


 Just how much did you have to change to divorce ZPT from Zope?

I've fully documented it (as required by the ZPT license). In a nutshell:

- implemented MultiMapping as simple python modules
- changed the way macros are handled to remove the computed attribute stuff 
(since it's an acquisition trick)
- removed all references to acquisition (for cleanliness, no other reason) 
including some ZTUtils that won't work without it (ie. tree stuff)
- altered the import statements so that I wouldn't clash with another version 
of ZPT if it were installed (or if Roundup was installed as a Zope Product)
- significantly improved error reporting :)

The critical change is the way that the macros are handled. The 
ComputedAttribute stuff just doesn't make sense (and is horribly complicated) 
when you're not using acquisition. The good news is that TAL requires no 
changes if you implement a dummy zLOG. I ended up removing the dependency.


 Richard



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Offtopic: it's vs. its

2003-02-25 Thread Jean Jordaan
 I'm sorry to bring forward the topic of grammar,

I, for one, think that proper grammar in checkins, source code
and wikis is wonderful, and beneficial in the same way as syntax
highlighting in editors.
While reading Zope source in the past, I have, a couple of times,
made diffs fixing niggly grammatical issues (I can be compulsive
that way .. ) but have always refrained from submitting them as
issues, because I was afraid they'd be considered noise. Is this
a justified fear?
--
Jean Jordaan
http://www.upfrontsystems.co.za
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Offtopic: it's vs. its

2003-02-25 Thread Guido van Rossum

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Offtopic: it's vs. its

2003-02-25 Thread Guido van Rossum
 I, for one, think that proper grammar in checkins, source code
 and wikis is wonderful, and beneficial in the same way as syntax
 highlighting in editors.

Agreed.

 While reading Zope source in the past, I have, a couple of times,
 made diffs fixing niggly grammatical issues (I can be compulsive
 that way .. ) but have always refrained from submitting them as
 issues, because I was afraid they'd be considered noise. Is this
 a justified fear?

Indeed.  If you have checkin perms, feel free to fix coding style and
English grammar issues quietly.  But trackers should be used for real
coding issues.

--Guido van Rossum (home page: http://www.python.org/~guido/)


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] LOTS of roles?

2003-02-25 Thread Paul Winkler
On Tue, Feb 25, 2003 at 11:33:54PM +0100, Dieter Maurer wrote:
 Paul Winkler wrote at 2003-2-24 16:27 -0500:
   ...
  It is easy to optimize this to u + a (via a dictionary),
  then thousands of roles should not be a problem.
   
   would that mean you have to build a (potentially huge) dictionary every 
   time?  I'd greatly appreciate it if you could expand on this suggestion.
 
 Even when you create the dictionary anew each time, it will have
 (almost) u+a complexity.
 
 However, the dict might be cachable in volatile variables
 (i.e. _v_ variables).

good idea, thanks.

 As it is not my problem, I am a bit reluctant to search
 for optimazation possibilities.

understandable... for anyone else who's interested, i just found this
by Alex Martelli:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52303

-- 

Paul Winkler
http://www.slinkp.com


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZLDAP and replication

2003-02-25 Thread Jean Jordaan
Hi Jeffrey  all

I'd just like to check something ..

When running LDAP in a master/slave setup, if a client of the
slave tries to update the directory, the slave returns a referral
(pointing at the master) to the client, and the client has to
retry the update at the master. That's steps 3 and 4 in this
diagram:
http://www.openldap.org/doc/admin20/guide.html#Replicated%20Directory%20Service

It doesn't look like ZLDAPConnection does this, or am I being
obtuse?
--
Jean Jordaan
http://www.upfrontsystems.co.za
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )