
Á«‘_†  ã               @   s`   d  d l  m Z d  d l  m Z d  d l m Z Gd d „  d e ƒ Z Gd d „  d e ƒ Z d S)	é   )Úparse_authorization_header)Úparse_www_authenticate_header)Úcached_propertyc               @   s(   e  Z d  Z d Z e d d „  ƒ Z d S)ÚAuthorizationMixinz­Adds an :attr:`authorization` property that represents the parsed
    value of the `Authorization` header as
    :class:`~werkzeug.datastructures.Authorization` object.
    c             C   s   |  j  j d ƒ } t | ƒ S)z*The `Authorization` object in parsed form.ZHTTP_AUTHORIZATION)ÚenvironÚgetr   )ÚselfÚheader© r
   ú:/tmp/pip-build-5gj8f0j9/Werkzeug/werkzeug/wrappers/auth.pyÚauthorization   s    z AuthorizationMixin.authorizationN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r
   r
   r
   r   r      s   r   c               @   s(   e  Z d  Z d Z e d d „  ƒ Z d S)ÚWWWAuthenticateMixinz>Adds a :attr:`www_authenticate` property to a response object.c                s1   ‡  f d d †  } ˆ  j  j d ƒ } t | | ƒ S)z/The `WWW-Authenticate` header in a parsed form.c                s@   |  r# d ˆ  j  k r# ˆ  j  d =n |  r< |  j ƒ  ˆ  j  d <d  S)Nzwww-authenticatezWWW-Authenticate)ÚheadersZ	to_header)Zwww_auth)r   r
   r   Ú	on_update   s    z8WWWAuthenticateMixin.www_authenticate.<locals>.on_updatezwww-authenticate)r   r   r   )r   r   r	   r
   )r   r   Úwww_authenticate   s    z%WWWAuthenticateMixin.www_authenticateN)r   r   r   r   Úpropertyr   r
   r
   r
   r   r      s   r   N)Úhttpr   r   Úutilsr   Úobjectr   r   r
   r
   r
   r   Ú<module>   s   