CKAN 2.11 support#92
Conversation
- Remove dead CKANLoginThrottle and BeakerRedisAuth classes (repoze.who removed) - Fix SQLAlchemy table.exists() deprecation in model.py (use inspect) - Remove Beaker/repoze.who dependencies from requirements.txt - Loosen redis pin to >=4.1 for compatibility with CKAN core Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Restore CKANLoginThrottle and BeakerRedisAuth classes (needed for CKAN < 2.11 repoze.who-based auth) - Restore Beaker/repoze.who/WebOb requirements (needed for CKAN < 2.11) - Keep SQLAlchemy inspect() fix for 2.11 compat (replaces deprecated table.exists()), using positional arg to create() instead of bind= keyword which was removed in SQLAlchemy 2.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…able Beaker session (CKAN < 2.11) has invalidate(); Flask-Session (CKAN 2.11+) uses clear(). Duck-type to support both. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| if hasattr(session, 'invalidate'): | ||
| session.invalidate() | ||
| else: | ||
| session.clear() |
There was a problem hiding this comment.
This has been raised by other contributors as well, thanks for that team 👍
| <fieldset> | ||
| <legend>{{_('Two factor authentication')}}</legend> | ||
| {% link_for _('Manage two factor authentication'), controller='mfa_user', action='configure_mfa', id=data.id, class_='btn btn-default pull-left', icon='cog' %} | ||
| {% link_for _('Manage two factor authentication'), controller='mfa_user', action='configure_mfa', id=data.id, class_='btn btn-secondary float-start', icon='cog' %} |
There was a problem hiding this comment.
CKAN 2.10+ uses Bootstrap 5, and this makes it compatible with the BS5 styling.
| db_engine = model.meta.engine | ||
| inspector = inspect(db_engine) | ||
|
|
||
| if not inspector.has_table('package'): |
There was a problem hiding this comment.
Newer versions of SQLAlchemy have dropped the exists function, but all versions of SQLAlchemy that CKAN has used since 2.9+ have the has_table function available, so this will be backward compatible at least to there.
| git+https://github.com/akissa/repoze.who-use_beaker@780379fd58b10264c0756feb6d3f232f797ba0cb#egg=repoze.who-use_beaker | ||
| six~=1.16.0 | ||
| WebOb~=1.8.7 | ||
| pyotp~=2.6.0 |
There was a problem hiding this comment.
Why was this moved downward?
There was a problem hiding this comment.
the intent was that the 3 dependencies related to beaker and repoze are all essentially deprecated as per the comment, and grouped together for later removal.
- Add compatibility table showing supported CKAN versions and corresponding ckanext-security versions - Clarify that who.ini changes are only needed for CKAN 2.9.x - Note that CKAN 2.10+ uses Flask-Login (no who.ini needed) - Note CKAN 2.11 Flask-Session compatibility via data-govt-nz#92 - Remove outdated Python 2 requirements reference Closes data-govt-nz#77
Testing our site against CKAN 2.11.4 showed up a couple of issues that needed addressing.