c2cgeoportal-commons 2.7.1.145__py3-none-any.whl → 2.9.0.350__py3-none-any.whl
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.
- c2cgeoportal_commons/__init__.py +1 -1
- c2cgeoportal_commons/alembic/env.py +18 -15
- c2cgeoportal_commons/alembic/main/028477929d13_add_technical_roles.py +3 -3
- c2cgeoportal_commons/alembic/main/04f05bfbb05e_remove_the_old_is_expanded_column.py +3 -1
- c2cgeoportal_commons/alembic/main/116b9b79fc4d_internal_and_external_layer_tables_.py +35 -39
- c2cgeoportal_commons/alembic/main/1418cb05921b_merge_1_6_and_master_branches.py +2 -4
- c2cgeoportal_commons/alembic/main/164ac0819a61_add_image_format_to_wmts_layer.py +2 -2
- c2cgeoportal_commons/alembic/main/166ff2dcc48d_create_database.py +5 -5
- c2cgeoportal_commons/alembic/main/16e43f8c0330_remove_old_metadata_column.py +2 -2
- c2cgeoportal_commons/alembic/main/1d5d4abfebd1_add_restricted_theme.py +3 -3
- c2cgeoportal_commons/alembic/main/1de20166b274_remove_v1_artifacts.py +2 -2
- c2cgeoportal_commons/alembic/main/20137477bd02_update_icons_url.py +2 -2
- c2cgeoportal_commons/alembic/main/21f11066f8ec_trigger_on_role_updates_user_in_static.py +14 -16
- c2cgeoportal_commons/alembic/main/22e6dfb556de_add_description_tree_.py +2 -2
- c2cgeoportal_commons/alembic/main/29f2a32859ec_merge_1_6_and_master_branches.py +2 -4
- c2cgeoportal_commons/alembic/main/2b8ed8c1df94_set_layergroup_treeitem_is_as_a_primary_.py +2 -2
- c2cgeoportal_commons/alembic/main/2e57710fecfe_update_the_ogc_server_for_ogc_api.py +77 -0
- c2cgeoportal_commons/alembic/main/32527659d57b_move_exclude_properties_from_layerv1_to_.py +8 -8
- c2cgeoportal_commons/alembic/main/32b21aa1d0ed_merge_e004f76e951a_and_e004f76e951a_.py +2 -4
- c2cgeoportal_commons/alembic/main/338b57593823_remove_trigger_on_role_name_change.py +16 -18
- c2cgeoportal_commons/alembic/main/415746eb9f6_changes_for_v2.py +31 -31
- c2cgeoportal_commons/alembic/main/44c91d82d419_add_table_log.py +72 -0
- c2cgeoportal_commons/alembic/main/5109242131ce_add_column_time_widget.py +4 -3
- c2cgeoportal_commons/alembic/main/52916d8fde8b_add_sql_fields_to_vector_tiles.py +5 -3
- c2cgeoportal_commons/alembic/main/53ba1a68d5fe_add_theme_to_fulltextsearch.py +2 -2
- c2cgeoportal_commons/alembic/main/54645a535ad6_add_ordering_in_relation.py +10 -10
- c2cgeoportal_commons/alembic/main/56dc90838d90_fix_removing_layerv1.py +2 -2
- c2cgeoportal_commons/alembic/main/596ba21e3833_separate_local_internal.py +6 -10
- c2cgeoportal_commons/alembic/main/678f88c7ad5e_add_vector_tiles_layers_table.py +2 -2
- c2cgeoportal_commons/alembic/main/6a412d9437b1_rename_serverogc_to_ogcserver.py +4 -4
- c2cgeoportal_commons/alembic/main/6d87fdad275a_convert_metadata_to_the_right_case.py +2 -2
- c2cgeoportal_commons/alembic/main/7530011a66a7_trigger_on_role_updates_user_in_static.py +14 -16
- c2cgeoportal_commons/alembic/main/78fd093c8393_add_api_s_intrfaces.py +30 -49
- c2cgeoportal_commons/alembic/main/7d271f4527cd_add_layer_column_in_layerv1_table.py +2 -2
- c2cgeoportal_commons/alembic/main/809650bd04c3_add_dimension_field.py +2 -2
- c2cgeoportal_commons/alembic/main/8117bb9bba16_use_dimension_on_all_the_layers.py +4 -4
- c2cgeoportal_commons/alembic/main/87f8330ed64e_add_missing_delete_cascades.py +2 -2
- c2cgeoportal_commons/alembic/main/9268a1dffac0_add_trigger_to_be_able_to_correctly_.py +2 -2
- c2cgeoportal_commons/alembic/main/94db7e7e5b21_merge_2_2_and_master_branches.py +2 -4
- c2cgeoportal_commons/alembic/main/951ff84bd8ec_be_able_to_delete_a_wms_layer_in_sql.py +2 -2
- c2cgeoportal_commons/alembic/main/a00109812f89_add_field_layer_wms_valid.py +4 -4
- c2cgeoportal_commons/alembic/main/a4558f032d7d_add_support_of_cog_layers.py +74 -0
- c2cgeoportal_commons/alembic/main/a4f1aac9bda_merge_1_6_and_master_branches.py +2 -4
- c2cgeoportal_commons/alembic/main/b60f2a505f42_remame_uimetadata_to_metadata.py +2 -2
- c2cgeoportal_commons/alembic/main/b6b09f414fe8_sync_model_database.py +174 -0
- c2cgeoportal_commons/alembic/main/c75124553bf3_remove_deprecated_columns.py +2 -2
- c2cgeoportal_commons/alembic/main/d48a63b348f1_change_mapserver_url_for_docker.py +6 -10
- c2cgeoportal_commons/alembic/main/d8ef99bc227e_be_able_to_delete_a_linked_functionality.py +2 -2
- c2cgeoportal_commons/alembic/main/daf738d5bae4_merge_2_0_and_master_branches.py +2 -4
- c2cgeoportal_commons/alembic/main/dba87f2647f9_merge_2_2_on_2_3.py +2 -4
- c2cgeoportal_commons/alembic/main/e004f76e951a_add_missing_not_null.py +6 -22
- c2cgeoportal_commons/alembic/main/e7e03dedade3_put_the_default_wms_server_in_the_.py +6 -10
- c2cgeoportal_commons/alembic/main/e85afd327ab3_cascade_deletes_to_tsearch.py +2 -2
- c2cgeoportal_commons/alembic/main/ec82a8906649_add_missing_on_delete_cascade_on_layer_.py +2 -2
- c2cgeoportal_commons/alembic/main/ee25d267bf46_main_interface_desktop.py +4 -10
- c2cgeoportal_commons/alembic/main/eeb345672454_merge_2_4_and_master_branches.py +2 -4
- c2cgeoportal_commons/alembic/static/0c640a58a09a_add_opt_key_column.py +2 -2
- c2cgeoportal_commons/alembic/static/107b81f5b9fe_add_missing_delete_cascades.py +2 -2
- c2cgeoportal_commons/alembic/static/1857owc78a07_add_last_login_and_expiration_date.py +2 -2
- c2cgeoportal_commons/alembic/static/1da396a88908_move_user_table_to_static_schema.py +6 -10
- c2cgeoportal_commons/alembic/static/267b4c1bde2e_add_display_name_in_the_user_for_better_.py +62 -0
- c2cgeoportal_commons/alembic/static/3f89a7d71a5e_alter_column_url_to_remove_limitation.py +2 -2
- c2cgeoportal_commons/alembic/static/44c91d82d419_add_table_log.py +72 -0
- c2cgeoportal_commons/alembic/static/53d671b17b20_add_timezone_on_datetime_fields.py +2 -2
- c2cgeoportal_commons/alembic/static/5472fbc19f39_add_temp_password_column.py +2 -2
- c2cgeoportal_commons/alembic/static/76d72fb3fcb9_add_oauth2_pkce.py +70 -0
- c2cgeoportal_commons/alembic/static/7ef947f30f20_add_oauth2_tables.py +3 -1
- c2cgeoportal_commons/alembic/static/910b4ca53b68_sync_model_database.py +186 -0
- c2cgeoportal_commons/alembic/static/aa41e9613256_wip_add_openid_connect_support.py +64 -0
- c2cgeoportal_commons/alembic/static/ae5e88f35669_add_table_user_role.py +8 -14
- c2cgeoportal_commons/alembic/static/bd029dbfc11a_fill_tech_data_column.py +2 -2
- c2cgeoportal_commons/lib/email_.py +15 -19
- c2cgeoportal_commons/lib/literal.py +3 -3
- c2cgeoportal_commons/lib/url.py +15 -16
- c2cgeoportal_commons/lib/validators.py +1 -3
- c2cgeoportal_commons/models/__init__.py +16 -9
- c2cgeoportal_commons/models/main.py +415 -226
- c2cgeoportal_commons/models/sqlalchemy.py +13 -13
- c2cgeoportal_commons/models/static.py +162 -71
- c2cgeoportal_commons/testing/__init__.py +12 -7
- c2cgeoportal_commons/testing/initializedb.py +7 -6
- {c2cgeoportal_commons-2.7.1.145.dist-info → c2cgeoportal_commons-2.9.0.350.dist-info}/METADATA +4 -5
- c2cgeoportal_commons-2.9.0.350.dist-info/RECORD +89 -0
- {c2cgeoportal_commons-2.7.1.145.dist-info → c2cgeoportal_commons-2.9.0.350.dist-info}/WHEEL +1 -1
- tests/conftest.py +1 -1
- c2cgeoportal_commons-2.7.1.145.dist-info/RECORD +0 -80
- {c2cgeoportal_commons-2.7.1.145.dist-info → c2cgeoportal_commons-2.9.0.350.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2018-2019, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2018-2025, Camptocamp SA
|
|
4
2
|
# All rights reserved.
|
|
5
3
|
|
|
6
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -27,7 +25,7 @@
|
|
|
27
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
28
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
29
27
|
|
|
30
|
-
# pylint: disable=
|
|
28
|
+
# pylint: disable=invalid-name
|
|
31
29
|
|
|
32
30
|
"""
|
|
33
31
|
Merge 2.2 on 2.3.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add missing not null.
|
|
@@ -51,31 +51,15 @@ def upgrade() -> None:
|
|
|
51
51
|
|
|
52
52
|
op.alter_column("layer_wmts", "url", nullable=False, schema=schema)
|
|
53
53
|
op.alter_column("layer_wmts", "layer", nullable=False, schema=schema)
|
|
54
|
-
op.execute(
|
|
55
|
-
"UPDATE ONLY {schema}.layer_wmts SET image_type = 'image/png' where image_type IS NULL".format(
|
|
56
|
-
schema=schema
|
|
57
|
-
)
|
|
58
|
-
)
|
|
54
|
+
op.execute(f"UPDATE ONLY {schema}.layer_wmts SET image_type = 'image/png' where image_type IS NULL")
|
|
59
55
|
op.alter_column("layer_wmts", "image_type", nullable=False, schema=schema)
|
|
60
56
|
op.alter_column("layer_wms", "ogc_server_id", nullable=False, schema=schema)
|
|
61
57
|
op.alter_column("layer_wms", "layer", nullable=False, schema=schema)
|
|
62
|
-
op.execute(
|
|
63
|
-
"UPDATE ONLY {schema}.layer_wms SET time_mode = 'disabled' where time_mode IS NULL".format(
|
|
64
|
-
schema=schema
|
|
65
|
-
)
|
|
66
|
-
)
|
|
58
|
+
op.execute(f"UPDATE ONLY {schema}.layer_wms SET time_mode = 'disabled' where time_mode IS NULL")
|
|
67
59
|
op.alter_column("layer_wms", "time_mode", nullable=False, schema=schema)
|
|
68
|
-
op.execute(
|
|
69
|
-
"UPDATE ONLY {schema}.layer_wms SET time_widget = 'slider' where time_widget IS NULL".format(
|
|
70
|
-
schema=schema
|
|
71
|
-
)
|
|
72
|
-
)
|
|
60
|
+
op.execute(f"UPDATE ONLY {schema}.layer_wms SET time_widget = 'slider' where time_widget IS NULL")
|
|
73
61
|
op.alter_column("layer_wms", "time_widget", nullable=False, schema=schema)
|
|
74
|
-
op.execute(
|
|
75
|
-
"UPDATE ONLY {schema}.ogc_server SET image_type = 'image/png' where image_type IS NULL".format(
|
|
76
|
-
schema=schema
|
|
77
|
-
)
|
|
78
|
-
)
|
|
62
|
+
op.execute(f"UPDATE ONLY {schema}.ogc_server SET image_type = 'image/png' where image_type IS NULL")
|
|
79
63
|
op.alter_column("ogc_server", "image_type", nullable=False, schema=schema)
|
|
80
64
|
op.execute(f"UPDATE ONLY {schema}.ogc_server SET type = 'mapserver' where type IS NULL")
|
|
81
65
|
op.alter_column("ogc_server", "type", nullable=False, schema=schema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Put the default WMS server in the servers part, add some constrains.
|
|
@@ -50,13 +50,11 @@ def upgrade() -> None:
|
|
|
50
50
|
schema = config["schema"]
|
|
51
51
|
|
|
52
52
|
op.execute(
|
|
53
|
-
"""
|
|
53
|
+
f"""
|
|
54
54
|
UPDATE "{schema}".ogc_server
|
|
55
55
|
SET url = 'config://local/mapserv'
|
|
56
56
|
WHERE url IS NULL
|
|
57
|
-
|
|
58
|
-
schema=schema
|
|
59
|
-
)
|
|
57
|
+
"""
|
|
60
58
|
)
|
|
61
59
|
|
|
62
60
|
op.alter_column("ogc_server", "url", nullable=False, schema=schema)
|
|
@@ -75,11 +73,9 @@ def downgrade() -> None:
|
|
|
75
73
|
op.drop_constraint("type_name_unique_treeitem", "treeitem", schema=schema)
|
|
76
74
|
|
|
77
75
|
op.execute(
|
|
78
|
-
"""
|
|
76
|
+
f"""
|
|
79
77
|
UPDATE "{schema}".ogc_server
|
|
80
78
|
SET url = NULL
|
|
81
79
|
WHERE url = 'config://local/mapserv'
|
|
82
|
-
|
|
83
|
-
schema=schema
|
|
84
|
-
)
|
|
80
|
+
"""
|
|
85
81
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Cascade deletes to tsearch.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add missing on delete cascade on layer tree.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
main interface => desktop.
|
|
@@ -49,17 +49,11 @@ def upgrade() -> None:
|
|
|
49
49
|
"""Upgrade."""
|
|
50
50
|
schema = config["schema"]
|
|
51
51
|
|
|
52
|
-
op.execute(
|
|
53
|
-
"UPDATE ONLY {schema}.interface AS i "
|
|
54
|
-
"SET name = 'desktop' where name = 'main'".format(schema=schema)
|
|
55
|
-
)
|
|
52
|
+
op.execute(f"UPDATE ONLY {schema}.interface AS i SET name = 'desktop' where name = 'main'")
|
|
56
53
|
|
|
57
54
|
|
|
58
55
|
def downgrade() -> None:
|
|
59
56
|
"""Downgrade."""
|
|
60
57
|
schema = config["schema"]
|
|
61
58
|
|
|
62
|
-
op.execute(
|
|
63
|
-
"UPDATE ONLY {schema}.interface AS i "
|
|
64
|
-
"SET name = 'main' where name = 'desktop'".format(schema=schema)
|
|
65
|
-
)
|
|
59
|
+
op.execute(f"UPDATE ONLY {schema}.interface AS i SET name = 'main' where name = 'desktop'")
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2019-2021, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
4
2
|
# All rights reserved.
|
|
5
3
|
|
|
6
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -27,7 +25,7 @@
|
|
|
27
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
28
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
29
27
|
|
|
30
|
-
# pylint: disable=
|
|
28
|
+
# pylint: disable=invalid-name
|
|
31
29
|
|
|
32
30
|
"""
|
|
33
31
|
Merge 2.4 and master branches.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add tech_data hstor column.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2020-
|
|
1
|
+
# Copyright (c) 2020-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add missing delete cascades.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2018-
|
|
1
|
+
# Copyright (c) 2018-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add columns last_login, expire_on (both datetime) and deactivated (boolean) on table main_static."user".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Move user table to static schema.
|
|
@@ -55,7 +55,7 @@ def upgrade() -> None:
|
|
|
55
55
|
|
|
56
56
|
engine = op.get_bind().engine
|
|
57
57
|
with engine.connect() as connection:
|
|
58
|
-
if type(engine).__name__ != "MockConnection" and op.get_context().dialect.has_table(
|
|
58
|
+
if type(engine).__name__ != "MockConnection" and op.get_context().dialect.has_table(
|
|
59
59
|
connection, "user", schema=staticschema
|
|
60
60
|
):
|
|
61
61
|
return
|
|
@@ -78,9 +78,7 @@ def upgrade() -> None:
|
|
|
78
78
|
op.add_column("user", Column("parent_role_name", String), schema=staticschema)
|
|
79
79
|
parent_column = ", parent_role_name"
|
|
80
80
|
parent_select = ", pr.name"
|
|
81
|
-
parent_join = "LEFT OUTER JOIN {parentschema!s}.role AS pr ON (pr.id = u.parent_role_id)"
|
|
82
|
-
parentschema=parentschema
|
|
83
|
-
)
|
|
81
|
+
parent_join = f"LEFT OUTER JOIN {parentschema!s}.role AS pr ON (pr.id = u.parent_role_id)"
|
|
84
82
|
|
|
85
83
|
try:
|
|
86
84
|
op.execute(
|
|
@@ -100,7 +98,7 @@ def upgrade() -> None:
|
|
|
100
98
|
}
|
|
101
99
|
)
|
|
102
100
|
op.drop_table("user", schema=schema)
|
|
103
|
-
except Exception:
|
|
101
|
+
except Exception: # pylint: disable=broad-exception-caught
|
|
104
102
|
op.execute(
|
|
105
103
|
"INSERT INTO %(staticschema)s.user (type, username, email, password, role) "
|
|
106
104
|
"VALUES ( 'user', 'admin', 'info@example.com', '%(pass)s', 'role_admin')"
|
|
@@ -134,9 +132,7 @@ def downgrade() -> None:
|
|
|
134
132
|
)
|
|
135
133
|
parent_column = ", parent_role_id"
|
|
136
134
|
parent_select = ", pr.id"
|
|
137
|
-
parent_join = "LEFT OUTER JOIN {parentschema}.role AS pr ON (pr.name = u.parent_role_name)"
|
|
138
|
-
parentschema=parentschema
|
|
139
|
-
)
|
|
135
|
+
parent_join = f"LEFT OUTER JOIN {parentschema}.role AS pr ON (pr.name = u.parent_role_name)"
|
|
140
136
|
|
|
141
137
|
op.execute(
|
|
142
138
|
"INSERT INTO %(schema)s.user "
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Copyright (c) 2024-2025, Camptocamp SA
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
# 1. Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
# list of conditions and the following disclaimer.
|
|
9
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
# this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
# and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
15
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
17
|
+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
18
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
19
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
20
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
21
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
22
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
+
|
|
24
|
+
# The views and conclusions contained in the software and documentation are those
|
|
25
|
+
# of the authors and should not be interpreted as representing official policies,
|
|
26
|
+
# either expressed or implied, of the FreeBSD Project.
|
|
27
|
+
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
Add display name in the user for better OpenID Connect support.
|
|
32
|
+
|
|
33
|
+
Revision ID: 267b4c1bde2e
|
|
34
|
+
Revises: aa41e9613256
|
|
35
|
+
Create Date: 2024-10-02 14:33:59.185133
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
import sqlalchemy as sa
|
|
39
|
+
from alembic import op
|
|
40
|
+
from c2c.template.config import config
|
|
41
|
+
|
|
42
|
+
# revision identifiers, used by Alembic.
|
|
43
|
+
revision = "267b4c1bde2e"
|
|
44
|
+
down_revision = "aa41e9613256"
|
|
45
|
+
branch_labels = None
|
|
46
|
+
depends_on = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def upgrade() -> None:
|
|
50
|
+
"""Upgrade."""
|
|
51
|
+
staticschema = config["schema_static"]
|
|
52
|
+
|
|
53
|
+
op.add_column("user", sa.Column("display_name", sa.Unicode(), nullable=True), schema=staticschema)
|
|
54
|
+
op.execute(f'UPDATE {staticschema}."user" SET display_name = username')
|
|
55
|
+
op.alter_column("user", "display_name", nullable=False, schema=staticschema)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def downgrade() -> None:
|
|
59
|
+
"""Downgrade."""
|
|
60
|
+
staticschema = config["schema_static"]
|
|
61
|
+
|
|
62
|
+
op.drop_column("user", "display_name", schema=staticschema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Alter_column_url_to_remove_limitation.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Copyright (c) 2023-2025, Camptocamp SA
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
# 1. Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
# list of conditions and the following disclaimer.
|
|
9
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
# this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
# and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
15
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
17
|
+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
18
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
19
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
20
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
21
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
22
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
+
|
|
24
|
+
# The views and conclusions contained in the software and documentation are those
|
|
25
|
+
# of the authors and should not be interpreted as representing official policies,
|
|
26
|
+
# either expressed or implied, of the FreeBSD Project.
|
|
27
|
+
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
Add table log.
|
|
32
|
+
|
|
33
|
+
Revision ID: 44c91d82d419
|
|
34
|
+
Revises: 7ef947f30f20
|
|
35
|
+
Create Date: 2023-01-14 10:58:44.404643
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
import sqlalchemy as sa
|
|
39
|
+
from alembic import op
|
|
40
|
+
from c2c.template.config import config
|
|
41
|
+
|
|
42
|
+
# revision identifiers, used by Alembic.
|
|
43
|
+
revision = "44c91d82d419"
|
|
44
|
+
down_revision = "7ef947f30f20"
|
|
45
|
+
branch_labels = None
|
|
46
|
+
depends_on = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def upgrade() -> None:
|
|
50
|
+
"""Upgrade."""
|
|
51
|
+
staticschema = config["schema_static"]
|
|
52
|
+
|
|
53
|
+
op.create_table(
|
|
54
|
+
"log",
|
|
55
|
+
sa.Column("id", sa.Integer(), nullable=False),
|
|
56
|
+
sa.Column("date", sa.DateTime(timezone=True), nullable=False),
|
|
57
|
+
sa.Column("action", sa.Unicode, nullable=False),
|
|
58
|
+
sa.Column("element_type", sa.String(length=50), nullable=False),
|
|
59
|
+
sa.Column("element_id", sa.Integer(), nullable=False),
|
|
60
|
+
sa.Column("element_name", sa.Unicode, nullable=False),
|
|
61
|
+
sa.Column("element_url_table", sa.Unicode, nullable=False),
|
|
62
|
+
sa.Column("username", sa.Unicode, nullable=False),
|
|
63
|
+
sa.PrimaryKeyConstraint("id"),
|
|
64
|
+
schema=staticschema,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def downgrade() -> None:
|
|
69
|
+
"""Downgrade."""
|
|
70
|
+
staticschema = config["schema_static"]
|
|
71
|
+
|
|
72
|
+
op.drop_table("log", schema=staticschema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2018-
|
|
1
|
+
# Copyright (c) 2018-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add timezone on datetime fields.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add temp_password column.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Copyright (c) 2023-2025, Camptocamp SA
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
# 1. Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
# list of conditions and the following disclaimer.
|
|
9
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
# this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
# and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
15
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
17
|
+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
18
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
19
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
20
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
21
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
22
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
+
|
|
24
|
+
# The views and conclusions contained in the software and documentation are those
|
|
25
|
+
# of the authors and should not be interpreted as representing official policies,
|
|
26
|
+
# either expressed or implied, of the FreeBSD Project.
|
|
27
|
+
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
Add Oauth2 - PKCE.
|
|
32
|
+
|
|
33
|
+
Revision ID: 76d72fb3fcb9
|
|
34
|
+
Revises: 44c91d82d419
|
|
35
|
+
Create Date: 2023-02-07 17:32:22.835450
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from alembic import op
|
|
39
|
+
from c2c.template.config import config
|
|
40
|
+
from sqlalchemy import Boolean, Column, String
|
|
41
|
+
|
|
42
|
+
# revision identifiers, used by Alembic.
|
|
43
|
+
revision = "76d72fb3fcb9"
|
|
44
|
+
down_revision = "44c91d82d419"
|
|
45
|
+
branch_labels = None
|
|
46
|
+
depends_on = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def upgrade() -> None:
|
|
50
|
+
"""Upgrade."""
|
|
51
|
+
staticschema = config["schema_static"]
|
|
52
|
+
|
|
53
|
+
op.add_column("oauth2_client", Column("state_required", Boolean), schema=staticschema)
|
|
54
|
+
op.add_column("oauth2_client", Column("pkce_required", Boolean), schema=staticschema)
|
|
55
|
+
op.add_column("oauth2_bearertoken", Column("state", String), schema=staticschema)
|
|
56
|
+
op.add_column("oauth2_authorizationcode", Column("state", String), schema=staticschema)
|
|
57
|
+
op.add_column("oauth2_authorizationcode", Column("challenge", String(128)), schema=staticschema)
|
|
58
|
+
op.add_column("oauth2_authorizationcode", Column("challenge_method", String(6)), schema=staticschema)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def downgrade() -> None:
|
|
62
|
+
"""Downgrade."""
|
|
63
|
+
staticschema = config["schema_static"]
|
|
64
|
+
|
|
65
|
+
op.drop_column("oauth2_client", "state_required", schema=staticschema)
|
|
66
|
+
op.drop_column("oauth2_client", "pkce_required", schema=staticschema)
|
|
67
|
+
op.drop_column("oauth2_bearertoken", "state", schema=staticschema)
|
|
68
|
+
op.drop_column("oauth2_authorizationcode", "state", schema=staticschema)
|
|
69
|
+
op.drop_column("oauth2_authorizationcode", "challenge", schema=staticschema)
|
|
70
|
+
op.drop_column("oauth2_authorizationcode", "challenge_method", schema=staticschema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2020, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2020-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
28
30
|
"""
|
|
29
31
|
Add OAuth2 tables.
|
|
30
32
|
|