コード例 #1
0
def install_pas_plugin(context):
    uf = getToolByName(context, 'acl_users')
    plugin = JWTAuthenticationPlugin('jwt_auth')
    uf._setObject(plugin.getId(), plugin)
    plugin = uf['jwt_auth']
    plugin.manage_activateInterfaces([
        'IAuthenticationPlugin',
        'IExtractionPlugin',
    ])
コード例 #2
0
def install_pas_plugin(context):
    uf_parent = aq_inner(context)
    while True:
        uf = getToolByName(uf_parent, "acl_users")
        if IPluggableAuthService.providedBy(uf) and "jwt_auth" not in uf:
            plugin = JWTAuthenticationPlugin("jwt_auth")
            uf._setObject(plugin.getId(), plugin)
            plugin = uf["jwt_auth"]
            plugin.manage_activateInterfaces(
                ["IAuthenticationPlugin", "IExtractionPlugin"])
        if uf_parent is uf_parent.getPhysicalRoot():
            break
        uf_parent = aq_parent(uf_parent)
コード例 #3
0
def install_pas_plugin(context):
    uf_parent = aq_inner(context)
    while True:
        uf = getToolByName(uf_parent, 'acl_users')
        if 'jwt_auth' not in uf:
            plugin = JWTAuthenticationPlugin('jwt_auth')
            uf._setObject(plugin.getId(), plugin)
            plugin = uf['jwt_auth']
            plugin.manage_activateInterfaces([
                'IAuthenticationPlugin',
                'IExtractionPlugin',
            ])
        if uf_parent is uf_parent.getPhysicalRoot():
            break
        uf_parent = aq_parent(uf_parent)