Skip to main content

A tool for adding items to the inhibition list via API

Project description

inhibitor_tool

📌 Introduction

inhibitor_tool is a Python CLI tool that allows users to send, remove, and list inhibition requests via an API.
It supports authentication through environment variables loaded from auth_token.


🛠 Installation

You can install the package using pip:

pip3 install inhibitor_tool

🔧 Configuration

1️⃣ Set Up Authentication

Before using inhibitor_tool, you must configure authentication credentials in ~/.auth_token and load them into the environment:

echo 'export USERNAME="mmwei3"' >> ~/.auth_token
echo 'export PASSWORD="mmwei3password"' >> ~/.auth_token
echo 'export LOGIN_URL="https://auth.example.com/token"' >> ~/.auth_token
echo 'export INHIBIT_URL="https://inhibitor.example.com/add"' >> ~/.auth_token
echo 'export REMOVE_URL="https://inhibitor.example.com/remove"' >> ~/.auth_token
echo 'export LIST_URL="https://inhibitor.example.com/list"' >> ~/.auth_token

source ~/.auth_token

💡 Important: The source ~/.auth_token command must be executed every time a new session is started.


🚀 Usage

2️⃣ Inhibit an Item (Default TTL: 3 hours)

inhibitor-tool add --content "MaliciousIP:192.168.1.1"

3️⃣ Specify a Custom TTL

inhibitor-tool add --content "MaliciousIP:192.168.1.1" --ttl 6
  • --ttl 6 means the inhibition will last 6 hours (default is 3 hours).

4️⃣ Add a Custom Remark

inhibitor-tool add --content "MaliciousIP:192.168.1.1" --ttl 6 --remark "Security alert"
  • The remark helps track the reason for inhibition.
  • If omitted, it defaults to "tmp_inhibitor".

5️⃣ Remove an Inhibition

inhibitor-tool remove --content "MaliciousIP:192.168.1.1"
  • This command removes an inhibition entry matching the provided content.

6️⃣ List Active Inhibitions

inhibitor-tool list
  • Displays active inhibitions in a shell-friendly table format.

🔹 JSON Output Format

inhibitor-tool list --json
  • Outputs inhibition data in JSON format, suitable for scripting.

7️⃣ Check Version

inhibitor-tool --version
inhibitor-tool -V

📜 Open-Source Information

  • Author: mmwei3
  • Email: mmwei3@iflytek.com
  • Contact: 178555350258
  • Date: 2025-03-19
  • License: MIT License

📦 Packaging & Deployment

8️⃣ Build the Package

python setup.py sdist bdist_wheel

9️⃣ Install from Local Package

pip3 install dist/inhibitor_tool-1.0.0-py3-none-any.whl

🔟 Uninstall the Package

pip3 uninstall inhibitor_tool

📜 License (MIT)

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

📌 Dependencies (requirements.txt)

requests

This README.md provides a clear, structured, and fully configurable CLI tool for API-based inhibition with authentication, deletion support, and pip installation. 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inhibitor_tool-3.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inhibitor_tool-3.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file inhibitor_tool-3.2.0.tar.gz.

File metadata

  • Download URL: inhibitor_tool-3.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for inhibitor_tool-3.2.0.tar.gz
Algorithm Hash digest
SHA256 6020cb7dd2fe78aeddb86ba1318af139cc5e3fcc2d19da8282cedb90db4cb4fb
MD5 92323780e1e56f46fd11adef386b02c2
BLAKE2b-256 dfe5e5a5e0e085e9661075f15a2a6c4114cc21677e5bbe2ff0a9196d5e4a7a2b

See more details on using hashes here.

File details

Details for the file inhibitor_tool-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: inhibitor_tool-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for inhibitor_tool-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79298048550664e2083a85811b335a463e7df7f970c96198c6411a51c0b9abac
MD5 2f54ed140c7c999b743e1ddf90582f07
BLAKE2b-256 74141f17bbddc1a0b0462d620e2c5a0f3e7e703a12844513f5a43d64892df19a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page