Spade

Mini Shell

Directory:~$ /proc/self/root/lib/python2.7/site-packages/certbot/plugins/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //proc/self/root/lib/python2.7/site-packages/certbot/plugins/enhancements.pyc

�
���_c@s-dZddlZddlZddlmZddlmZddlmZddlmZddd	gZ	d
�Z
d�Zd�Zd
�Z
d�Zejej�defd��Y�Zidd6ddd6dd6ejdd6ddgd6dd6dd6ed
6d!d"6d#d$6d%d&6gZdS('s(New interface style Certbot
enhancementsi����N(tAny(tDict(tList(t	constantstredirectsensure-http-headers
ocsp-staplingccs0x)tD]!}t||d�r|VqqWdS(s�
    Generator to yield the enabled new style enhancements.

    :param config: Configuration.
    :type config: :class:`certbot.interfaces.IConfig`
   
tcli_destN(t_INDEXtgetattr(tconfigtenh((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pytenabled_enhancementss
cCstt|��S(s�
    Checks if one or more of the requested enhancements are those of the
new
    enhancement interfaces.

    :param config: Configuration.
    :type config: :class:`certbot.interfaces.IConfig`
    (tanyR
(R((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pyt
are_requested!scCs2x+t|�D]}t||d�s
tSq
WtS(sh
    Checks that all of the requested enhancements are supported by the
    installer.

    :param config: Configuration.
    :type config: :class:`certbot.interfaces.IConfig`

    :param installer: Installer object
    :type installer: interfaces.IInstaller

    :returns: If all the requested enhancements are supported by the
installer
    :rtype: bool
    tclass(R
t
isinstancetFalsetTrue(Rt	installerR	((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pyt
are_supported+scCs5x.t|�D]
}t||d�||�q
WdS(s�
    Run enable method for each requested enhancement that is supported.

    :param lineage: Certificate lineage object
    :type lineage: certbot.interfaces.RenewableCert

    :param domains: List of domains in certificate to enhance
    :type domains: str

    :param installer: Installer object
    :type installer: interfaces.IInstaller

    :param config: Configuration.
    :type config: :class:`certbot.interfaces.IConfig`
    tenable_functionN(R
R(tlineagetdomainsRRR	((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pytenable>sc
CsRxKtD]C}||d|dd|dd|dd|dd	|d
�qWdS(s�
    Populates the command line flags for
certbot._internal.cli.HelpfulParser

    :param add: Add function of certbot._internal.cli.HelpfulParser
    :type add: func
    t
cli_groupstcli_flagtactiont
cli_actiontdestRtdefaulttcli_flag_defaultthelptcli_helpN(R(taddR	((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pytpopulate_cliQs
tAutoHSTSEnhancementcBsDeZdZejd��Zejd��Zejd��ZRS(s;
    Enhancement interface that installer plugins can implement in order to
    provide functionality that configures the software to have a
    'Strict-Transport-Security' with initially low max-age value
that will
    increase over time.

    The plugins implementing new style enhancements are responsible of
handling
    the saving of configuration checkpoints as well as calling possible
restarts
    of managed software themselves. For update_autohsts method, the
installer may
    have to call prepare() to finalize the plugin initialization.

    Methods:
        enable_autohsts is called when the header is initially installed
using a
        low max-age value.

        update_autohsts is called every time when Certbot is run using
'renew'
        verb. The max-age value should be increased over time using this
method.

        deploy_autohsts is called for every lineage that has had its
certificate
        renewed. A long HSTS max-age value should be set here, as we should
be
        confident that the user is able to automatically renew their
certificates.


    cOsdS(s�
        Gets called for each lineage every time Certbot is run with
'renew' verb.
        Implementation of this method should increase the max-age value.

        :param lineage: Certificate lineage object
        :type lineage: certbot.interfaces.RenewableCert

        .. note:: prepare() method inherited from `interfaces.IPlugin`
might need
            to be called manually within implementation of this interface
method
            to finalize the plugin initialization.
       
N((tselfRtargstkwargs((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pytupdate_autohstsyscOsdS(s
        Gets called for a lineage when its certificate is successfully
renewed.
        Long max-age value should be set in implementation of this method.

        :param lineage: Certificate lineage object
        :type lineage: certbot.interfaces.RenewableCert
       
N((R#RR$R%((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pytdeploy_autohsts�scOsdS(s�
        Enables the AutoHSTS enhancement, installing
        Strict-Transport-Security header with a low initial value to be
increased
        over the subsequent runs of Certbot renew.

        :param lineage: Certificate lineage object
        :type lineage: certbot.interfaces.RenewableCert

        :param domains: List of domains in certificate to enhance
        :type domains: `list` of `str`
       
N((R#RRR$R%((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pytenable_autohsts�s(t__name__t
__module__t__doc__tabctabstractmethodR&R'R((((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pyR"^s
tAutoHSTStnames=Gradually increasing max-age value for HTTP Strict
Transport sSecurity security
headerRs--auto-hstsRt	auto_hstsRtsecuritytenhanceRRt
store_trueRR
R&tupdater_functionR'tdeployer_functionR(R(R+R,tsixtacme.magic_typingRRRtcertbot._internalRtENHANCEMENTSR
RRRR!t
add_metaclasstABCMetatobjectR"tCLI_DEFAULTSR(((s@/usr/lib/python2.7/site-packages/certbot/plugins/enhancements.pyt<module>s6		
			
D