libpass 1.7.5.post0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. libpass-1.7.5.post0.dist-info/METADATA +81 -0
  2. libpass-1.7.5.post0.dist-info/RECORD +69 -0
  3. libpass-1.7.5.post0.dist-info/WHEEL +4 -0
  4. libpass-1.7.5.post0.dist-info/licenses/LICENSE +116 -0
  5. passlib/__init__.py +3 -0
  6. passlib/_data/wordsets/bip39.txt +2049 -0
  7. passlib/_data/wordsets/eff_long.txt +7776 -0
  8. passlib/_data/wordsets/eff_prefixed.txt +1296 -0
  9. passlib/_data/wordsets/eff_short.txt +1296 -0
  10. passlib/_setup/__init__.py +1 -0
  11. passlib/_setup/stamp.py +159 -0
  12. passlib/apache.py +1185 -0
  13. passlib/apps.py +260 -0
  14. passlib/context.py +2066 -0
  15. passlib/crypto/__init__.py +1 -0
  16. passlib/crypto/_blowfish/__init__.py +171 -0
  17. passlib/crypto/_blowfish/_gen_files.py +256 -0
  18. passlib/crypto/_blowfish/base.py +1239 -0
  19. passlib/crypto/_blowfish/unrolled.py +1691 -0
  20. passlib/crypto/_md4.py +249 -0
  21. passlib/crypto/des.py +2283 -0
  22. passlib/crypto/digest.py +1111 -0
  23. passlib/crypto/scrypt/__init__.py +299 -0
  24. passlib/crypto/scrypt/_builtin.py +254 -0
  25. passlib/crypto/scrypt/_gen_files.py +161 -0
  26. passlib/crypto/scrypt/_salsa.py +188 -0
  27. passlib/exc.py +432 -0
  28. passlib/ext/__init__.py +1 -0
  29. passlib/ext/django/__init__.py +6 -0
  30. passlib/ext/django/models.py +38 -0
  31. passlib/ext/django/utils.py +1326 -0
  32. passlib/handlers/__init__.py +1 -0
  33. passlib/handlers/argon2.py +1119 -0
  34. passlib/handlers/bcrypt.py +1217 -0
  35. passlib/handlers/cisco.py +450 -0
  36. passlib/handlers/des_crypt.py +642 -0
  37. passlib/handlers/digests.py +184 -0
  38. passlib/handlers/django.py +545 -0
  39. passlib/handlers/fshp.py +223 -0
  40. passlib/handlers/ldap_digests.py +379 -0
  41. passlib/handlers/md5_crypt.py +375 -0
  42. passlib/handlers/misc.py +224 -0
  43. passlib/handlers/mssql.py +258 -0
  44. passlib/handlers/mysql.py +136 -0
  45. passlib/handlers/oracle.py +177 -0
  46. passlib/handlers/pbkdf2.py +521 -0
  47. passlib/handlers/phpass.py +142 -0
  48. passlib/handlers/postgres.py +61 -0
  49. passlib/handlers/roundup.py +33 -0
  50. passlib/handlers/scram.py +589 -0
  51. passlib/handlers/scrypt.py +413 -0
  52. passlib/handlers/sha1_crypt.py +173 -0
  53. passlib/handlers/sha2_crypt.py +657 -0
  54. passlib/handlers/sun_md5_crypt.py +387 -0
  55. passlib/handlers/windows.py +349 -0
  56. passlib/hash.py +111 -0
  57. passlib/hosts.py +112 -0
  58. passlib/ifc.py +354 -0
  59. passlib/pwd.py +813 -0
  60. passlib/registry.py +583 -0
  61. passlib/totp.py +1968 -0
  62. passlib/utils/__init__.py +1221 -0
  63. passlib/utils/binary.py +897 -0
  64. passlib/utils/compat/__init__.py +200 -0
  65. passlib/utils/decor.py +234 -0
  66. passlib/utils/des.py +35 -0
  67. passlib/utils/handlers.py +2857 -0
  68. passlib/utils/md4.py +34 -0
  69. passlib/utils/pbkdf2.py +188 -0
@@ -0,0 +1 @@
1
+ """passlib.setup - helpers used by passlib's setup.py script"""
@@ -0,0 +1,159 @@
1
+ """update version string during build"""
2
+
3
+ # =============================================================================
4
+ # imports
5
+ # =============================================================================
6
+ # core
7
+ import datetime
8
+ from distutils.dist import Distribution
9
+ import os
10
+ import re
11
+ import subprocess
12
+ import time
13
+
14
+ # pkg
15
+ # local
16
+ __all__ = [
17
+ "stamp_source",
18
+ "stamp_distutils_output",
19
+ "append_hg_revision",
20
+ "as_bool",
21
+ ]
22
+
23
+
24
+ # =============================================================================
25
+ # helpers
26
+ # =============================================================================
27
+ def get_command_class(opts, name):
28
+ return opts["cmdclass"].get(name) or Distribution().get_command_class(name)
29
+
30
+
31
+ def get_command_options(opts, command):
32
+ return opts.setdefault("options", {}).setdefault(command, {})
33
+
34
+
35
+ def set_command_options(opts, command, **kwds):
36
+ get_command_options(opts, command).update(kwds)
37
+
38
+
39
+ def _get_file(path):
40
+ with open(path, "r") as fh:
41
+ return fh.read()
42
+
43
+
44
+ def _replace_file(path, content, dry_run=False):
45
+ if dry_run:
46
+ return
47
+ if os.path.exists(path):
48
+ # sdist likes to use hardlinks, have to remove them first,
49
+ # or we modify *source* file
50
+ os.unlink(path)
51
+ with open(path, "w") as fh:
52
+ fh.write(content)
53
+
54
+
55
+ def stamp_source(base_dir, version, dry_run=False):
56
+ """
57
+ update version info in passlib source
58
+ """
59
+ #
60
+ # update version string in toplevel package source
61
+ #
62
+ path = os.path.join(base_dir, "passlib", "__init__.py")
63
+ content = _get_file(path)
64
+ content, count = re.subn(
65
+ "(?m)^__version__\s*=.*$", "__version__ = " + repr(version), content
66
+ )
67
+ assert count == 1, "failed to replace version string"
68
+ _replace_file(path, content, dry_run=dry_run)
69
+
70
+ #
71
+ # update flag in setup.py
72
+ # (not present when called from bdist_wheel, etc)
73
+ #
74
+ path = os.path.join(base_dir, "setup.py")
75
+ if os.path.exists(path):
76
+ content = _get_file(path)
77
+ content, count = re.subn(
78
+ "(?m)^stamp_build\s*=.*$", "stamp_build = False", content
79
+ )
80
+ assert count == 1, "failed to update 'stamp_build' flag"
81
+ _replace_file(path, content, dry_run=dry_run)
82
+
83
+
84
+ def stamp_distutils_output(opts, version):
85
+ # subclass buildpy to update version string in source
86
+ _build_py = get_command_class(opts, "build_py")
87
+
88
+ class build_py(_build_py):
89
+ def build_packages(self):
90
+ _build_py.build_packages(self)
91
+ stamp_source(self.build_lib, version, self.dry_run)
92
+
93
+ opts["cmdclass"]["build_py"] = build_py
94
+
95
+ # subclass sdist to do same thing
96
+ _sdist = get_command_class(opts, "sdist")
97
+
98
+ class sdist(_sdist):
99
+ def make_release_tree(self, base_dir, files):
100
+ _sdist.make_release_tree(self, base_dir, files)
101
+ stamp_source(base_dir, version, self.dry_run)
102
+
103
+ opts["cmdclass"]["sdist"] = sdist
104
+
105
+
106
+ def as_bool(value):
107
+ return (value or "").lower() in "yes y true t 1".split()
108
+
109
+
110
+ def append_hg_revision(version):
111
+ # call HG via subprocess
112
+ # NOTE: for py26 compat, using Popen() instead of check_output()
113
+ try:
114
+ proc = subprocess.Popen(
115
+ ["hg", "tip", "--template", "{date(date, '%Y%m%d%H%M%S')}+hg.{node|short}"],
116
+ stdout=subprocess.PIPE,
117
+ )
118
+ stamp, _ = proc.communicate()
119
+ if proc.returncode:
120
+ raise subprocess.CalledProcessError(1, [])
121
+ stamp = stamp.decode("ascii")
122
+ except (OSError, subprocess.CalledProcessError):
123
+ # fallback - just use build date
124
+ now = int(os.environ.get("SOURCE_DATE_EPOCH") or time.time())
125
+ build_date = datetime.datetime.utcfromtimestamp(now)
126
+ stamp = build_date.strftime("%Y%m%d%H%M%S")
127
+
128
+ # modify version
129
+ if version.endswith((".dev0", ".post0")):
130
+ version = version[:-1] + stamp
131
+ else:
132
+ version += ".post" + stamp
133
+
134
+ return version
135
+
136
+
137
+ def install_build_py_exclude(opts):
138
+ _build_py = get_command_class(opts, "build_py")
139
+
140
+ class build_py(_build_py):
141
+ user_options = _build_py.user_options + [
142
+ ("exclude-packages=", None, "exclude packages from builds"),
143
+ ]
144
+
145
+ exclude_packages = None
146
+
147
+ def finalize_options(self):
148
+ _build_py.finalize_options(self)
149
+ target = self.packages
150
+ for package in self.exclude_packages or []:
151
+ if package in target:
152
+ target.remove(package)
153
+
154
+ opts["cmdclass"]["build_py"] = build_py
155
+
156
+
157
+ # =============================================================================
158
+ # eof
159
+ # =============================================================================