How mscno/esec works
Project Type and Purpose
• This is a Go-based full-stack project combining:
• A CLI tool/library (cmd/esec, pkg/...) for local encryption/decryption and “run” workflows.
• An API server (cmd/esec-server, server/...) exposing gRPC/Connect endpoints for remote secret management (“cloud” commands).
• A shared Go library (pkg/*) providing core crypto, file-format parsing, client utilities, and keyring handling.
File Structure Analysis
• Top-level executables:
• cmd/esec – CLI entrypoint with subcommands under commands/.
• cmd/esec-server – HTTP/Connect server that implements the backend.
• Shared library code (pkg/*):
• pkg/crypto – encryption/decryption routines.
• pkg/fileutils, pkg/format, pkg/json, pkg/keyring – file parsing and format handling.
• pkg/auth, pkg/client – GitHub auth and gRPC client.
• Server side (server/):
• server/proto & gen/proto – .proto definitions and generated Go code.
• server/connect_server.go & server/server.go – setup of gRPC/Connect handlers.
• server/middleware – auth, CORS, logging, rate limiting.
• server/stores – implementations of data stores (BoltDB, memory) for users, organizations, projects.
• Configuration & Deployment:
• GitHub workflows, GoReleaser for CLI and server releases.
• .esec-keyring, environment variables for key lookup.
Essential Elements
• Clearly separate local-only (encrypt/decrypt) vs remote (cloud) functionality.
• Middleware layers in server pipeline.
• Lookup hierarchy (env vars → keyring file).
• File-format modules (.ejson, .env) and their parser/encryptor.