Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-12 Thread Stephan Richter
On Tuesday, March 12, 2013 09:14:26 AM Jim Fulton wrote:
> Sorry, why do you want to adapt proxies?  The "lying about class",
> which is arguably not lying, is intentional and facilitates adapting proxied
> objects.

No, we really want to adapt the wrapped object, but that is currently not 
working correctly with the Python proxy implementation, i.e. this is always 
the result:

  >>> tuple(providedBy(ProxyPy(orig, checker)))
  ()

So I need to figure out why that is. I have *not* looked at the code to see 
whether zope.interface tries and fails to strip proxies or whether ProxyPy 
does a security check for __providedBy__ and fails. My bet is on the latter.

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-12 Thread Jim Fulton
On Tue, Mar 12, 2013 at 8:30 AM, Stephan Richter
 wrote:
> On Monday, March 11, 2013 10:33:30 PM Tres Seaver wrote:
>> > Yep, saw that. There are some uncovered lines for which I have to add
>> > tests left. Also, I just noticed while prorting zope.publisher to PyPy
>> > that proxies cannot be adapted, which is a big issue for any view
>> > libraries.
>>
>> Ouch.  That "lying about my type" bit is hard to get over.
>
> I was thinking about dynamically creating proxy classes. Something along the
> lines of:
>
> class PyProxy(object):
>
> def __new__(cls, orig):
> ProxyForOrig = type('ProxyForOrig', (cls, orig.__class__))
> return ProxyForOrig(orig)
>
> That should also help us with our 3-arg pow() call
>
> What do you think?

Sorry, why do you want to adapt proxies?  The "lying about class",
which is arguably not lying, is intentional and facilitates adapting proxied
objects.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-12 Thread Stephan Richter
On Monday, March 11, 2013 10:33:30 PM Tres Seaver wrote:
> > Yep, saw that. There are some uncovered lines for which I have to add
> > tests left. Also, I just noticed while prorting zope.publisher to PyPy
> > that proxies cannot be adapted, which is a big issue for any view
> > libraries.
> 
> Ouch.  That "lying about my type" bit is hard to get over.

I was thinking about dynamically creating proxy classes. Something along the 
lines of:

class PyProxy(object):

def __new__(cls, orig):
ProxyForOrig = type('ProxyForOrig', (cls, orig.__class__))
return ProxyForOrig(orig)

That should also help us with our 3-arg pow() call

What do you think?

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-11 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 03/11/2013 10:29 PM, Stephan Richter wrote:
> On Monday, March 11, 2013 02:00:55 PM Tres Seaver wrote:
>> BTW, I merged the branch to the trunk and made a zope.security
>> 4.0.0b1 release just now.
> 
> Yep, saw that. There are some uncovered lines for which I have to add
> tests left. Also, I just noticed while prorting zope.publisher to PyPy
> that proxies cannot be adapted, which is a big issue for any view
> libraries.

Ouch.  That "lying about my type" bit is hard to get over.


Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlE+k/oACgkQ+gerLs4ltQ6wWwCfWvfDbILY76o51rmRsdaJ7390
yx0An3Qyrc7VO53TtOSt1WSllDwdBYb4
=+4m5
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-11 Thread Stephan Richter
On Monday, March 11, 2013 02:00:55 PM Tres Seaver wrote:
> BTW, I merged the branch to the trunk and made a zope.security 4.0.0b1
> release just now.

Yep, saw that. There are some uncovered lines for which I have to add tests 
left. Also, I just noticed while prorting zope.publisher to PyPy that proxies 
cannot be adapted, which is a big issue for any view libraries.

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-11 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 03/11/2013 02:02 PM, Stephan Richter wrote:
> On Monday, March 11, 2013 11:56:10 AM Tres Seaver wrote:
>>> Oh yeah, all tests pass now on py26, py27, py32, py33, and pypy!
>> 
>> Woohoo!  Nice work.  BTW, how did you break the import cycle due to 
>> the zope.location monkeypatch?
> 
> I moved the patch to  __init__.py. I know, not 
> zope.location.LocationProxy gets fixed up all the time instead of 
> waiting for decorator to be imported. But it did break the cycle.

I was thinking of adding a ZCML directive which did the monkey patch (so
that it wouldn't happen at import time at all).

BTW, I merged the branch to the trunk and made a zope.security 4.0.0b1
release just now.



Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlE+G9cACgkQ+gerLs4ltQ4J2wCdEJzJ2D4eIKZWxlmNdbJZyVgh
mV0AoMIvVLKGZ6y/cgkoBz88w+iYbs0T
=tf3G
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-11 Thread Stephan Richter
On Monday, March 11, 2013 11:56:10 AM Tres Seaver wrote:
> > Oh yeah, all tests pass now on py26, py27, py32, py33, and pypy!
> 
> Woohoo!  Nice work.  BTW, how did you break the import cycle due to the
> zope.location monkeypatch?

I moved the patch to  __init__.py. I know, not zope.location.LocationProxy 
gets fixed up all the time instead of waiting for decorator to be imported. But 
it did break the cycle.

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [zopefoundation/zope.security] 82fd54: Changed strategy to hide wrapped to not use the se...

2013-03-11 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 03/11/2013 11:33 AM, GitHub wrote:

> Oh yeah, all tests pass now on py26, py27, py32, py33, and pypy!


Woohoo!  Nice work.  BTW, how did you break the import cycle due to the
zope.location monkeypatch?



Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlE9/poACgkQ+gerLs4ltQ41BgCggEXl0utNEQAydRv1rws1xPrt
+28AoJZvfxTNgRvKBhHXstxxDvTzcurE
=2XB9
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )