{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# iRODS\n", "\n", "## Dependencies\n", "\n", "```{code}\n", " pip install python-irodsclient\n", "```" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Authentication" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/unlock/.rulecache\n", "/unlock/home\n", "/unlock/infrastructure\n", "/unlock/landingzone\n", "/unlock/projects\n", "/unlock/references\n", "/unlock/scratch\n", "/unlock/trash\n" ] } ], "source": [ "from irods.session import iRODSSession\n", "import ssl\n", "from irods.meta import iRODSMeta\n", "import os, sys\n", "\n", "\n", "# iRODS authentication information\n", "host = \"unlock-icat.irods.surfsara.nl\"\n", "port = 1247\n", "zone = \"unlock\"\n", "user = os.getenv('irodsUserName')\n", "password = os.getenv('irodsPassword')\n", "\n", "# SSL settings\n", "context = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, cafile=None, capath=None, cadata=None)\n", "\n", "ssl_settings = {'irods_client_server_negotiation': 'request_server_negotiation',\n", " 'irods_client_server_policy': 'CS_NEG_REQUIRE',\n", " 'irods_encryption_algorithm': 'AES-256-CBC',\n", " 'irods_encryption_key_size': 32,\n", " 'irods_encryption_num_hash_rounds': 16,\n", " 'irods_encryption_salt_size': 8,\n", " 'ssl_context': context}\n", "\n", "# Authentication\n", "with iRODSSession(\n", " host = host,\n", " port = port,\n", " user = user,\n", " password = password,\n", " zone = zone,\n", " **ssl_settings) as session:\n", " coll = session.collections.get(\"/unlock\")\n", " for col in coll.subcollections:\n", " print(col.path)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "vscode": { "languageId": "python" } }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }