Skip to content

Commit

Permalink
add irods 4.3 client env support (#1834)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Nov 17, 2023
1 parent 6898d33 commit c5d1aef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ Added
- **Irodsbackend**
- ``get_version()`` helper (#1592, #1817, #1831)
- ``get_access_lookup()`` helper (#1832)
- **Irodsinfo**
- iRODS v4.3 auth scheme support in client environment (#1834)
- **Samplesheets**
- Custom validation for ``sheet_sync_url`` and ``sheet_sync_token`` (#1310, #1384)
- ``hpo.jax.org`` in ``SHEETS_ONTOLOGY_URL_SKIP`` (#1821)
- Missing Django settings in siteinfo (#1830)
- **Taskflowbackend**
- iRODS v4.3 support (#1592, #1817, #1832)

Changed
-------
Expand All @@ -32,8 +36,6 @@ Changed
- Upgrade Vue app dependencies (#1811)
- Change default IGV genome to ``b37_1kg`` (#1812)
- Update existing ``b37`` IGV genome settings with a migration (#1812)
- **Taskflowbackend**
- iRODS v4.3 support (#1592, #1817, #1832)

Fixed
-----
Expand Down
10 changes: 9 additions & 1 deletion irodsinfo/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import zipfile

from irods.exception import NetworkException, CAT_INVALID_AUTHENTICATION
from packaging import version

from django.conf import settings
from django.contrib import messages
Expand Down Expand Up @@ -43,7 +44,6 @@ def get_irods_client_env(user, irods_backend):
irods_env = dict(settings.IRODS_ENV_DEFAULT)
irods_env.update(
{
'irods_authentication_scheme': 'PAM',
'irods_cwd': home_path,
'irods_home': home_path,
'irods_host': settings.IRODS_HOST_FQDN,
Expand All @@ -56,6 +56,14 @@ def get_irods_client_env(user, irods_backend):
irods_env['irods_ssl_certificate_file'] = cert_file_name
# Get optional client environment overrides
irods_env.update(dict(settings.IRODS_ENV_CLIENT))
# Update authentication scheme with iRODS v4.3+ support
with irods_backend.get_session() as irods:
irods_version = irods_backend.get_version(irods)
if version.parse(irods_version) >= version.parse('4.3'):
auth_scheme = 'pam_password'
else:
auth_scheme = 'PAM'
irods_env['irods_authentication_scheme'] = auth_scheme
irods_env = irods_backend.format_env(irods_env)
logger.debug('iRODS environment: {}'.format(irods_env))
return irods_env
Expand Down

0 comments on commit c5d1aef

Please sign in to comment.