diff --git a/src/caosdb/connection/authentication/unauthenticated.py b/src/caosdb/connection/authentication/unauthenticated.py index 70ef40e60c10bd1d961ac09197cd16b2aec3882e..53a2756eb59259a0be012e41f2ea213735568838 100644 --- a/src/caosdb/connection/authentication/unauthenticated.py +++ b/src/caosdb/connection/authentication/unauthenticated.py @@ -25,7 +25,7 @@ # """unauthenticated. -An Authentictor which suppresses any authentication and also ignores auth_token +An Authenticator which suppresses any authentication and also ignores auth_token cookies. """ from __future__ import absolute_import, unicode_literals, print_function diff --git a/src/caosdb/utils/caosdb_admin.py b/src/caosdb/utils/caosdb_admin.py index c7e3024f3e5459d69a8cb8d2a21b01f4f23e2c43..250c2878d5d615b0815bdd7b0bb287d1567fe085 100755 --- a/src/caosdb/utils/caosdb_admin.py +++ b/src/caosdb/utils/caosdb_admin.py @@ -291,7 +291,8 @@ USAGE "`password_method` of the connection is set to " "`auth_token` and the respective configuration " "from the pycaosdb.ini is effectively being " - "overridden.")) + "overridden.\nTODO: Also allow passing the token " + "via environmenty variables.")) subparsers = parser.add_subparsers( title="commands", metavar="COMMAND", diff --git a/src/caosdb/utils/server_side_scripting.py b/src/caosdb/utils/server_side_scripting.py index 861b5fb6e13f3082e55085f1975c596a8c9c8c52..663178dcbda4293cb30dff88efbfb7b7302df70d 100644 --- a/src/caosdb/utils/server_side_scripting.py +++ b/src/caosdb/utils/server_side_scripting.py @@ -34,6 +34,12 @@ from caosdb.connection.encode import MultipartParam, multipart_encode def _make_params(pos_args, opts): + """Create and return option string components. + +The return value is a dict with be something like `-O<key>`:`<value>` from `opts` and +`-p{0,1,2,3,...}`:`<value>` from `pos_args`. + + """ result = {} for key, val in opts.items(): result["-O{key}".format(key=key)] = str(val) @@ -43,6 +49,8 @@ def _make_params(pos_args, opts): def _make_multipart_request(call, pos_args, opts, files): + """Return body and header for an HTTP request. + """ parts = list() params = _make_params(pos_args, opts) @@ -59,6 +67,7 @@ def _make_multipart_request(call, pos_args, opts, files): def _make_form_request(call, pos_args, opts): + """Return URL from call and argumewnts, and headers for urlencoding.""" form = dict() form["call"] = call @@ -73,6 +82,8 @@ def _make_form_request(call, pos_args, opts): def _make_request(call, pos_args, opts, files=None): """ + Multipart if with files, otherwise url-encoded. + Return ------ path_segments, body, headers diff --git a/unittests/test_add_property.py b/unittests/test_add_property.py index 1f8c7e3b832c701f114d1014d8bc9f9409329e80..5bae6c219732f0170f5c351eae58148c9d3d065a 100644 --- a/unittests/test_add_property.py +++ b/unittests/test_add_property.py @@ -5,6 +5,8 @@ # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen +# Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> +# Copyright (C) 2020 Timm Fitschen <f.fitschen@indiscale.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as