Session token validation, multi-instance support, and project metadata - #3
Open
biterik wants to merge 1 commit into
Open
Session token validation, multi-instance support, and project metadata#3biterik wants to merge 1 commit into
biterik wants to merge 1 commit into
Conversation
…adata Token validation - Validate the personal access token on first use in a session; on an expired/invalid token (or failed password login), raise OpenbisAuthError carrying step-by-step instructions for creating a new token and where to store it. New check_authentication tool surfaces this proactively (checks all instances, or a named one). Multiple instances - Support several openBIS servers via OPENBIS_<NAME>_* env vars (incl. _TOKEN_FILE) with a ConnectionManager; every openBIS tool gains an optional `instance` argument, plus a new list_instances tool. The bare OPENBIS_* form still defines a "default" instance, so existing setups are unchanged. Project metadata - Fill in the licensing the LICENSE file already declared: license = MPL-2.0 in pyproject, MPL classifier, SPDX/author headers on all source files, and a README License section (replacing the stale "currently unlicensed" note). - Update authors (Erik Bitzek <e.bitzek@mpi-susmat.de>, Niklas Siemer). - Add CITATION.cff (incl. DFG funding) and README Authors/Citation/Funding sections; document the new tools, `instance` arg, and multi-instance config in README and .env.example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates work that was built on the original scaffold onto the current
main. Three themes:1. Token validation + actionable help (the original ask)
OpenbisClient.connect(), which caches — so it runs once and adds no per-call overhead).OpenbisAuthErrorwhose message contains step-by-step instructions for creating a new token in the openBIS web UI and where to store it (.env, MCP clientenvblock, or*_TOKEN_FILE).check_authenticationtool surfaces this proactively — checks all configured instances, or a named one.2. Multiple openBIS instances
OPENBIS_<NAME>_*prefix (supports_TOKEN,_TOKEN_FILE,_USERNAME,_PASSWORD,_VERIFY_CERTIFICATES).ConnectionManagerowns one lazy client per instance; every openBIS tool gains an optionalinstanceargument, plus a newlist_instancestool.OPENBIS_*vars define adefaultinstance, so existing single-server setups need no changes.3. Project metadata (completes the licensing the repo already started)
The MPL-2.0
LICENSEfile already exists, butpyproject.tomlstill had the old author / no license field and the README said "currently unlicensed". This PR makes it consistent:license = { file = "LICENSE" }+ MPL classifier inpyproject.toml; SPDX/author headers on all source files.e.bitzek@mpi-susmat.de) and Niklas Siemer.CITATION.cff(includes DFG funding acknowledgement); README Authors / Citation / License / Funding sections..env.exampledocument the new tools, theinstanceargument, and multi-instance configuration.Testing
pytest: 32 passed, 1 failed — the one failure (test_s3_get_file_metadata) is pre-existing and environmental (xxhashfrom the optional[s3]extra is not installed); it is unrelated to this diff (our only change tos3_support.pyis the license header).check_authentication.Notes for review
instanceis appended as a trailing optional parameter on each tool, so existing tool calls are unaffected.LICENSEfile onmainis untouched.🤖 Generated with Claude Code