cornflow 1.3.2__tar.gz → 1.3.4__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.
- {cornflow-1.3.2/cornflow.egg-info → cornflow-1.3.4}/PKG-INFO +2 -2
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/user_role.py +12 -2
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/const.py +4 -1
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_cli.py +2 -2
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_roles.py +18 -13
- {cornflow-1.3.2 → cornflow-1.3.4/cornflow.egg-info}/PKG-INFO +2 -2
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow.egg-info/requires.txt +1 -1
- {cornflow-1.3.2 → cornflow-1.3.4}/requirements.txt +1 -1
- {cornflow-1.3.2 → cornflow-1.3.4}/setup.py +1 -1
- {cornflow-1.3.2 → cornflow-1.3.4}/MANIFEST.in +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/README.rst +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/airflow_config/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/airflow_config/airflow_local_settings.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/airflow_config/plugins/XCom/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/airflow_config/plugins/XCom/gce_xcom_backend.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/airflow_config/plugins/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/airflow_config/webserver_ldap.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/app.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/actions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/arguments.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/config.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/migrations.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/permissions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/roles.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/schemas.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/service.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/tools/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/tools/api_generator.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/tools/endpoint_tools.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/tools/models_tools.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/tools/schema_generator.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/tools/schemas_tools.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/tools/tools.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/users.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/utils.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/cli/views.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/access.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/actions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/auxiliar.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/cleanup.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/dag.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/permissions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/roles.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/schemas.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/users.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/commands/views.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/config.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/action.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/apiview.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/case.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/dag.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/data_check.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/example_data.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/execution.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/health.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/instance.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/licenses.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/login.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/main_alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/meta_resource.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/permission.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/roles.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/schemas.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/signup.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/tables.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/token.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/endpoints/user.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/gunicorn.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/README +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/alembic.ini +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/env.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/script.py.mako +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/00757b557b02_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/1af47a419bbd_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/4aac5e0c6e66_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/7c3ea5ab5501_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/991b98e24225_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/999b98e24225.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/a472b5ad50b7_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/c2db9409cb5f_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/c8a6c762e818_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/ca449af8034c_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/cef1df240b27_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/d0e0700dcd8e_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/d1b5be1f0549_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/e1a50dae1ac9_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/e937a5234ce4_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/ebdd955fcc5e_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/migrations/versions/f3bee20314a2_.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/action.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/base_data_model.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/case.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/dag.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/dag_permissions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/execution.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/instance.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/main_alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/meta_models.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/permissions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/role.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/user.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/user_role.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/models/view.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/action.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/case.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/common.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/dag.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/example_data.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/execution.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/health.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/instance.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/main_alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/model_json.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/patch.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/permissions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/query.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/role.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/schemas.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/solution_log.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/tables.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/user.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/user_role.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/schemas/view.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/authentication/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/authentication/auth.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/authentication/decorators.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/authentication/ldap.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/compress.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/email.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/exceptions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/licenses.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/log_config.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/query_tools.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/utils.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/utils_tables.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/shared/validators.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/base_test_execution.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/const.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/custom_liveServer.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/custom_test_case.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/integration/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/integration/test_commands.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/integration/test_cornflowclient.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/ldap/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/ldap/test_ldap_authentication.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/__init__.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_actions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_apiview.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_application.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_cases.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_commands.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_dags.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_data_checks.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_example_data.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_executions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_external_role_creation.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_generate_from_schema.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_get_resources.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_health.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_instances.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_instances_file.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_licenses.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_log_in.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_main_alarms.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_permissions.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_schema_from_models.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_schemas.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_sign_up.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_tables.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_token.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/test_users.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow/tests/unit/tools.py +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow.egg-info/SOURCES.txt +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow.egg-info/dependency_links.txt +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow.egg-info/entry_points.txt +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/cornflow.egg-info/top_level.txt +0 -0
- {cornflow-1.3.2 → cornflow-1.3.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cornflow
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.4
|
|
4
4
|
Summary: cornflow is an open source multi-solver optimization server with a REST API built using flask.
|
|
5
5
|
Home-page: https://github.com/baobabsoluciones/cornflow
|
|
6
6
|
Author: baobab soluciones
|
|
@@ -14,7 +14,7 @@ Requires-Dist: alembic==1.9.2
|
|
|
14
14
|
Requires-Dist: apispec==6.3.0
|
|
15
15
|
Requires-Dist: cachetools==5.3.3
|
|
16
16
|
Requires-Dist: click==8.1.7
|
|
17
|
-
Requires-Dist: cornflow-client==1.3.
|
|
17
|
+
Requires-Dist: cornflow-client==1.3.4
|
|
18
18
|
Requires-Dist: cryptography==46.0.5
|
|
19
19
|
Requires-Dist: disposable-email-domains==0.0.162
|
|
20
20
|
Requires-Dist: Flask==2.3.2
|
|
@@ -18,6 +18,10 @@ from cornflow.shared.exceptions import EndpointNotImplemented, ObjectAlreadyExis
|
|
|
18
18
|
|
|
19
19
|
class UserRoleListEndpoint(BaseMetaResource):
|
|
20
20
|
ROLES_WITH_ACCESS = [ADMIN_ROLE]
|
|
21
|
+
# Other roles can get their own roles, but not all roles
|
|
22
|
+
# This is because the admin role is the only one that can get all roles
|
|
23
|
+
# and the other roles can only get their own roles
|
|
24
|
+
|
|
21
25
|
DESCRIPTION = (
|
|
22
26
|
"Endpoint to get the list of roles assigned to users and create new assignments"
|
|
23
27
|
)
|
|
@@ -34,16 +38,22 @@ class UserRoleListEndpoint(BaseMetaResource):
|
|
|
34
38
|
API method to get the assigned roles to the users defined in the application.
|
|
35
39
|
It requires authentication to be passed in the form of a token that has to be linked to
|
|
36
40
|
an existing session (login) made by a user.
|
|
41
|
+
Admin users receive every assignment; other users receive only their own.
|
|
37
42
|
|
|
38
43
|
:return: A dictionary with the response (data of the user assigned roles or an error message)
|
|
39
44
|
and an integer with the HTTP status code.
|
|
40
45
|
:rtype: Tuple(dict, integer)
|
|
41
46
|
|
|
42
47
|
"""
|
|
48
|
+
if self.is_admin():
|
|
49
|
+
current_app.logger.info(
|
|
50
|
+
f"User {self.get_user()} gets all user roles assignments"
|
|
51
|
+
)
|
|
52
|
+
return self.get_list()
|
|
43
53
|
current_app.logger.info(
|
|
44
|
-
f"User {self.get_user()} gets
|
|
54
|
+
f"User {self.get_user()} gets their own user role assignments"
|
|
45
55
|
)
|
|
46
|
-
return self.get_list()
|
|
56
|
+
return self.get_list(user_id=self.get_user_id())
|
|
47
57
|
|
|
48
58
|
@doc(description="Creates a new role assignment", tags=["User roles"])
|
|
49
59
|
@authenticate(auth_class=Auth())
|
|
@@ -7,7 +7,7 @@ AIRFLOW_BACKEND = 1
|
|
|
7
7
|
DATABRICKS_BACKEND = 2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
CORNFLOW_VERSION = "1.3.
|
|
10
|
+
CORNFLOW_VERSION = "1.3.4"
|
|
11
11
|
INTERNAL_TOKEN_ISSUER = "cornflow"
|
|
12
12
|
|
|
13
13
|
# endpoints responses for health check
|
|
@@ -150,6 +150,9 @@ BASE_PERMISSION_ASSIGNATION = [
|
|
|
150
150
|
|
|
151
151
|
EXTRA_PERMISSION_ASSIGNATION = [
|
|
152
152
|
(VIEWER_ROLE, PUT_ACTION, "user-detail"),
|
|
153
|
+
(VIEWER_ROLE, GET_ACTION, "user-roles"),
|
|
154
|
+
(PLANNER_ROLE, GET_ACTION, "user-roles"),
|
|
155
|
+
(SERVICE_ROLE, GET_ACTION, "user-roles"),
|
|
153
156
|
]
|
|
154
157
|
|
|
155
158
|
# Costants for messages that are given back on exceptions
|
|
@@ -327,7 +327,7 @@ class CLITests(TestCase):
|
|
|
327
327
|
self.assertEqual(len(actions), 5)
|
|
328
328
|
self.assertEqual(len(roles), 4)
|
|
329
329
|
self.assertEqual(len(views), (len(resources) + len(alarms_resources)))
|
|
330
|
-
self.assertEqual(len(permissions),
|
|
330
|
+
self.assertEqual(len(permissions), 586)
|
|
331
331
|
|
|
332
332
|
def test_permissions_base_command(self):
|
|
333
333
|
"""
|
|
@@ -353,7 +353,7 @@ class CLITests(TestCase):
|
|
|
353
353
|
self.assertEqual(len(actions), 5)
|
|
354
354
|
self.assertEqual(len(roles), 4)
|
|
355
355
|
self.assertEqual(len(views), (len(resources) + len(alarms_resources)))
|
|
356
|
-
self.assertEqual(len(permissions),
|
|
356
|
+
self.assertEqual(len(permissions), 586)
|
|
357
357
|
|
|
358
358
|
def test_service_entrypoint(self):
|
|
359
359
|
"""
|
|
@@ -21,6 +21,7 @@ from cornflow.shared.const import (
|
|
|
21
21
|
ADMIN_ROLE,
|
|
22
22
|
PLANNER_ROLE,
|
|
23
23
|
ROLES_MAP,
|
|
24
|
+
SERVICE_ROLE,
|
|
24
25
|
VIEWER_ROLE,
|
|
25
26
|
)
|
|
26
27
|
from cornflow.tests.const import ROLES_URL, USER_ROLE_URL
|
|
@@ -253,20 +254,24 @@ class TestUserRolesListEndpoint(CustomTestCase):
|
|
|
253
254
|
self.assertEqual(200, response.status_code)
|
|
254
255
|
self.assertCountEqual(self.payload, response.json)
|
|
255
256
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
self.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
257
|
+
for role in (VIEWER_ROLE, PLANNER_ROLE, SERVICE_ROLE):
|
|
258
|
+
self.token = self.create_user_with_role(role)
|
|
259
|
+
user = UserModel.get_one_object(username=f"testuser{role}")
|
|
260
|
+
response = self.client.get(
|
|
261
|
+
self.url,
|
|
262
|
+
follow_redirects=True,
|
|
263
|
+
headers={
|
|
264
|
+
"Content-Type": "application/json",
|
|
265
|
+
"Authorization": f"Bearer {self.token}",
|
|
266
|
+
},
|
|
267
|
+
)
|
|
268
|
+
self.assertEqual(200, response.status_code)
|
|
269
|
+
self.assertTrue(
|
|
270
|
+
any(
|
|
271
|
+
r["user_id"] == user.id and r["role_id"] == role
|
|
272
|
+
for r in response.json
|
|
268
273
|
)
|
|
269
|
-
|
|
274
|
+
)
|
|
270
275
|
|
|
271
276
|
def test_post_role_assignment_authorized_user(self):
|
|
272
277
|
for role in self.roles_with_access:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cornflow
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.4
|
|
4
4
|
Summary: cornflow is an open source multi-solver optimization server with a REST API built using flask.
|
|
5
5
|
Home-page: https://github.com/baobabsoluciones/cornflow
|
|
6
6
|
Author: baobab soluciones
|
|
@@ -14,7 +14,7 @@ Requires-Dist: alembic==1.9.2
|
|
|
14
14
|
Requires-Dist: apispec==6.3.0
|
|
15
15
|
Requires-Dist: cachetools==5.3.3
|
|
16
16
|
Requires-Dist: click==8.1.7
|
|
17
|
-
Requires-Dist: cornflow-client==1.3.
|
|
17
|
+
Requires-Dist: cornflow-client==1.3.4
|
|
18
18
|
Requires-Dist: cryptography==46.0.5
|
|
19
19
|
Requires-Dist: disposable-email-domains==0.0.162
|
|
20
20
|
Requires-Dist: Flask==2.3.2
|
|
@@ -9,7 +9,7 @@ with open("requirements.txt", "r") as fh:
|
|
|
9
9
|
|
|
10
10
|
setuptools.setup(
|
|
11
11
|
name="cornflow",
|
|
12
|
-
version="1.3.
|
|
12
|
+
version="1.3.4",
|
|
13
13
|
author="baobab soluciones",
|
|
14
14
|
author_email="cornflow@baobabsoluciones.es",
|
|
15
15
|
description="cornflow is an open source multi-solver optimization server with a REST API built using flask.",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|