Skip to content

v0.8.0 — Bearer Tokens, Truncated Reads & Cross-Parent Addresses

Choose a tag to compare

@loookashow loookashow released this 10 Aug 09:21
· 16 commits to main since this release
e2bfe8d

Release notes:

This release adds bearer tokens for hosted MCP connectors, plumbs truncate_text through the search methods, and types the cross-parent read addresses of strict-reference collections. Everything below is available on both the sync and the async client.

Highlights

Bearer tokens

Hosted MCP connectors (the Claude API's mcp_servers, among others) accept a single token and always send it as Authorization: Bearer <token> — the scheme is not selectable, so Simple and Secure could not be used with them at all.

  • issue_flux_api_key_bearer_token(key) (sync + async) — issue or replace the token on an existing Flux API key.
  • revoke_flux_api_key_bearer_token(key) (sync + async) — revoke it.
  • New FluxAPIKeyBearerToken model for the one-time response.
  • FluxAPIKeySummary gains bearer_token_prefix and bearer_token_issued_at, both defaulting to None.
token = client.issue_flux_api_key_bearer_token("flux_key_v1")
# pass token.bearer_token to the connector — it is shown only once
client.revoke_flux_api_key_bearer_token("flux_key_v1")
  • The token identifies the key and nothing more: role, grants and per-collection permissions are the key's own.
  • The plaintext is returned only once. Only a hash is stored, as for secret_key — a lost token is re-issued, not recovered. Later reads expose only bearer_token_prefix (first 12 characters).
  • Issuing, re-issuing and revoking leave public_key, secret_key, role and grants untouched, so re-issuing cuts off a connector without disturbing anything using the key pair.
  • Requires a server with bearer-token support; against an older one both methods return 404.

truncate_text on reads

  • search() (sync + async) accepts a keyword-only params mapping, forwarded to the query string. With the existing passthrough on list_resources(), both List Resources and Search now support truncate_text — an integer ≥ 1 that caps every text-typed field, ignored when raw=True. Truncated fields are marked under _sys.truncated.
  • vector_search, vector_field_search, hybrid_search and boosted_search accept query_params.
  • Named query_params, not params: params was already meaningful inside **extra_body, so an explicit params keyword would have silently rerouted it to the query string for callers already passing it as a search-body field. Passing truncate_text as a body field now raises and names query_params.

Cross-parent read addresses

  • add_api_collection / update_api_collection — and the deprecated add_api_folder / update_api_folder — accept unscoped_levels: list[int] and unscoped_ancestors: list[str], exposing read-only addresses that drop the ancestor chain entirely (level == 0) or partially (level >= 1).
  • APIFolderSummary (aliased APICollectionSummary) gains unscoped_levels, unscoped_ancestors, expose_owner, flat_route and flat_routes, with new FlatRoute and FlatRouteSummary models.
  • These models now set extra="allow", so unrecognised fields are preserved rather than dropped.
  • The API requires unscoped_levels and unscoped_ancestors to be sent together; not enforced client-side, since the server owns that rule.

Fixed

  • DEFAULT_USER_AGENT was pinned to foxnose-sdk/0.1.0 regardless of the installed version, so every release reported 0.1.0. The version now lives in a single _version.py read by both foxnose_sdk.__version__ and config.py.

Breaking changes

  • None. The new APIFolderSummary fields carry defaults, so existing code is unaffected.

Install

pip install --upgrade foxnose-sdk