# -*- coding: utf-8 -*-
#
# Copyright (C) 2022 GEO Secretariat.
#
# geo-config is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

"""GEO Config configuration module for GEO Knowledge Hub."""

# Monkey patch Werkzeug 2.1
# Flask-Login uses the safe_str_cmp method which has been removed in Werkzeug
# 2.1. Flask-Login v0.6.0 (yet to be released at the time of writing) fixes the
# issue. Once we depend on Flask-Login v0.6.0 as the minimal version in
# Flask-Security-Invenio/Invenio-Accounts we can remove this patch again.
# Code extracted from `invenio-userprofiles` module.
try:
    # Werkzeug <2.1
    from werkzeug import security

    security.safe_str_cmp
except AttributeError:
    # Werkzeug >=2.1
    import hmac

    from werkzeug import security

    security.safe_str_cmp = hmac.compare_digest


from .ext import GEOConfig
from .version import __version__

__all__ = (
    "__version__",
    "GEOConfig",
)

# -*- coding: utf-8 -*-
#
# Copyright (C) 2022 GEO Secretariat.
#
# geo-config is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

"""GEO Config configuration module for GEO Knowledge Hub."""

# Monkey patch Werkzeug 2.1
# Flask-Login uses the safe_str_cmp method which has been removed in Werkzeug
# 2.1. Flask-Login v0.6.0 (yet to be released at the time of writing) fixes the
# issue. Once we depend on Flask-Login v0.6.0 as the minimal version in
# Flask-Security-Invenio/Invenio-Accounts we can remove this patch again.
# Code extracted from `invenio-userprofiles` module.
try:
    # Werkzeug <2.1
    from werkzeug import security

    security.safe_str_cmp
except AttributeError:
    # Werkzeug >=2.1
    import hmac

    from werkzeug import security

    security.safe_str_cmp = hmac.compare_digest


from .ext import GEOConfig
from .version import __version__

__all__ = (
    "__version__",
    "GEOConfig",
)

# -*- coding: utf-8 -*- # # Copyright (C) 2022 GEO Secretariat. # # geo-config is free software; you can redistribute it and/or modify it under # the terms of the MIT License; see LICENSE file for more details. GEO Config configuration module for GEO Knowledge Hub. # Monkey patch Werkzeug 2.1 # Flask-Login uses the safe_str_cmp method which has been removed in Werkzeug # 2.1. Flask-Login v0.6.0 (yet to be released at the time of writing) fixes the # issue. Once we depend on Flask-Login v0.6.0 as the minimal version in # Flask-Security-Invenio/Invenio-Accounts we can remove this patch again. # Code extracted from `invenio-userprofiles` module. # Werkzeug <2.1 # Werkzeug >=2.1