perun.proxy.utils 2.4.0__tar.gz → 2.5.1__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.
Files changed (34) hide show
  1. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/PKG-INFO +15 -5
  2. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/README.md +14 -4
  3. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/metadata_expiration.py +16 -1
  4. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_mongodb.py +59 -56
  5. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/separate_oidc_logs.py +13 -5
  6. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/separate_ssp_logs.py +13 -5
  7. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/sync_usable_token_types.py +3 -2
  8. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun.proxy.utils.egg-info/PKG-INFO +15 -5
  9. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/setup.cfg +1 -1
  10. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/LICENSE +0 -0
  11. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/__init__.py +0 -0
  12. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/__init__.py +0 -0
  13. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_custom_command.py +0 -0
  14. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_dockers.py +0 -0
  15. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_exabgp_propagation.py +0 -0
  16. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_ldap.py +0 -0
  17. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_ldap_syncrepl.py +0 -0
  18. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_nginx.py +0 -0
  19. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_pgsql.py +0 -0
  20. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_php_syntax.py +0 -0
  21. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_privacyidea.py +0 -0
  22. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_rpc_status.py +0 -0
  23. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_saml.py +0 -0
  24. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/check_user_logins.py +0 -0
  25. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/nagios/webserver_availability.py +0 -0
  26. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/print_docker_versions.py +0 -0
  27. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/run_probes.py +0 -0
  28. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun/proxy/utils/run_version_script.py +0 -0
  29. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun.proxy.utils.egg-info/SOURCES.txt +0 -0
  30. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun.proxy.utils.egg-info/dependency_links.txt +0 -0
  31. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun.proxy.utils.egg-info/entry_points.txt +0 -0
  32. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun.proxy.utils.egg-info/requires.txt +0 -0
  33. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/perun.proxy.utils.egg-info/top_level.txt +0 -0
  34. {perun.proxy.utils-2.4.0 → perun.proxy.utils-2.5.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: perun.proxy.utils
3
- Version: 2.4.0
3
+ Version: 2.5.1
4
4
  Summary: Utilities and monitoring probes for Perun ProxyIdP
5
5
  Home-page: https://gitlab.ics.muni.cz/perun/perun-proxyidp/perun-proxy-utils.git
6
6
  Requires-Python: >=3.9
@@ -60,21 +60,31 @@ run_probes
60
60
 
61
61
  Script removes all logs from test accounts from SimpleSAMLphp logs.
62
62
 
63
- Params:
63
+ For usage instructions, run:
64
64
 
65
- - 1 - The file name
65
+ ```sh
66
+ separate_ssp_logs.py --help
67
+ ```
66
68
 
67
69
  ### separate_oidc_logs
68
70
 
69
71
  Script removes all logs from test accounts from mitreID logs.
70
72
 
73
+ For usage instructions, run:
74
+
75
+ ```sh
76
+ separate_oidc_logs.py --help
77
+ ```
78
+
71
79
  ### metadata_expiration
72
80
 
73
81
  This script checks whether there are some metadata close to expiration date.
74
82
 
75
- Params:
83
+ For usage instructions, run:
76
84
 
77
- - 1 - url to a page which prints a time when expires the metadata closest to expiration
85
+ ```sh
86
+ metadata_expiration.py --help
87
+ ```
78
88
 
79
89
  ### print_docker_versions
80
90
 
@@ -35,21 +35,31 @@ run_probes
35
35
 
36
36
  Script removes all logs from test accounts from SimpleSAMLphp logs.
37
37
 
38
- Params:
38
+ For usage instructions, run:
39
39
 
40
- - 1 - The file name
40
+ ```sh
41
+ separate_ssp_logs.py --help
42
+ ```
41
43
 
42
44
  ### separate_oidc_logs
43
45
 
44
46
  Script removes all logs from test accounts from mitreID logs.
45
47
 
48
+ For usage instructions, run:
49
+
50
+ ```sh
51
+ separate_oidc_logs.py --help
52
+ ```
53
+
46
54
  ### metadata_expiration
47
55
 
48
56
  This script checks whether there are some metadata close to expiration date.
49
57
 
50
- Params:
58
+ For usage instructions, run:
51
59
 
52
- - 1 - url to a page which prints a time when expires the metadata closest to expiration
60
+ ```sh
61
+ metadata_expiration.py --help
62
+ ```
53
63
 
54
64
  ### print_docker_versions
55
65
 
@@ -1,10 +1,25 @@
1
1
  import sys
2
+ import argparse
2
3
  from urllib.request import urlopen
3
4
  from bs4 import BeautifulSoup
4
5
 
5
6
 
7
+ def get_args():
8
+ """
9
+ Supports the command-line arguments listed below.
10
+ """
11
+ parser = argparse.ArgumentParser(
12
+ description="This script checks whether there are some metadata close to expiration date."
13
+ )
14
+ parser.add_argument(
15
+ "url",
16
+ help="url to a page which prints a time when expires the metadata closest to expiration",
17
+ )
18
+ return parser.parse_args()
19
+
20
+
6
21
  def main():
7
- url = sys.argv[1]
22
+ url = get_args().url
8
23
  html = urlopen(url).read()
9
24
  closest_expiration = BeautifulSoup(html, "html.parser")
10
25
 
@@ -30,7 +30,7 @@ from __future__ import print_function
30
30
  from __future__ import division
31
31
  import sys
32
32
  import time
33
- import optparse
33
+ import argparse
34
34
  import re
35
35
  import os
36
36
  import numbers
@@ -49,15 +49,13 @@ import bson.son as son
49
49
  # thanks to http://stackoverflow.com/a/1229667/72987
50
50
  #
51
51
  def optional_arg(arg_default):
52
- def func(option, opt_str, value, parser):
53
- if parser.rargs and not parser.rargs[0].startswith("-"):
54
- val = parser.rargs[0]
55
- parser.rargs.pop(0)
56
- else:
57
- val = arg_default
58
- setattr(parser.values, option.dest, val)
52
+ class CustomAction(argparse.Action):
53
+ def __call__(self, parser, namespace, values, option_string=None):
54
+ if values is None:
55
+ values = arg_default
56
+ setattr(namespace, self.dest, values)
59
57
 
60
- return func
58
+ return CustomAction
61
59
 
62
60
 
63
61
  def performance_data(perf_data, params):
@@ -129,32 +127,32 @@ def split_host_port(string):
129
127
  return (host, port)
130
128
 
131
129
 
132
- def main():
133
- p = optparse.OptionParser(
130
+ def get_args():
131
+ p = argparse.ArgumentParser(
134
132
  conflict_handler="resolve",
135
133
  description="This Nagios plugin checks the health of mongodb.",
136
134
  )
137
135
 
138
- p.add_option(
136
+ p.add_argument(
139
137
  "-H",
140
138
  "--host",
141
139
  action="store",
142
- type="string",
140
+ type=str,
143
141
  dest="host",
144
142
  default="127.0.0.1",
145
143
  help="The hostname you want to connect to",
146
144
  )
147
- p.add_option(
145
+ p.add_argument(
148
146
  "-h",
149
147
  "--host-to-check",
150
148
  action="store",
151
- type="string",
149
+ type=str,
152
150
  dest="host_to_check",
153
151
  default=None,
154
152
  help="The hostname you want to check (if this is different from the host you "
155
153
  "are connecting)",
156
154
  )
157
- p.add_option(
155
+ p.add_argument(
158
156
  "--rdns-lookup",
159
157
  action="store_true",
160
158
  dest="rdns_lookup",
@@ -162,43 +160,43 @@ def main():
162
160
  help="RDNS(PTR) lookup on given host/host-to-check, to convert ip-address "
163
161
  "to fqdn",
164
162
  )
165
- p.add_option(
163
+ p.add_argument(
166
164
  "-P",
167
165
  "--port",
168
166
  action="store",
169
- type="int",
167
+ type=int,
170
168
  dest="port",
171
169
  default=27017,
172
170
  help="The port mongodb is running on",
173
171
  )
174
- p.add_option(
172
+ p.add_argument(
175
173
  "--port-to-check",
176
174
  action="store",
177
- type="int",
175
+ type=int,
178
176
  dest="port_to_check",
179
177
  default=None,
180
178
  help="The port you want to check (if this is different from the port you "
181
179
  "are connecting)",
182
180
  )
183
- p.add_option(
181
+ p.add_argument(
184
182
  "-u",
185
183
  "--user",
186
184
  action="store",
187
- type="string",
185
+ type=str,
188
186
  dest="user",
189
187
  default=None,
190
188
  help="The username you want to login as",
191
189
  )
192
- p.add_option(
190
+ p.add_argument(
193
191
  "-p",
194
192
  "--pass",
195
193
  action="store",
196
- type="string",
194
+ type=str,
197
195
  dest="passwd",
198
196
  default=None,
199
197
  help="The password you want to use for that user",
200
198
  )
201
- p.add_option(
199
+ p.add_argument(
202
200
  "-W",
203
201
  "--warning",
204
202
  action="store",
@@ -206,7 +204,7 @@ def main():
206
204
  default=None,
207
205
  help="The warning threshold you want to set",
208
206
  )
209
- p.add_option(
207
+ p.add_argument(
210
208
  "-C",
211
209
  "--critical",
212
210
  action="store",
@@ -214,11 +212,10 @@ def main():
214
212
  default=None,
215
213
  help="The critical threshold you want to set",
216
214
  )
217
- p.add_option(
215
+ p.add_argument(
218
216
  "-A",
219
217
  "--action",
220
218
  action="store",
221
- type="choice",
222
219
  dest="action",
223
220
  default="connect",
224
221
  help="The action you want to take",
@@ -261,14 +258,14 @@ def main():
261
258
  "replset_quorum",
262
259
  ],
263
260
  )
264
- p.add_option(
261
+ p.add_argument(
265
262
  "--max-lag",
266
263
  action="store_true",
267
264
  dest="max_lag",
268
265
  default=False,
269
266
  help="Get max replication lag (for replication_lag action only)",
270
267
  )
271
- p.add_option(
268
+ p.add_argument(
272
269
  "--mapped-memory",
273
270
  action="store_true",
274
271
  dest="mapped_memory",
@@ -276,7 +273,7 @@ def main():
276
273
  help="Get mapped memory instead of resident (if resident memory can not be "
277
274
  "read)",
278
275
  )
279
- p.add_option(
276
+ p.add_argument(
280
277
  "-D",
281
278
  "--perf-data",
282
279
  action="store_true",
@@ -284,7 +281,7 @@ def main():
284
281
  default=False,
285
282
  help="Enable output of Nagios performance data",
286
283
  )
287
- p.add_option(
284
+ p.add_argument(
288
285
  "-d",
289
286
  "--database",
290
287
  action="store",
@@ -292,32 +289,34 @@ def main():
292
289
  default="admin",
293
290
  help="Specify the database to check",
294
291
  )
295
- p.add_option(
292
+ p.add_argument(
296
293
  "--all-databases",
297
294
  action="store_true",
298
295
  dest="all_databases",
299
296
  default=False,
300
297
  help="Check all databases (action database_size)",
301
298
  )
302
- p.add_option(
299
+ p.add_argument(
303
300
  "-t",
304
301
  "--tls",
305
302
  dest="tls",
306
303
  default=False,
307
- action="callback",
308
- callback=optional_arg(True),
304
+ action=optional_arg(True),
305
+ nargs="?",
306
+ const=True,
309
307
  help="Connect using tls",
310
308
  )
311
- p.add_option(
309
+ p.add_argument(
312
310
  "-r",
313
311
  "--replicaset",
314
312
  dest="replicaset",
315
313
  default=None,
316
- action="callback",
317
- callback=optional_arg(True),
314
+ action=optional_arg(True),
315
+ nargs="?",
316
+ const=True,
318
317
  help="Connect to replicaset",
319
318
  )
320
- p.add_option(
319
+ p.add_argument(
321
320
  "-q",
322
321
  "--querytype",
323
322
  action="store",
@@ -326,7 +325,7 @@ def main():
326
325
  help="The query type to check [query|insert|update|delete|getmore|command] "
327
326
  "from queries_per_second",
328
327
  )
329
- p.add_option(
328
+ p.add_argument(
330
329
  "-c",
331
330
  "--collection",
332
331
  action="store",
@@ -334,68 +333,72 @@ def main():
334
333
  default="admin",
335
334
  help="Specify the collection to check",
336
335
  )
337
- p.add_option(
336
+ p.add_argument(
338
337
  "-T",
339
338
  "--time",
340
339
  action="store",
341
- type="int",
340
+ type=int,
342
341
  dest="sample_time",
343
342
  default=1,
344
343
  help="Time used to sample number of pages faults",
345
344
  )
346
- p.add_option(
345
+ p.add_argument(
347
346
  "-a",
348
347
  "--authdb",
349
348
  action="store",
350
- type="string",
349
+ type=str,
351
350
  dest="authdb",
352
351
  default="admin",
353
352
  help="The database you want to authenticate against",
354
353
  )
355
- p.add_option(
354
+ p.add_argument(
356
355
  "--insecure",
357
356
  action="store_true",
358
357
  dest="insecure",
359
358
  default=False,
360
359
  help="Don't verify TLS certificates",
361
360
  )
362
- p.add_option(
361
+ p.add_argument(
363
362
  "--tls-ca-file",
364
363
  action="store",
365
- type="string",
364
+ type=str,
366
365
  dest="tls_ca_file",
367
366
  default=None,
368
367
  help="Path to Certificate Authority file for TLS",
369
368
  )
370
- p.add_option(
369
+ p.add_argument(
371
370
  "-f",
372
371
  "--tls-cert-key-file",
373
372
  action="store",
374
- type="string",
373
+ type=str,
375
374
  dest="tls_cert_key_file",
376
375
  default=None,
377
376
  help="Path to PEM encoded key and cert for client authentication",
378
377
  )
379
- p.add_option(
378
+ p.add_argument(
380
379
  "-m",
381
380
  "--auth-mechanism",
382
381
  action="store",
383
- type="choice",
384
382
  dest="auth_mechanism",
385
383
  default=None,
386
384
  help="Auth mechanism used for auth with mongodb",
387
385
  choices=["MONGODB-X509", "SCRAM-SHA-256", "SCRAM-SHA-1"],
388
386
  )
389
- p.add_option(
387
+ p.add_argument(
390
388
  "--disable-retry-writes",
391
389
  dest="retry_writes_disabled",
392
390
  default=False,
393
- action="callback",
394
- callback=optional_arg(True),
391
+ action=optional_arg(True),
392
+ nargs="?",
393
+ const=True,
395
394
  help="Disable retryWrites feature",
396
395
  )
397
396
 
398
- options, arguments = p.parse_args()
397
+ return p.parse_args()
398
+
399
+
400
+ def main():
401
+ options = get_args()
399
402
  host = options.host
400
403
  host_to_check = options.host_to_check if options.host_to_check else options.host
401
404
  rdns_lookup = options.rdns_lookup
@@ -5,14 +5,22 @@ import shutil
5
5
  import re
6
6
  import sys
7
7
  from os import mkdir, path, rename, remove, system
8
+ import argparse
8
9
 
9
10
 
10
- def main():
11
- if len(sys.argv) <= 1:
12
- print("One argument is expected!")
13
- sys.exit(-1)
11
+ def get_args():
12
+ """
13
+ Supports the command-line arguments listed below.
14
+ """
15
+ parser = argparse.ArgumentParser(
16
+ description="Script removes all logs from test accounts from mitreID logs."
17
+ )
18
+ parser.add_argument("filename", help="The file name of log file")
19
+ return parser.parse_args()
14
20
 
15
- absolute_file_name = sys.argv[1]
21
+
22
+ def main():
23
+ absolute_file_name = get_args().filename
16
24
 
17
25
  if not path.exists(absolute_file_name):
18
26
  print("File with name " + absolute_file_name + " doesn't exists!")
@@ -5,14 +5,22 @@ import shutil
5
5
  import re
6
6
  import sys
7
7
  from os import mkdir, path, rename, remove, system
8
+ import argparse
8
9
 
9
10
 
10
- def main():
11
- if len(sys.argv) <= 1:
12
- print("One argument is expected!")
13
- sys.exit(-1)
11
+ def get_args():
12
+ """
13
+ Supports the command-line arguments listed below.
14
+ """
15
+ parser = argparse.ArgumentParser(
16
+ description="Script removes all logs from test accounts from SimpleSAMLphp logs."
17
+ )
18
+ parser.add_argument("filename", help="The file name of log file")
19
+ return parser.parse_args()
14
20
 
15
- absolute_file_name = sys.argv[1]
21
+
22
+ def main():
23
+ absolute_file_name = get_args().filename
16
24
 
17
25
  if not path.exists(absolute_file_name):
18
26
  print("File with name " + absolute_file_name + " doesn't exists!")
@@ -114,7 +114,8 @@ def parse_perun_user_id(
114
114
  return None
115
115
 
116
116
 
117
- def main(args):
117
+ def main():
118
+ args = get_args()
118
119
  perun_user_id_regex = re.compile(args.perun_user_id_regex)
119
120
  mfa_active_tokens_attr_name = args.mfa_active_tokens_attr_name
120
121
  adapters_manager = get_adapters_manager(args.perun_connector_config_path)
@@ -134,4 +135,4 @@ def main(args):
134
135
 
135
136
 
136
137
  if __name__ == "__main__":
137
- main(get_args())
138
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: perun.proxy.utils
3
- Version: 2.4.0
3
+ Version: 2.5.1
4
4
  Summary: Utilities and monitoring probes for Perun ProxyIdP
5
5
  Home-page: https://gitlab.ics.muni.cz/perun/perun-proxyidp/perun-proxy-utils.git
6
6
  Requires-Python: >=3.9
@@ -60,21 +60,31 @@ run_probes
60
60
 
61
61
  Script removes all logs from test accounts from SimpleSAMLphp logs.
62
62
 
63
- Params:
63
+ For usage instructions, run:
64
64
 
65
- - 1 - The file name
65
+ ```sh
66
+ separate_ssp_logs.py --help
67
+ ```
66
68
 
67
69
  ### separate_oidc_logs
68
70
 
69
71
  Script removes all logs from test accounts from mitreID logs.
70
72
 
73
+ For usage instructions, run:
74
+
75
+ ```sh
76
+ separate_oidc_logs.py --help
77
+ ```
78
+
71
79
  ### metadata_expiration
72
80
 
73
81
  This script checks whether there are some metadata close to expiration date.
74
82
 
75
- Params:
83
+ For usage instructions, run:
76
84
 
77
- - 1 - url to a page which prints a time when expires the metadata closest to expiration
85
+ ```sh
86
+ metadata_expiration.py --help
87
+ ```
78
88
 
79
89
  ### print_docker_versions
80
90
 
@@ -1,5 +1,5 @@
1
1
  [metadata]
2
- version = 2.4.0
2
+ version = 2.5.1
3
3
  license_files = LICENSE
4
4
  long_description = file: README.md
5
5
  long_description_content_type = text/markdown