Releases: KeyNetra/keynetra
Releases · KeyNetra/keynetra
KeyNetra v0.1.1
PR: KeyNetra v0.1.1 Initial Release Hardening (Headless-First, API+CLI+Embedded)
Summary
This PR finalizes KeyNetra v0.1.1 as a production-ready, headless authorization platform that
works in three modes without UI dependency:
- HTTP Server mode
- CLI mode
- Embedded Python engine mode
It also standardizes config-driven startup, policy/model file loading, admin login flow, Docker
runtime behavior, and terminal startup/log UX.
Why
To ensure KeyNetra can be operated in real environments where UI may not exist and can be integrated
into backend systems directly with stable API/CLI/embedded interfaces.
Scope
1) Headless engine and embedded usage
- Added/validated direct embedded facade:
from keynetra import KeyNetraKeyNetra.from_config(...)load_policies(...)load_model(...)check_access(...)
- Ensured pure engine remains usable directly:
from keynetra.engine import KeyNetraEngine
Files
keynetra/__init__.pykeynetra/headless.pykeynetra/engine/__init__.pykeynetra/engine/keynetra_engine.py
2) Config file loader (YAML/JSON/TOML)
- Implemented config loader and env mapping for file-driven operation.
- Supports database, redis, policy paths, model paths, seed flag, server host/port.
- CLI supports global
--configflow.
Files
keynetra/config/config_loader.pykeynetra/config/settings.pykeynetra/cli.py
3) Policy/model file support
- Policy file loading support for:
.yaml/.yml.json.polar
- Authorization model loading support for:
.yaml/.yml.json.toml- raw schema files
- Startup bootstrap loads file-backed policies/models when configured.
Files
keynetra/config/file_loaders.pykeynetra/api/main.py
4) CLI extensions for headless operation
- Added/validated commands:
servestart(compat alias)checksimulateimpactcompile-policiesdoctorversionhelp-cliadmin-login- ACL + model subcommands
- Config file handling integrated across commands.
Files
keynetra/cli.pykeynetra/version.py
5) Admin login (username/password)
- Added admin token issuance endpoint:
POST /admin/login
- Validates configured
KEYNETRA_ADMIN_USERNAME+KEYNETRA_ADMIN_PASSWORD - Returns JWT with admin role claims for management APIs.
Files
keynetra/api/routes/admin_auth.pykeynetra/config/admin_auth.pykeynetra/config/settings.pycontracts/openapi/keynetra-v0.1.1.yaml(parity update)
6) Startup terminal UX + colored logs
- Added startup dashboard rendering with
pyfiglet(slant) + Rich layout. - Added mode/config/runtime/security/storage info in startup output.
- Enabled rich-colored logs with env controls:
KEYNETRA_LOG_FORMAT=richKEYNETRA_FORCE_COLOR=1
- Added warning suppression for Pydantic non-fatal schema field shadowing noise in CLI startup.
Files
keynetra/cli.pykeynetra/infrastructure/logging.py
7) Docker runtime and compose modernization
- Standardized v0 compose setup (no legacy split).
- Added/updated:
docker-compose.yml(main stack)docker-compose.dev.yml(dev stack)
- Docker startup script now:
- runs migrations (optional)
- renders startup screen in container too
- enables rich/color logs by default
- starts uvicorn workers
Files
docker-compose.ymldocker-compose.dev.ymlDockerfileinfra/docker/start.sh.env.example
8) Examples and operational config
- Added/updated example configs and sample policy/model files for config-driven and embedded usage.
Files
examples/keynetra.yamlexamples/auth-model.yamlexamples/policies/*examples/policy_tests.yaml
API Changes
Added
POST /admin/login
Confirmed available
POST /check-accessPOST /check-access-batchPOST /simulatePOST /simulate-policyPOST /impact-analysisPOST /auth-modelGET /auth-modelPOST /aclGET /acl/{resource_type}/{resource_id}DELETE /acl/{acl_id}GET /metricsGET /healthGET /health/liveGET /health/ready
Backward Compatibility
startcommand retained as alias forserve.- Existing API and layered architecture preserved.
- No UI dependency introduced; UI remains optional.
- No breaking schema behavior intended for existing consumers.
Risk Assessment
Low/medium risk areas
- CLI startup rendering and logging behavior
- Docker startup UX path and worker startup semantics
- Admin login credential handling configuration
Mitigations
- Defaults remain safe and env-driven.
- Fallback logging path remains JSON if Rich unavailable.
- Admin login can be disabled by unsetting admin credentials.
- OpenAPI parity update included for new route visibility.
Validation Performed
- Route and command surfaces verified in code.
- OpenAPI contract updated for
/admin/login. - Headless config/policy/model loading paths validated at code level.
- Docker startup path includes startup screen + color log enablement.
Release Checklist (v0.1.1)
- Version aligned (
pyproject.toml,keynetra/version.py, OpenAPI info) - Headless operation (API, CLI, embedded)
- Config-driven startup (YAML/JSON/TOML)
- Policy/model file loaders wired
- Admin login route implemented and documented in contract
- Docker main + dev compose available
- Startup UX and colored logging enabled