mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 08:04:26 -04:00
never attempt to create system venv, install ldap in lib automatically, and setup binproviders before bins
This commit is contained in:
parent
3e4a846488
commit
584abe8548
6 changed files with 30 additions and 8 deletions
|
@ -12,7 +12,7 @@ from abx.archivebox.base_plugin import BasePlugin
|
|||
from abx.archivebox.base_hook import BaseHook
|
||||
from abx.archivebox.base_binary import BaseBinary, BaseBinProvider
|
||||
|
||||
from plugins_pkg.pip.apps import SYS_PIP_BINPROVIDER, VENV_PIP_BINPROVIDER
|
||||
from plugins_pkg.pip.apps import SYS_PIP_BINPROVIDER, VENV_PIP_BINPROVIDER, LIB_PIP_BINPROVIDER
|
||||
from .settings import LDAP_CONFIG, get_ldap_lib
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ LDAP_LIB = lambda: get_ldap_lib()[0] # lazy load to avoid slow ldap lib import
|
|||
class LdapBinary(BaseBinary):
|
||||
name: str = 'ldap'
|
||||
description: str = 'LDAP Authentication'
|
||||
binproviders_supported: List[InstanceOf[BaseBinProvider]] = [VENV_PIP_BINPROVIDER, SYS_PIP_BINPROVIDER]
|
||||
binproviders_supported: List[InstanceOf[BaseBinProvider]] = [VENV_PIP_BINPROVIDER, SYS_PIP_BINPROVIDER, LIB_PIP_BINPROVIDER]
|
||||
|
||||
provider_overrides: Dict[BinProviderName, ProviderLookupDict] = {
|
||||
VENV_PIP_BINPROVIDER.name: {
|
||||
|
|
|
@ -2,6 +2,8 @@ __package__ = 'archivebox.plugins_auth.ldap'
|
|||
|
||||
import sys
|
||||
|
||||
from functools import cache
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
from pydantic import Field, model_validator, computed_field
|
||||
|
||||
|
@ -10,7 +12,8 @@ from abx.archivebox.base_configset import BaseConfigSet
|
|||
LDAP_LIB = None
|
||||
LDAP_SEARCH = None
|
||||
|
||||
def get_ldap_lib():
|
||||
@cache
|
||||
def get_ldap_lib():
|
||||
global LDAP_LIB, LDAP_SEARCH
|
||||
if LDAP_LIB and LDAP_SEARCH:
|
||||
return LDAP_LIB, LDAP_SEARCH
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue