Table of Contents
Module spoon_ai.neofs
NeoFS integration for Spoon Core.
Module spoon_ai.neofs.utils
SignatureError Objects​
class SignatureError(Exception)
Raised when signature payload construction fails.
sign_bearer_token​
def sign_bearer_token(bearer_token: str,
private_key_wif: str,
*,
wallet_connect: bool = True) -> tuple[str, str]
Returns (signature_hex, compressed_pubkey_hex)
- wallet_connect=True: msg = WC format (with prefix/len/salt/postfix), hash=SHA-256 X-Bearer-Signature = <DER signature hex> + <16B salt hex> X-Bearer-Signature-Key = <compressed public key hex> URL needs to append ?walletConnect=true
Module spoon_ai.neofs.client
NeoFSClient Objects​
class NeoFSClient()
set_container_eacl​
def set_container_eacl(container_id: str,
eacl: Eacl,
*,
bearer_token: Optional[str] = None,
wallet_connect: bool = True) -> SuccessResponse
Set container eACL.
Arguments:
container_id- Container IDeacl- eACL objectbearer_token- Optional Bearer Token (recommended for eACL operations)wallet_connect- Whether to use wallet_connect mode (default True)
download_object_by_id​
def download_object_by_id(container_id: str,
object_id: str,
*,
bearer_token: Optional[str] = None,
download: bool | None = None,
range_header: str | None = None) -> httpx.Response
Download object by ID. Bearer token is optional for public containers.
get_object_header_by_id​
def get_object_header_by_id(container_id: str,
object_id: str,
*,
bearer_token: Optional[str] = None,
range_header: str | None = None) -> httpx.Response
Get object header by ID. Bearer token is optional for public containers.
download_object_by_attribute​
def download_object_by_attribute(
container_id: str,
attr_key: str,
attr_val: str,
*,
bearer_token: Optional[str] = None,
download: bool | None = None,
range_header: str | None = None) -> httpx.Response
Download object by attribute. Bearer token is optional for public containers.
get_object_header_by_attribute​
def get_object_header_by_attribute(
container_id: str,
attr_key: str,
attr_val: str,
*,
bearer_token: Optional[str] = None,
range_header: str | None = None) -> httpx.Response
Get object header by attribute. Bearer token is optional for public containers.
delete_object​
def delete_object(container_id: str,
object_id: str,
*,
bearer_token: Optional[str] = None) -> SuccessResponse
Delete object. Bearer token is optional for public containers, required for eACL containers with DENY DELETE rule.
search_objects​
def search_objects(container_id: str,
search_request: SearchRequest,
*,
bearer_token: Optional[str] = None,
cursor: str = "",
limit: int = 100) -> ObjectListV2
Search objects. Bearer token is optional for public containers.
NeoFSException Objects​
class NeoFSException(Exception)
Base exception for the NeoFS client.
NeoFSAPIException Objects​
class NeoFSAPIException(NeoFSException)
Raised when the API returns an error.
Module spoon_ai.neofs.models
Pydantic models describing NeoFS REST API payloads.
NetworkInfo Objects​
class NetworkInfo(BaseModel)
Describes network configuration fees reported by the gateway.