Skip to content

CKAN 2.11 support#92

Open
markstuart wants to merge 3 commits into
masterfrom
ckan_2_11_support
Open

CKAN 2.11 support#92
markstuart wants to merge 3 commits into
masterfrom
ckan_2_11_support

Conversation

@markstuart
Copy link
Copy Markdown
Contributor

Testing our site against CKAN 2.11.4 showed up a couple of issues that needed addressing.

markstuart and others added 3 commits February 18, 2026 16:46
- 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()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' %}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CKAN 2.10+ uses Bootstrap 5, and this makes it compatible with the BS5 styling.

Comment thread ckanext/security/model.py
db_engine = model.meta.engine
inspector = inspect(db_engine)

if not inspector.has_table('package'):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread requirements.txt
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this moved downward?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

maxwellyoung added a commit to maxwellyoung/ckanext-security that referenced this pull request Feb 18, 2026
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants