ae-shell 0.3.11__tar.gz → 0.3.13__tar.gz
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.
- {ae_shell-0.3.11 → ae_shell-0.3.13}/LICENSE.md +1 -1
- {ae_shell-0.3.11/ae_shell.egg-info → ae_shell-0.3.13}/PKG-INFO +6 -10
- {ae_shell-0.3.11 → ae_shell-0.3.13}/README.md +5 -5
- {ae_shell-0.3.11 → ae_shell-0.3.13}/ae/shell.py +14 -13
- {ae_shell-0.3.11 → ae_shell-0.3.13/ae_shell.egg-info}/PKG-INFO +6 -10
- {ae_shell-0.3.11 → ae_shell-0.3.13}/ae_shell.egg-info/requires.txt +0 -4
- {ae_shell-0.3.11 → ae_shell-0.3.13}/pyproject.toml +1 -1
- {ae_shell-0.3.11 → ae_shell-0.3.13}/setup.py +2 -6
- {ae_shell-0.3.11 → ae_shell-0.3.13}/tests/test_shell.py +17 -3
- {ae_shell-0.3.11 → ae_shell-0.3.13}/ae_shell.egg-info/SOURCES.txt +0 -0
- {ae_shell-0.3.11 → ae_shell-0.3.13}/ae_shell.egg-info/dependency_links.txt +0 -0
- {ae_shell-0.3.11 → ae_shell-0.3.13}/ae_shell.egg-info/top_level.txt +0 -0
- {ae_shell-0.3.11 → ae_shell-0.3.13}/ae_shell.egg-info/zip-safe +0 -0
- {ae_shell-0.3.11 → ae_shell-0.3.13}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.13
|
|
4
4
|
Summary: ae namespace module portion shell: shell execution and environment helpers
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_shell
|
|
6
6
|
Author: AndiEcker
|
|
@@ -29,25 +29,21 @@ Provides-Extra: dev
|
|
|
29
29
|
Requires-Dist: aedev_project_tpls; extra == "dev"
|
|
30
30
|
Requires-Dist: ae_ae; extra == "dev"
|
|
31
31
|
Requires-Dist: anybadge; extra == "dev"
|
|
32
|
-
Requires-Dist: coverage-badge; extra == "dev"
|
|
33
32
|
Requires-Dist: flake8; extra == "dev"
|
|
34
33
|
Requires-Dist: mypy; extra == "dev"
|
|
35
34
|
Requires-Dist: pylint; extra == "dev"
|
|
36
35
|
Requires-Dist: pytest; extra == "dev"
|
|
37
36
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
38
|
-
Requires-Dist: pytest-django; extra == "dev"
|
|
39
37
|
Requires-Dist: typing; extra == "dev"
|
|
40
38
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
41
39
|
Provides-Extra: docs
|
|
42
40
|
Provides-Extra: tests
|
|
43
41
|
Requires-Dist: anybadge; extra == "tests"
|
|
44
|
-
Requires-Dist: coverage-badge; extra == "tests"
|
|
45
42
|
Requires-Dist: flake8; extra == "tests"
|
|
46
43
|
Requires-Dist: mypy; extra == "tests"
|
|
47
44
|
Requires-Dist: pylint; extra == "tests"
|
|
48
45
|
Requires-Dist: pytest; extra == "tests"
|
|
49
46
|
Requires-Dist: pytest-cov; extra == "tests"
|
|
50
|
-
Requires-Dist: pytest-django; extra == "tests"
|
|
51
47
|
Requires-Dist: typing; extra == "tests"
|
|
52
48
|
Requires-Dist: types-setuptools; extra == "tests"
|
|
53
49
|
Dynamic: author
|
|
@@ -65,15 +61,15 @@ Dynamic: requires-dist
|
|
|
65
61
|
Dynamic: requires-python
|
|
66
62
|
Dynamic: summary
|
|
67
63
|
|
|
68
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
64
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.103 -->
|
|
69
65
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
|
|
70
|
-
# shell 0.3.
|
|
66
|
+
# shell 0.3.13
|
|
71
67
|
|
|
72
68
|
[](
|
|
73
69
|
https://gitlab.com/ae-group/ae_shell)
|
|
74
70
|
[](
|
|
72
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.13)
|
|
77
73
|
[](
|
|
78
74
|
https://pypi.org/project/ae-shell/#history)
|
|
79
75
|
|
|
@@ -121,7 +117,7 @@ following command in the root folder of this repository
|
|
|
121
117
|
(ae_shell):
|
|
122
118
|
|
|
123
119
|
```shell script
|
|
124
|
-
pip install
|
|
120
|
+
pip install --editable .[dev]
|
|
125
121
|
```
|
|
126
122
|
|
|
127
123
|
the last command will install this module portion, along with the tools you need
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
1
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.103 -->
|
|
2
2
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
|
|
3
|
-
# shell 0.3.
|
|
3
|
+
# shell 0.3.13
|
|
4
4
|
|
|
5
5
|
[](
|
|
6
6
|
https://gitlab.com/ae-group/ae_shell)
|
|
7
7
|
[](
|
|
9
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.13)
|
|
10
10
|
[](
|
|
11
11
|
https://pypi.org/project/ae-shell/#history)
|
|
12
12
|
|
|
@@ -54,7 +54,7 @@ following command in the root folder of this repository
|
|
|
54
54
|
(ae_shell):
|
|
55
55
|
|
|
56
56
|
```shell script
|
|
57
|
-
pip install
|
|
57
|
+
pip install --editable .[dev]
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
the last command will install this module portion, along with the tools you need
|
|
@@ -31,7 +31,7 @@ from ae.core import main_app_instance, AppBase
|
|
|
31
31
|
from ae.console import MAIN_SECTION_NAME, ConsoleApp # type: ignore
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
__version__ = '0.3.
|
|
34
|
+
__version__ = '0.3.13'
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
STDERR_BEG_MARKER = "vvv STDERR vvv" #: :paramref:`ae.shell.sh_exec.lines_output` begin stderr lines
|
|
@@ -123,11 +123,11 @@ def mask_token(text: list[str]) -> list[str]: ...
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
def mask_token(text: Union[str, list[str]]) -> Union[str, list[str]]:
|
|
126
|
-
""" hide most parts of any Codeberg/GitHub/GitHub tokens found in the specified text/-lines.
|
|
126
|
+
""" hide most parts of any Codeberg/GitHub/GitHub URL tokens found in the specified text/-lines.
|
|
127
127
|
|
|
128
|
-
:param text: text
|
|
129
|
-
|
|
130
|
-
:return: text
|
|
128
|
+
:param text: text, specified either as str object or as a list of str objects (lines),
|
|
129
|
+
each str/line get searched for URL tokens, to hide/mask the most part of them.
|
|
130
|
+
:return: text with masked URL tokens (only leaving the first/last 3 token characters unmasked).
|
|
131
131
|
|
|
132
132
|
.. note:: see also :func:`ae.base.mask_url` of a more generic way to hide passwords and tokens in URLs.
|
|
133
133
|
"""
|
|
@@ -136,14 +136,15 @@ def mask_token(text: Union[str, list[str]]) -> Union[str, list[str]]:
|
|
|
136
136
|
else:
|
|
137
137
|
lines = list(text) # copy to not change text list content
|
|
138
138
|
|
|
139
|
+
url_beg = 'https://' # PDV_REPO_HOST_PROTOCOL
|
|
140
|
+
url_beg_len = len(url_beg)
|
|
139
141
|
for tok_beg, tok_end in ((':', '@codeberg.org'), ('glpat-', '@gitlab.com'), ('ghp_', '@github.com')):
|
|
140
142
|
for idx, line in enumerate(lines):
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
line = line[:start + 3] + "***-masked-token-***" + line[end - 3:]
|
|
143
|
+
beg = -1
|
|
144
|
+
while ((beg := line.find(url_beg, beg + 1)) != -1 and
|
|
145
|
+
(beg := line.find(tok_beg, beg + url_beg_len)) != -1 and
|
|
146
|
+
(end := line.find(tok_end, beg)) != -1):
|
|
147
|
+
line = line[:beg + 3] + "***-masked-token-***" + line[end - 3:]
|
|
147
148
|
lines[idx] = line
|
|
148
149
|
|
|
149
150
|
return lines[0] if is_str_arg else lines
|
|
@@ -198,10 +199,10 @@ def sh_exec(command_line: str, extra_args: Iterable[str] = (), console_input: st
|
|
|
198
199
|
if ret_out:
|
|
199
200
|
assert isinstance(lines_output, list), "silly mypy doesn't recognize ret_out"
|
|
200
201
|
if result.stdout:
|
|
201
|
-
lines_output.extend([line for line in result.stdout.decode().
|
|
202
|
+
lines_output.extend([line for line in result.stdout.decode().splitlines() if line.strip()])
|
|
202
203
|
if not merge_err and result.stderr:
|
|
203
204
|
lines_output.append(STDERR_BEG_MARKER)
|
|
204
|
-
lines_output.extend([line for line in result.stderr.decode().
|
|
205
|
+
lines_output.extend([line for line in result.stderr.decode().splitlines() if line.strip()])
|
|
205
206
|
lines_output.append(STDERR_END_MARKER)
|
|
206
207
|
|
|
207
208
|
return result.returncode
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.13
|
|
4
4
|
Summary: ae namespace module portion shell: shell execution and environment helpers
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_shell
|
|
6
6
|
Author: AndiEcker
|
|
@@ -29,25 +29,21 @@ Provides-Extra: dev
|
|
|
29
29
|
Requires-Dist: aedev_project_tpls; extra == "dev"
|
|
30
30
|
Requires-Dist: ae_ae; extra == "dev"
|
|
31
31
|
Requires-Dist: anybadge; extra == "dev"
|
|
32
|
-
Requires-Dist: coverage-badge; extra == "dev"
|
|
33
32
|
Requires-Dist: flake8; extra == "dev"
|
|
34
33
|
Requires-Dist: mypy; extra == "dev"
|
|
35
34
|
Requires-Dist: pylint; extra == "dev"
|
|
36
35
|
Requires-Dist: pytest; extra == "dev"
|
|
37
36
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
38
|
-
Requires-Dist: pytest-django; extra == "dev"
|
|
39
37
|
Requires-Dist: typing; extra == "dev"
|
|
40
38
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
41
39
|
Provides-Extra: docs
|
|
42
40
|
Provides-Extra: tests
|
|
43
41
|
Requires-Dist: anybadge; extra == "tests"
|
|
44
|
-
Requires-Dist: coverage-badge; extra == "tests"
|
|
45
42
|
Requires-Dist: flake8; extra == "tests"
|
|
46
43
|
Requires-Dist: mypy; extra == "tests"
|
|
47
44
|
Requires-Dist: pylint; extra == "tests"
|
|
48
45
|
Requires-Dist: pytest; extra == "tests"
|
|
49
46
|
Requires-Dist: pytest-cov; extra == "tests"
|
|
50
|
-
Requires-Dist: pytest-django; extra == "tests"
|
|
51
47
|
Requires-Dist: typing; extra == "tests"
|
|
52
48
|
Requires-Dist: types-setuptools; extra == "tests"
|
|
53
49
|
Dynamic: author
|
|
@@ -65,15 +61,15 @@ Dynamic: requires-dist
|
|
|
65
61
|
Dynamic: requires-python
|
|
66
62
|
Dynamic: summary
|
|
67
63
|
|
|
68
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
64
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.103 -->
|
|
69
65
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.22 -->
|
|
70
|
-
# shell 0.3.
|
|
66
|
+
# shell 0.3.13
|
|
71
67
|
|
|
72
68
|
[](
|
|
73
69
|
https://gitlab.com/ae-group/ae_shell)
|
|
74
70
|
[](
|
|
72
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.13)
|
|
77
73
|
[](
|
|
78
74
|
https://pypi.org/project/ae-shell/#history)
|
|
79
75
|
|
|
@@ -121,7 +117,7 @@ following command in the root folder of this repository
|
|
|
121
117
|
(ae_shell):
|
|
122
118
|
|
|
123
119
|
```shell script
|
|
124
|
-
pip install
|
|
120
|
+
pip install --editable .[dev]
|
|
125
121
|
```
|
|
126
122
|
|
|
127
123
|
the last command will install this module portion, along with the tools you need
|
|
@@ -6,13 +6,11 @@ ae_console
|
|
|
6
6
|
aedev_project_tpls
|
|
7
7
|
ae_ae
|
|
8
8
|
anybadge
|
|
9
|
-
coverage-badge
|
|
10
9
|
flake8
|
|
11
10
|
mypy
|
|
12
11
|
pylint
|
|
13
12
|
pytest
|
|
14
13
|
pytest-cov
|
|
15
|
-
pytest-django
|
|
16
14
|
typing
|
|
17
15
|
types-setuptools
|
|
18
16
|
|
|
@@ -20,12 +18,10 @@ types-setuptools
|
|
|
20
18
|
|
|
21
19
|
[tests]
|
|
22
20
|
anybadge
|
|
23
|
-
coverage-badge
|
|
24
21
|
flake8
|
|
25
22
|
mypy
|
|
26
23
|
pylint
|
|
27
24
|
pytest
|
|
28
25
|
pytest-cov
|
|
29
|
-
pytest-django
|
|
30
26
|
typing
|
|
31
27
|
types-setuptools
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.
|
|
1
|
+
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.77
|
|
2
2
|
""" setup of ae namespace module portion shell: shell execution and environment helpers. """
|
|
3
3
|
import sys
|
|
4
4
|
# noinspection PyUnresolvedReferences
|
|
@@ -28,26 +28,22 @@ setup_kwargs = {
|
|
|
28
28
|
'aedev_project_tpls',
|
|
29
29
|
'ae_ae',
|
|
30
30
|
'anybadge',
|
|
31
|
-
'coverage-badge',
|
|
32
31
|
'flake8',
|
|
33
32
|
'mypy',
|
|
34
33
|
'pylint',
|
|
35
34
|
'pytest',
|
|
36
35
|
'pytest-cov',
|
|
37
|
-
'pytest-django',
|
|
38
36
|
'typing',
|
|
39
37
|
'types-setuptools',
|
|
40
38
|
],
|
|
41
39
|
'docs': [],
|
|
42
40
|
'tests': [
|
|
43
41
|
'anybadge',
|
|
44
|
-
'coverage-badge',
|
|
45
42
|
'flake8',
|
|
46
43
|
'mypy',
|
|
47
44
|
'pylint',
|
|
48
45
|
'pytest',
|
|
49
46
|
'pytest-cov',
|
|
50
|
-
'pytest-django',
|
|
51
47
|
'typing',
|
|
52
48
|
'types-setuptools',
|
|
53
49
|
],
|
|
@@ -81,7 +77,7 @@ setup_kwargs = {
|
|
|
81
77
|
},
|
|
82
78
|
'python_requires': '>=3.12',
|
|
83
79
|
'url': 'https://gitlab.com/ae-group/ae_shell',
|
|
84
|
-
'version': '0.3.
|
|
80
|
+
'version': '0.3.13',
|
|
85
81
|
'zip_safe': True,
|
|
86
82
|
}
|
|
87
83
|
|
|
@@ -210,19 +210,33 @@ class TestHelpers:
|
|
|
210
210
|
assert os.environ == os_env
|
|
211
211
|
|
|
212
212
|
def test_mask_token(self):
|
|
213
|
+
url_prefix_str = "https://" # PDV_REPO_HOST_PROTOCOL
|
|
214
|
+
|
|
215
|
+
token = "codeberg token does not have a prefix and only contains hex-digits followed by @ and codeberg.org"
|
|
216
|
+
text = f"a text block containing a codeberg URL with a token: {url_prefix_str}UsaNäm:{token}@codeberg.org"
|
|
217
|
+
|
|
218
|
+
assert token not in mask_token(text)
|
|
219
|
+
assert token not in mask_token([text])[0]
|
|
220
|
+
assert mask_token(text).count('codeberg.org') == 1
|
|
221
|
+
assert mask_token(text).count(':') == 3
|
|
222
|
+
|
|
213
223
|
token = "glpat-gitlab token format ending at the @/ampersand directly followed by the gitlab.com domain"
|
|
214
|
-
text = "a text block containing a gitlab URL with a token: https://UsaNäm:" + token + "@gitlab.com"
|
|
224
|
+
text = "a text block containing a gitlab URL with a glpat-token: https://UsaNäm:" + token + "@gitlab.com"
|
|
215
225
|
|
|
216
226
|
assert token not in mask_token(text)
|
|
217
227
|
assert token not in mask_token([text])[0]
|
|
228
|
+
assert mask_token(text).count('gitlab.com') == 1
|
|
229
|
+
assert mask_token(text).count('glpat-') == 1
|
|
218
230
|
|
|
219
231
|
token = "ghp_-github token format ending at the @/ampersand directly followed by the github.com domain"
|
|
220
|
-
text = "a text block containing a github URL with a token: https://YouSaNem:" + token + "@github.com"
|
|
232
|
+
text = "a text block containing a github URL with a ghp_-token: https://YouSaNem:" + token + "@github.com"
|
|
221
233
|
|
|
222
234
|
assert token not in mask_token(text)
|
|
223
235
|
assert token not in mask_token([text])[0]
|
|
236
|
+
assert mask_token(text).count('github.com') == 1
|
|
237
|
+
assert mask_token(text).count('ghp_') == 1
|
|
224
238
|
|
|
225
|
-
text = "
|
|
239
|
+
text = "NO masking if @codeberg.org/@github.com/@gitlab.com domains before token start str ':', ghp_ or glpat-:"
|
|
226
240
|
|
|
227
241
|
assert mask_token(text) == text # neither throws str.index()-ValueError nor stuck in endless-loop
|
|
228
242
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|