From 4e9fd550932d7fdf7d6304398441ab52f5b9c2f1 Mon Sep 17 00:00:00 2001 From: TuxCoder Date: Sat, 19 Feb 2022 10:22:21 +0100 Subject: [PATCH] change python client generator for hydra --- default.nix | 18 +- lenticular_cloud/template/base.html.j2 | 75 +- lenticular_cloud/views/auth.py | 4 +- libs/README.md | 4 + libs/ory-hydra-client/.gitignore | 23 + libs/ory-hydra-client/README.md | 87 + .../ory_hydra_client/__init__.py | 2 + .../ory_hydra_client/api/__init__.py | 1 + .../ory_hydra_client/api/admin/__init__.py | 0 .../api/admin/accept_consent_request.py | 273 ++ .../api/admin/accept_login_request.py | 261 ++ .../api/admin/accept_logout_request.py | 176 + .../api/admin/create_json_web_key_set.py | 207 ++ .../api/admin/create_o_auth_2_client.py | 189 ++ .../api/admin/delete_json_web_key.py | 193 ++ .../api/admin/delete_json_web_key_set.py | 180 + .../api/admin/delete_o_auth_2_client.py | 172 + .../api/admin/delete_o_auth_2_token.py | 158 + .../admin/flush_inactive_o_auth_2_tokens.py | 172 + .../api/admin/get_consent_request.py | 228 ++ .../api/admin/get_json_web_key.py | 167 + .../api/admin/get_json_web_key_set.py | 182 + .../api/admin/get_login_request.py | 212 ++ .../api/admin/get_logout_request.py | 160 + .../api/admin/get_o_auth_2_client.py | 174 + .../ory_hydra_client/api/admin/get_version.py | 136 + .../api/admin/introspect_o_auth_2_token.py | 161 + .../api/admin/is_instance_alive.py | 157 + .../api/admin/list_o_auth_2_clients.py | 224 ++ .../admin/list_subject_consent_sessions.py | 205 ++ .../ory_hydra_client/api/admin/prometheus.py | 99 + .../api/admin/reject_consent_request.py | 265 ++ .../api/admin/reject_login_request.py | 253 ++ .../api/admin/reject_logout_request.py | 200 ++ .../admin/revoke_authentication_session.py | 182 + .../api/admin/revoke_consent_sessions.py | 200 ++ .../api/admin/update_json_web_key.py | 223 ++ .../api/admin/update_json_web_key_set.py | 222 ++ .../api/admin/update_o_auth_2_client.py | 194 ++ .../ory_hydra_client/api/public/__init__.py | 0 .../api/public/disconnect_user.py | 87 + .../public/discover_open_id_configuration.py | 165 + .../api/public/is_instance_ready.py | 161 + .../api/public/oauth_2_token.py | 173 + .../ory_hydra_client/api/public/oauth_auth.py | 147 + .../api/public/revoke_o_auth_2_token.py | 155 + .../ory_hydra_client/api/public/userinfo.py | 149 + .../ory_hydra_client/api/public/well_known.py | 141 + .../ory_hydra_client/client.py | 48 + .../ory_hydra_client/models/__init__.py | 46 + .../models/accept_consent_request.py | 125 + .../models/accept_login_request.py | 135 + .../models/completed_request.py | 58 + .../models/consent_request.py | 200 ++ .../models/consent_request_session.py | 89 + .../consent_request_session_access_token.py | 49 + .../consent_request_session_id_token.py | 47 + .../models/container_wait_ok_body_error.py | 58 + .../flush_inactive_o_auth_2_tokens_request.py | 68 + .../ory_hydra_client/models/generic_error.py | 86 + .../models/health_not_ready_status.py | 66 + .../models/health_not_ready_status_errors.py | 44 + .../ory_hydra_client/models/health_status.py | 57 + .../models/jose_json_web_key_set.py | 44 + .../models/json_raw_message.py | 44 + .../ory_hydra_client/models/json_web_key.py | 237 ++ .../models/json_web_key_set.py | 78 + .../json_web_key_set_generator_request.py | 74 + .../ory_hydra_client/models/login_request.py | 147 + .../ory_hydra_client/models/logout_request.py | 82 + .../models/o_auth_2_client.py | 426 +++ .../models/o_auth_2_token_introspection.py | 197 ++ .../o_auth_2_token_introspection_ext.py | 44 + .../models/oauth_2_token_response.py | 98 + .../models/open_id_connect_context.py | 140 + ...id_connect_context_id_token_hint_claims.py | 48 + .../ory_hydra_client/models/plugin_config.py | 215 ++ .../models/plugin_config_args.py | 80 + .../models/plugin_config_interface.py | 76 + .../models/plugin_config_linux.py | 84 + .../models/plugin_config_network.py | 58 + .../models/plugin_config_rootfs.py | 69 + .../models/plugin_config_user.py | 66 + .../ory_hydra_client/models/plugin_device.py | 79 + .../ory_hydra_client/models/plugin_env.py | 80 + .../models/plugin_interface_type.py | 72 + .../ory_hydra_client/models/plugin_mount.py | 102 + .../models/plugin_settings.py | 102 + .../models/previous_consent_session.py | 144 + .../ory_hydra_client/models/reject_request.py | 96 + .../models/userinfo_response.py | 239 ++ .../ory_hydra_client/models/version.py | 57 + .../models/volume_usage_data.py | 70 + .../ory_hydra_client/models/well_known.py | 330 ++ .../ory_hydra_client/py.typed | 1 + .../ory_hydra_client/types.py | 43 + libs/ory-hydra-client/pyproject.toml | 16 + libs/ory-hydra-client/setup.py | 18 + specs/api_template/.gitignore.jinja | 23 + specs/api_template/README.md.jinja | 87 + specs/api_template/api_init.py.jinja | 1 + specs/api_template/client.py.jinja | 45 + specs/api_template/endpoint_init.py.jinja | 0 specs/api_template/endpoint_macros.py.jinja | 165 + specs/api_template/endpoint_module.py.jinja | 142 + specs/api_template/int_enum.py.jinja | 9 + specs/api_template/model.py.jinja | 181 + specs/api_template/models_init.py.jinja | 5 + specs/api_template/package_init.py.jinja | 2 + .../property_templates/any_property.py.jinja | 0 .../boolean_property.py.jinja | 3 + .../property_templates/date_property.py.jinja | 35 + .../datetime_property.py.jinja | 39 + .../property_templates/enum_property.py.jinja | 35 + .../property_templates/file_property.py.jinja | 31 + .../float_property.py.jinja | 3 + .../property_templates/helpers.jinja | 18 + .../property_templates/int_property.py.jinja | 3 + .../property_templates/list_property.py.jinja | 77 + .../model_property.py.jinja | 40 + .../property_macros.py.jinja | 20 + .../union_property.py.jinja | 85 + specs/api_template/pyproject.toml.jinja | 41 + .../pyproject_no_poetry.toml.jinja | 16 + specs/api_template/setup.py.jinja | 18 + specs/api_template/str_enum.py.jinja | 9 + specs/api_template/types.py.jinja | 44 + specs/hydra.yaml | 2960 +++++++++++++++++ 128 files changed, 16275 insertions(+), 11 deletions(-) create mode 100644 libs/README.md create mode 100644 libs/ory-hydra-client/.gitignore create mode 100644 libs/ory-hydra-client/README.md create mode 100644 libs/ory-hydra-client/ory_hydra_client/__init__.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/__init__.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/__init__.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/accept_consent_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/accept_login_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/accept_logout_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/create_json_web_key_set.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/create_o_auth_2_client.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/delete_json_web_key.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/delete_json_web_key_set.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/delete_o_auth_2_client.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/delete_o_auth_2_token.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/flush_inactive_o_auth_2_tokens.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/get_consent_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/get_json_web_key.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/get_json_web_key_set.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/get_login_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/get_logout_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/get_o_auth_2_client.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/get_version.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/introspect_o_auth_2_token.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/is_instance_alive.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/list_o_auth_2_clients.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/list_subject_consent_sessions.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/prometheus.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/reject_consent_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/reject_login_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/reject_logout_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/revoke_authentication_session.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/revoke_consent_sessions.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/update_json_web_key.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/update_json_web_key_set.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/admin/update_o_auth_2_client.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/__init__.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/disconnect_user.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/discover_open_id_configuration.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/is_instance_ready.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/oauth_2_token.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/oauth_auth.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/revoke_o_auth_2_token.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/userinfo.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/api/public/well_known.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/client.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/__init__.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/accept_consent_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/accept_login_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/completed_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/consent_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/consent_request_session.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/consent_request_session_access_token.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/consent_request_session_id_token.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/container_wait_ok_body_error.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/flush_inactive_o_auth_2_tokens_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/generic_error.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/health_not_ready_status.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/health_not_ready_status_errors.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/health_status.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/jose_json_web_key_set.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/json_raw_message.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/json_web_key.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/json_web_key_set.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/json_web_key_set_generator_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/login_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/logout_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/o_auth_2_client.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/o_auth_2_token_introspection.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/o_auth_2_token_introspection_ext.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/oauth_2_token_response.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/open_id_connect_context.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/open_id_connect_context_id_token_hint_claims.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_config.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_config_args.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_config_interface.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_config_linux.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_config_network.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_config_rootfs.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_config_user.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_device.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_env.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_interface_type.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_mount.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/plugin_settings.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/previous_consent_session.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/reject_request.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/userinfo_response.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/version.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/volume_usage_data.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/models/well_known.py create mode 100644 libs/ory-hydra-client/ory_hydra_client/py.typed create mode 100644 libs/ory-hydra-client/ory_hydra_client/types.py create mode 100644 libs/ory-hydra-client/pyproject.toml create mode 100644 libs/ory-hydra-client/setup.py create mode 100644 specs/api_template/.gitignore.jinja create mode 100644 specs/api_template/README.md.jinja create mode 100644 specs/api_template/api_init.py.jinja create mode 100644 specs/api_template/client.py.jinja create mode 100644 specs/api_template/endpoint_init.py.jinja create mode 100644 specs/api_template/endpoint_macros.py.jinja create mode 100644 specs/api_template/endpoint_module.py.jinja create mode 100644 specs/api_template/int_enum.py.jinja create mode 100644 specs/api_template/model.py.jinja create mode 100644 specs/api_template/models_init.py.jinja create mode 100644 specs/api_template/package_init.py.jinja create mode 100644 specs/api_template/property_templates/any_property.py.jinja create mode 100644 specs/api_template/property_templates/boolean_property.py.jinja create mode 100644 specs/api_template/property_templates/date_property.py.jinja create mode 100644 specs/api_template/property_templates/datetime_property.py.jinja create mode 100644 specs/api_template/property_templates/enum_property.py.jinja create mode 100644 specs/api_template/property_templates/file_property.py.jinja create mode 100644 specs/api_template/property_templates/float_property.py.jinja create mode 100644 specs/api_template/property_templates/helpers.jinja create mode 100644 specs/api_template/property_templates/int_property.py.jinja create mode 100644 specs/api_template/property_templates/list_property.py.jinja create mode 100644 specs/api_template/property_templates/model_property.py.jinja create mode 100644 specs/api_template/property_templates/property_macros.py.jinja create mode 100644 specs/api_template/property_templates/union_property.py.jinja create mode 100644 specs/api_template/pyproject.toml.jinja create mode 100644 specs/api_template/pyproject_no_poetry.toml.jinja create mode 100644 specs/api_template/setup.py.jinja create mode 100644 specs/api_template/str_enum.py.jinja create mode 100644 specs/api_template/types.py.jinja create mode 100644 specs/hydra.yaml diff --git a/default.nix b/default.nix index 3f49833..eb251ff 100644 --- a/default.nix +++ b/default.nix @@ -3,6 +3,9 @@ python ? pkgs.python39, ...}: let + + nixpkgs_unstable = import {}; + urlobject = with python.pkgs; buildPythonPackage rec { pname = "URLObject"; version = "2.4.3"; @@ -65,7 +68,7 @@ let }; u2flib-server = {}; - ory-hydra-client = with python.pkgs; buildPythonPackage rec { + ory-hydra-client-old = with python.pkgs; buildPythonPackage rec { pname = "ory-hydra-client"; version = "1.10.6"; src = fetchPypi { @@ -77,7 +80,18 @@ let urllib3 python-dateutil ]; - + }; + ory-hydra-client = with python.pkgs; buildPythonPackage rec { + pname = "ory-hydra-client"; + version = "1.9.2"; + src = ./libs/ory-hydra-client; +# doCheck = false; + propagatedBuildInputs = [ + urllib3 + python-dateutil + nixpkgs_unstable.python39Packages.attrs + httpx + ]; }; in { diff --git a/lenticular_cloud/template/base.html.j2 b/lenticular_cloud/template/base.html.j2 index f148a16..82be352 100644 --- a/lenticular_cloud/template/base.html.j2 +++ b/lenticular_cloud/template/base.html.j2 @@ -63,6 +63,54 @@ {% endfor %} {%- endmacro %} +{# Renders range field + Params: + field - WTForm field (there are no check, but you should put here only BooleanField. + kwargs - pass any arguments you want in order to put them into the html attributes. + There are few exceptions: for - for_, class - class_, class__ - class_ + + Example usage: + {{ macros.render_range_field(form.answere) }} + #} +{% macro render_range_field(field) -%} +
+ +
+
+
+ {{ field(class_='form-control', oninput='this.parentElement.nextElementSibling.children[0].value = this.value', **kwargs) }} +
+
+ +
+
+
+ {% if field.errors %} + {% for e in field.errors %} +

{{ e }}

+ {% endfor %} + {% endif %} +
+{%- endmacro %} + + +{% macro render_password_field(field, label_visible=true, horizontal=false) -%} + +
+ +
+ {{ field(class_='form-control', **kwargs) }} + +
+ {% if field.errors %} + {% for e in field.errors %} +

{{ e }}

+ {% endfor %} + {% endif %} +
+{%- endmacro %} + + {# Renders submit field Params: field - WTForm field (there are no check, but you should put here only BooleanField. @@ -91,24 +139,30 @@ {%- endmacro %} -{% macro render_list_field(field) -%} +{% macro render_list_field(field, horizontal) -%}
{{ field.label.text }} -