Changeset - cbb85dc11e3a
[Not reviewed]
default
1 4 0
Mads Kiilerich - 6 years ago 2019-08-04 01:08:08
mads@kiilerich.com
lib: use ipaddr from pip instead of vendoring it
5 files changed with 5 insertions and 1903 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth.py
Show inline comments
 
@@ -33,6 +33,7 @@ import collections
 

	
 
from decorator import decorator
 

	
 
import ipaddr
 
from tg import request, session
 
from tg.i18n import ugettext as _
 
from sqlalchemy.orm.exc import ObjectDeletedError
 
@@ -859,7 +860,6 @@ def check_ip_access(source_ip, allowed_i
 
    :param source_ip:
 
    :param allowed_ips: list of allowed ips together with mask
 
    """
 
    from kallithea.lib import ipaddr
 
    source_ip = source_ip.split('%', 1)[0]
 
    log.debug('checking if ip:%s is subnet of %s', source_ip, allowed_ips)
 
    if isinstance(allowed_ips, (tuple, list, set)):
kallithea/lib/ipaddr.py
Show inline comments
 
deleted file
kallithea/model/db.py
Show inline comments
 
@@ -40,6 +40,7 @@ from sqlalchemy.ext.hybrid import hybrid
 
from sqlalchemy.orm import relationship, joinedload, class_mapper, validates
 
from beaker.cache import cache_region, region_invalidate
 
from webob.exc import HTTPNotFound
 
import ipaddr
 

	
 
from tg.i18n import lazy_ugettext as _
 

	
 
@@ -766,7 +767,6 @@ class UserIpMap(Base, BaseDbModel):
 

	
 
    @classmethod
 
    def _get_ip_range(cls, ip_addr):
 
        from kallithea.lib import ipaddr
 
        net = ipaddr.IPNetwork(address=ip_addr)
 
        return [str(net.network), str(net.broadcast)]
 

	
kallithea/model/validators.py
Show inline comments
 
@@ -20,16 +20,17 @@ import re
 
import formencode
 
import logging
 
from collections import defaultdict
 

	
 
from tg.i18n import ugettext as _
 
from sqlalchemy import func
 
import sqlalchemy
 
import ipaddr
 

	
 
from formencode.validators import (
 
    UnicodeString, OneOf, Int, Number, Regex, Email, Bool, StringBoolean, Set,
 
    NotEmpty, IPAddress, CIDR, String, FancyValidator
 
)
 
from kallithea.lib.compat import OrderedSet
 
from kallithea.lib import ipaddr
 
from kallithea.lib.utils import is_valid_repo_uri
 
from kallithea.lib.utils2 import str2bool, aslist, repo_name_slug
 
from kallithea.model.db import RepoGroup, Repository, UserGroup, User
setup.py
Show inline comments
 
@@ -63,6 +63,7 @@ requirements = [
 
    "Paste >= 2.0.3, < 3.1",
 
    "bleach >= 3.0, < 3.2",
 
    "Click >= 7.0, < 8",
 
    "ipaddr >= 2.0, < 2.3",
 
]
 

	
 
if not is_windows:
0 comments (0 inline, 0 general)