Envsitter Guard Plugin
.env file protection for OpenSIN CLI.
Overview
Blocks access to sensitive environment files while allowing safe key listing via fingerprinting.
Installation
bash
npm install @opensin/plugin-envsitterUsage
typescript
import { EnvsitterPlugin, protectEnvFiles, listEnvKeys } from '@opensin/plugin-envsitter';
const plugin = new EnvsitterPlugin();
const result = plugin.check('/path/to/.env');
if (result.blocked) console.log(result.reason);
const keys = plugin.listKeys('/path/to/.env');
keys.forEach(k => console.log(`${k.key}: ${k.fingerprint}`));API
protectEnvFiles(filePath, config): ProtectionResult
Check if file access should be blocked.
listEnvKeys(envFilePath): EnvKeyInfo[]
List .env keys without exposing values (SHA-256 fingerprint only).
EnvsitterPlugin
Class with check(), listKeys(), getConfig(), setConfig() methods.
Testing
bash
npm test
# 16 tests passing