CruxExperts/LocalSetup / ls/skills/ls-backblaze-b2-storage
ls-backblaze-b2-storage
VerifiedSafely plan and execute Backblaze B2 S3-compatible storage operations and B2 native bucket, key, and notification administration.
scripts/lib/ls_backblaze/native_permissions.py
View on GitHub"""Capability checks from the explicit B2 authorization response."""
from __future__ import annotations
from typing import Any
from .reporting import ToolError
REQUIRED = {"ListBuckets": "listBuckets", "CreateBucket": "writeBuckets", "UpdateBucket": "writeBuckets", "DeleteBucket": "deleteBuckets", "ListKeys": "listKeys", "CreateKey": "writeKeys", "DeleteKey": "deleteKeys", "GetNotificationRules": "readBucketNotifications", "SetNotificationRules": "writeBucketNotifications"}
def allowed(auth: dict[str, Any]) -> dict[str, Any]:
storage = auth.get("apiInfo", {}).get("storageApi", {})
value = storage.get("allowed", auth.get("allowed"))
if not isinstance(value, dict) or not isinstance(value.get("capabilities"), list) or any(not isinstance(item, str) for item in value["capabilities"]):
raise ToolError("malformed_response", "authorization response omitted capability information", "service")
return value
def check(name: str, args: dict[str, Any], auth: dict[str, Any]) -> None:
capabilities = set(allowed(auth)["capabilities"])
required = {REQUIRED[name]}
if "default_server_side_encryption" in args:
required.add("writeBucketEncryption")
if "default_retention" in args or args.get("file_lock_enabled"):
required.add("writeBucketRetentions")
if not required <= capabilities:
raise ToolError("capability_missing", "selected key lacks required capability: " + ", ".join(sorted(required - capabilities)), "policy")
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |