# stormshield/python-sns-api architecture

> Architecture diagram of the GitHub repository stormshield/python-sns-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stormshield/python-sns-api
- Repository: https://github.com/stormshield/python-sns-api

## Overview

python-SNS-API is a Python client and command-line tool for interacting with Stormshield Network Security appliances over their SSL API. Users connect with credentials or a client certificate, issue commands directly or from scripts, and receive parsed results; the CLI can display INI-style or XML output. The client also supports file transfer, certificate validation, and proxies. The graph reflects documented capabilities and visible imports/calls; unsampled implementation details are not expanded beyond those capabilities.

Main entry points: [`stormshield/sns/sslclient/__init__.py`](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py) (SSL client), [`stormshield/sns/cli.py`](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/cli.py) (snscli), [`stormshield/sns/configparser.py`](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/configparser.py) (Section parser), [`stormshield/sns/crc.py`](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/crc.py) (CRC verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line use"]
  node_cli["snscli<br/>[cli.py]"]
  node_completion["Command completion"]
end

subgraph group_client["API client"]
  node_client["SSL client<br/>[__init__.py]"]
  node_auth["Authentication<br/>[__init__.py]"]
  node_tls["TLS and proxy<br/>[__init__.py]"]
  node_commands["Command requests<br/>[__init__.py]"]
  node_filetransfer["File transfer<br/>[__init__.py]"]
end

subgraph group_results["Response handling"]
  node_response["Response conversion<br/>[__init__.py]"]
  node_parser["Section parser<br/>[configparser.py]"]
  node_crc["CRC verification<br/>[crc.py]"]
  node_version["Client version<br/>[__version__.py]"]
end

node_operator(("Operator"))
node_appliance{{"SNS appliance"}}
node_proxy{{"HTTP/SOCKS proxy"}}

node_operator -->|"runs commands"| node_cli
node_cli -->|"loads vocabulary"| node_completion
node_cli -->|"creates client"| node_client
node_cli -->|"sends commands"| node_client
node_client -->|"authenticates"| node_auth
node_client -->|"configures connection"| node_tls
node_client -->|"sends API requests"| node_appliance
node_commands -->|"requests commands"| node_appliance
node_client -->|"dispatches command"| node_commands
node_client -->|"handles transfers"| node_filetransfer
node_filetransfer -->|"uploads or downloads"| node_appliance
node_client -->|"builds response"| node_response
node_response -->|"parses output"| node_parser
node_client -->|"checks download CRC"| node_crc
node_cli -->|"renders output"| node_response
node_cli -->|"reports version"| node_version
node_tls -.->|"can route through"| node_proxy

click node_cli "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/cli.py"
click node_client "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py"
click node_auth "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py"
click node_tls "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py"
click node_commands "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py"
click node_filetransfer "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py"
click node_response "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py"
click node_parser "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/configparser.py"
click node_crc "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/crc.py"
click node_version "https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__version__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_completion toneBlue
class node_client,node_auth,node_tls,node_commands,node_filetransfer toneAmber
class node_response,node_parser,node_crc,node_version toneMint
class node_operator,node_appliance,node_proxy toneIndigo
```

## Components

### Command-line use

- [snscli](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/cli.py): `stormshield/sns/cli.py`
- **Command completion**

### API client

- [SSL client](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py): `stormshield/sns/sslclient/__init__.py`
- [Authentication](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py): `stormshield/sns/sslclient/__init__.py`
- [TLS and proxy](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py): `stormshield/sns/sslclient/__init__.py`
- [Command requests](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py): `stormshield/sns/sslclient/__init__.py`
- [File transfer](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py): `stormshield/sns/sslclient/__init__.py`

### Response handling

- [Response conversion](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__init__.py): `stormshield/sns/sslclient/__init__.py`
- [Section parser](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/configparser.py): `stormshield/sns/configparser.py`
- [CRC verification](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/crc.py): `stormshield/sns/crc.py`
- [Client version](https://github.com/stormshield/python-sns-api/blob/master/stormshield/sns/sslclient/__version__.py): `stormshield/sns/sslclient/__version__.py`

### Other components

- **Operator**
- **SNS appliance**
- **HTTP/SOCKS proxy**

## Connections

- Operator → snscli: runs commands (evidence: `README.md`)
- snscli → Command completion: loads vocabulary (evidence: `stormshield/sns/cli.py`)
- snscli → SSL client: creates client (evidence: `stormshield/sns/cli.py`)
- snscli → SSL client: sends commands (evidence: `stormshield/sns/cli.py`)
- SSL client → Authentication: authenticates (evidence: `stormshield/sns/sslclient/__init__.py`)
- SSL client → TLS and proxy: configures connection (evidence: `stormshield/sns/sslclient/__init__.py`)
- SSL client → SNS appliance: sends API requests (evidence: `stormshield/sns/sslclient/__init__.py`)
- Command requests → SNS appliance: requests commands (evidence: `stormshield/sns/sslclient/__init__.py`)
- SSL client → Command requests: dispatches command (evidence: `stormshield/sns/sslclient/__init__.py`)
- SSL client → File transfer: handles transfers (evidence: `README.md`)
- File transfer → SNS appliance: uploads or downloads (evidence: `README.md`)
- SSL client → Response conversion: builds response (evidence: `stormshield/sns/sslclient/__init__.py`)
- Response conversion → Section parser: parses output (evidence: `stormshield/sns/sslclient/__init__.py`)
- SSL client → CRC verification: checks download CRC (evidence: `stormshield/sns/sslclient/__init__.py`)
- snscli → Response conversion: renders output (evidence: `README.md`)
- snscli → Client version: reports version (evidence: `stormshield/sns/cli.py`)
- TLS and proxy → HTTP/SOCKS proxy: can route through (evidence: `README.md`)
