Ahjo

Latest version: v3.10.1

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 7

3.2.0

New command for database version updates
Database updates can be run with `ahjo-upgrade` command. See more info in README.md.

Running Ahjo commands without config parameter
Ahjo config file parameter is no longer mandatory if the config path is defined in environment variable `AHJO_CONFIG_PATH`:


ahjo retrieves the configuration file path from environment variable
ahjo <action>
ahjo-upgrade

configuration file path is specified to <config_filename>
ahjo <action> <config_filename>
ahjo-upgrade <config_filename>
)

Skip Ahjo actions
Ahjo actions can be skipped with a new config parameter: `skipped_actions`. See more info in README.md.

Python 3.11
Added Python 3.11 to tox envlist. Currently Ahjo supports Python versions 3.7, 3.8, 3.9, 3.10 and 3.11.

3.1.5

Update pyodbc version
A vulnerability was found in pyodbc that enables a buffer overflow when fetching over 100 numbers long value from database. This was fixed by updating pyodbc to version 4.0.39.

3.1.4

Not secure
Bulk insert fix
In SQLAlchemy 2.0, the parameters `insertmanyvalues` and `setinputsizes` of the function `create_engine` are set to `True` by default. These settings are not compatible with the bulk insert method in ahjo v3.1.3. In this update, these settings are changed back to `False` (when dialect is mssql+pyodbc). Full support for the [insertmanyvalues ](https://docs.sqlalchemy.org/en/20/core/connections.html#engine-insertmanyvalues) will come to ahjo in a later release.

Safety workflow update
Updated workflow to run Safety againts pip freeze.

Update package versions
New package version requirements:
- `alembic == 1.9.4`
- `SQLAlchemy == 2.0.4`

3.1.3

Not secure
SQLAlchemy 2.0.2 support
SQLAlchemy version requirement was changed to 2.0.2. **This may affect existing ahjo projects**. More information about the changes required to migrate to SQLAlchemy 2.0 can be found here:

- [SQLAlchemy 2.0 - Major Migration Guide](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migrating-to-sqlalchemy-2-0)
- [What’s New in SQLAlchemy 2.0?](https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html)

3.1.2

Not secure
Support for PyODBC connection string configuration
Added ability to configure the value of TrustServerCertificate and Encrypt in ODBC connection string.
In previous versions, these parameters were hard coded as `TrustServerCertificate=no` and `Encrypt=no`.

New (optional) variables in ahjo config:
- `odbc_trust_server_certificate` - Possible values: `yes` or `no`
- `odbc_encrypt` - Possible values: `yes` or `no`

Alembic 1.9.2 support
Alembic version requirement was changed to 1.9.2.

3.1.1

Not secure
Change DefaultAzureCredential to AzureCliCredential

Simplified the workflow of obtaining an access token from [azure-identity](https://pypi.org/project/azure-identity/) library.
Changed Azure Identity authentication method from `DefaultAzureCredential` to `AzureCliCredential`.

Instructions for enabling azure identity authentication in ahjo:

1. Install [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
2. Set the config variable `azure_authentication` to `AzureIdentity`

Sign in interactively through your browser with the `az login` command.
If the login is successful, ahjo will use Azure credentials for creating an engine that connects to an Azure SQL database.

It should be noted that projects created with ahjo versions prior to 3.1.0 are not compatible with azure-identity based login. To make previously created ahjo projects compatible, you need to update the method `run_migrations_online` in `alembic/env.py` in the following way:


Old env.py
connectable = create_engine(du.create_sqlalchemy_url(conn_info))

New env.py
connectable = du.create_sqlalchemy_engine(
du.create_sqlalchemy_url(conn_info),
token = conn_info.get("token")
)

Page 4 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.