Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

nimbus-backend

БесплатноБез исполняемых скриптовНе проверен

Use when writing or modifying Python code in the Girder backend plugin (devops/girder/plugins/AnnotationPlugin/), creating REST API endpoints, writing…

arjunrajlaboratoryот arjunrajlaboratory★ 22 звезды на GitHub

Об этом скилле

Nimbus Backend Development (Girder)

Access Control

Access Levels (Document-Level)

Value Constant Meaning
-1 (none) No access / Remove access
0 AccessType.READ View-only access
1 AccessType.WRITE Edit access
2 AccessType.ADMIN Owner — can manage access (share, set public, delete)

Important: AccessType.ADMIN means owner of that document, not a site-wide admin. The creator of a project/dataset gets ADMIN on it and can share it with others.

Removing access: the share endpoints take -1 on the wire, but Girder's setUserAccess(doc, user, level) deletes the entry only when level is None. Pass -1 and Girder stores an inert {id, level: -1} entry: the user can't read anything, yet still shows up in access lists. Convert at the API boundary with parseShareAccessType() (server/helpers/access_helpers.py). A test that checks only "user can no longer read" passes with the bug present, so assert the user has no entry in doc['access']['users'].

Access Decorators (Endpoint-Level)

from girder.api import access

@access.public      # Anyone can access
@access.user        # Requires authenticated user
@access.admin       # Requires site-wide Girder admin (NOT document owner)

Note: @access.admin (decorator) and AccessType.ADMIN (document level) are different. The decorator requires site-wide admin; the access level means document owner.

Model-Level Access

from girder.constants import AccessType

doc = Model().load(id, user=user, level=AccessType.WRITE, exc=True)
doc = Model().load(id, force=True)  # Admin bypass

For detailed access patterns including sharing: read references/access-control-patterns.md When modifying sharing/access code: read codebaseDocumentation/SHARING.md

An optional dataset filter is an optional access check

List endpoints that check READ on the datasetId they filter by must require it, and must parse it unconditionally. annotation_property_values find checked access only if "datasetId" in params, so omitting it dropped both the filter and the check. annotation_connection find required the parameter but checked only when it was truthy, so datasetId= did the same. Either way an anonymous caller could list every dataset's values or connections. Parse with requireObjectId(params.get(...)) (missing or empty → 400), then Folder().load(..., exc=True), then build the query from that id. Test anonymously, against a private dataset, with whichever input bypassed the check: missing for property values (testFindPropertyValuesRequiresDatasetId), empty for connections (testFindConnectionsWithEmptyDatasetIdDenied).

Ids that match nothing get no access check

Bulk endpoints usually check access on the datasets of the documents an id list resolves to (distinctDatasetIds → requireDatasetsAccess). An id that matches no document resolves to no dataset, so nothing about it is checked. That is harmless only if nothing downstream acts on the raw id. The bulk-delete cleanup cascade did: it removed connections and property values pointing at the id in any dataset. Leftover orphans in other users' datasets could therefore be deleted by naming their dangling ids. Anything that fans out from caller-supplied ids (cascades, events, follow-up queries keyed on the id rather than the loaded document) must run only for ids that resolved to a document the caller was checked against. Annotation.multipleAnnotationsRemovedEvent filters to existing annotations before triggering cleanup (#1418, Codex P2).

Never return a document that carries access raw

findWithPermissions and @loadmodel decide which documents a caller sees. Neither decides which fields they see. Any plugin model built on AccessControlledModel (every ProxiedModel) stores an access ACL that lists every collaborator's user id, and GET user/{id} turns those ids into names. When a model defines no exposeFields, returning its raw doc hands that list to every reader, anonymous viewers of public datasets included. This has happened with dataset views, properties, worker interfaces and previews, and with the JSON export and Zenodo archive, which embed docs without going through any endpoint.

  • Give the model CLIENT_FIELDS and exposeFields(level=READ, fields=("_id",) + CLIENT_FIELDS) in initialize(), and put @filtermodel(model=...) on every endpoint that returns its docs (get, find/list, create, update).
  • For exports, which bypass filter(), use a fields= projection (AnnotationProperty.findClientFields).
  • Treat the write side as the twin: a create or update that stores the raw body lets the caller set access or public. Allow-list the body with filterUpdateFields(requireObjectBody(...)).
  • filter() adds _accessLevel, computed from the doc's own ACL. If that ACL is not what grants reads (properties are read throu
Полный SKILL.md на GitHub

Установить nimbus-backend в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/access-control-patterns.mdreferences/database-query-patterns.mdreferences/testing-patterns.md

FAQ

Что делает скилл nimbus-backend?

Use when writing or modifying Python code in the Girder backend plugin (devops/girder/plugins/AnnotationPlugin/), creating REST API endpoints, writing database queries with MongoDB, implementing access control and sharing, running backend tests with tox/pytest, or debugging Docker compose services. Covers: API vs model layer separation (API raises RestException, models raise ValueError — never mix these), API endpoint patterns (@autoDescribeRoute, modelParam), access control (AccessType, setUserAccess, setPublic, permission escalation risks), database queries (Model.find not collection.find, batch $in queries not loops), model loading (exc=True not manual null checks), error handling (catch specific exceptions, never except Exception), public endpoint input validation (inline isinstance guards → RestException 400, MAX_* clamps, bson InvalidId → 400), loading plugin changes into the running container (rebuild, not restart), and backend test patterns. Use this skill even for small backend changes.

Как установить скилл nimbus-backend?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл nimbus-backend запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить nimbus-backend с