Metadata-Version: 2.4
Name: abstract_security
Version: 0.82
Summary: Env-driven secrets loading and security primitives: .env resolution, password hashing, and JWT token utilities.
Home-page: https://github.com/AbstractEndeavors/abstract_security
Author: putkoff
Author-email: partners@abstractendeavors.com
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Typing :: Typed
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: python-dotenv
Requires-Dist: bcrypt
Requires-Dist: PyJWT
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# abstract_security

**Env-driven secrets loading and security primitives: `.env` resolution,
password hashing, token utilities, and a library of type/path/ssh helpers.**

`abstract_security` is the foundation layer of the **Abstract Secure Backend**
stack. Everything else builds on it for locating `.env` files, reading secrets,
hashing passwords, and issuing/validating tokens.

---

## Where this fits

```
abstract-securefiles   React/TypeScript UI components
abstract_logins        Flask blueprints: auth + secure files
abstract_queries       Domain query managers (users, uploads, ...)
abstract_database      Lazy PostgreSQL connection + helpers
abstract_security  <-- you are here: env loading, hashing, tokens, utilities
```

Dependencies flow downward; this layer depends only on `abstract_utilities` and
`python-dotenv`.

---

## Install

```bash
pip install abstract_security
```

Requires Python ≥ 3.6.

---

## Usage

```python
from abstract_security import get_env_value, get_env_path

# Resolve a value from a .env file, searching sensible default locations
# (cwd, home, and ~/.envy_all) unless an explicit path is given.
db_url = get_env_value("ABSTRACT_DATABASE_URL")
env_file = get_env_path()            # where the .env was found
```

It also exposes password/token helpers (bcrypt hashing, JWT) and a broad set of
utility modules (`type_utils`, `path_utils`, `ssh_utils`, `string_utils`,
`compare_utils`, …) shared across the stack.

---

## Design notes

- **Flexible `.env` discovery** — looks in the current working directory, the
  home directory, and a dedicated `~/.envy_all` directory, or an explicit path.
- **One definition per symbol** — shared primitives like `SingletonMeta` are
  defined once, so behaviour is predictable across the stack.

---

## License

MIT.
