Java
Updated
dev.kryptic:krypticdev fetches your project's secrets and exposes them as system
properties (the JVM cannot modify its own process environment). Zero dependencies,
Java 17+. Outside development it is a no-op, and it never throws.
Install
<dependency>
<groupId>dev.kryptic</groupId>
<artifactId>krypticdev</artifactId>
<version>0.1.0</version>
</dependency>
Use
public static void main(String[] args) {
Kryptic.inject(); // before the framework boots
var dbUrl = System.getProperty("DATABASE_URL");
}
For frameworks that want a map instead of system properties, use Kryptic.fetch():
Map<String, String> secrets = Kryptic.fetch();
Behavior
- No-op when
SPRING_PROFILES_ACTIVE/APP_ENV/ENVIRONMENT/ENVindicates production or staging, or whenKRYPTIC_DISABLED=true. - Finds
kryptic.jsonby walking up from the working directory. - Never overwrites system properties or environment variables that are already set.
- macOS/Linux via unix domain socket channels, Windows via named pipe.
Environment variables (or system properties with the same names) override everything:
KRYPTIC_PROJECT_ID, KRYPTIC_ENV, KRYPTIC_SOCKET_PATH, KRYPTIC_TIMEOUT_MS,
KRYPTIC_DISABLED, KRYPTIC_SILENT.