Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# TeaQL Java

## Sensitive log data

Runtime diagnostic logs redact payload values by default, before delivery to
file, console, buffers, or custom logging sinks. Selecting a diagnostic sink
alone does not authorize plaintext. For controlled troubleshooting only:

```bash
export TEAQL_ALLOW_SENSITIVE_PLAINTEXT_LOGS=I_UNDERSTAND_SENSITIVE_DATA_MAY_BE_WRITTEN_TO_DISK
```

Only this exact value enables plaintext permission; empty values, `true`, and
whitespace variants do not. Enabling it emits a warning. Credential-classified
fields remain redacted. The flag does not force every sink to expose values.
SQL without reliable field/literal provenance may be suppressed and marked
`NOT REPLAYABLE`. Execution parameters and persisted business data are unchanged.

Do not put sensitive data in free-text comments or purpose declarations.
TeaQL cannot govern arbitrary application prints or independent driver loggers;
configure those separately. This setting does not erase older plaintext files.
Restrict access and retention when using plaintext diagnostics, then unset the
variable and restart processes when troubleshooting is complete.

[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13612/badge)](https://www.bestpractices.dev/projects/13612)

TeaQL Java is the Java runtime for TeaQL domain applications. It provides a
Expand Down
2 changes: 1 addition & 1 deletion examples/business-id-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>teaql-business-id-example</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/conformance/lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<properties>
<java.version>21</java.version>
<spring-boot.version>4.1.1</spring-boot.version>
<teaql.version>1.550-RELEASE</teaql.version>
<teaql.version>1.551-RELEASE</teaql.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.parameters>true</maven.compiler.parameters>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion examples/conformance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<libversion>1.0.0</libversion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.parameters>true</maven.compiler.parameters>
<teaql.version>1.550-RELEASE</teaql.version>
<teaql.version>1.551-RELEASE</teaql.version>
</properties>

<repositories>
Expand Down
2 changes: 1 addition & 1 deletion examples/order-management/java-app-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<properties>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<teaql.version>1.550-RELEASE</teaql.version>
<teaql.version>1.551-RELEASE</teaql.version>
</properties>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion examples/order-management/java-lib-core/lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<properties>
<java.version>21</java.version>
<spring-boot.version>4.1.1</spring-boot.version>
<teaql.version>1.550-RELEASE</teaql.version>
<teaql.version>1.551-RELEASE</teaql.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.parameters>true</maven.compiler.parameters>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion examples/round-trip-reference-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>teaql-round-trip-reference-example</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/school-management/lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<properties>
<java.version>21</java.version>
<spring-boot.version>4.1.1</spring-boot.version>
<teaql.version>1.550-RELEASE</teaql.version>
<teaql.version>1.551-RELEASE</teaql.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.parameters>true</maven.compiler.parameters>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion examples/school-management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<libversion>0.0.1-SNAPSHOT</libversion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.parameters>true</maven.compiler.parameters>
<teaql.version>1.550-RELEASE</teaql.version>
<teaql.version>1.551-RELEASE</teaql.version>
</properties>

<repositories>
Expand Down
2 changes: 1 addition & 1 deletion examples/security-foundations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>teaql-security-foundations-example</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<packaging>pom</packaging>

<name>teaql-java-parent</name>
Expand Down
34 changes: 34 additions & 0 deletions releases/1.551-RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 1.551-RELEASE: default log privacy

Tracking: https://github.com/teaql/teaql-java/issues/184
Cross-runtime contract: https://github.com/teaql/teaql-conformance/issues/58

## Behavior and migration

Runtime-controlled SQL and audit logging now redact sensitive payloads before
normal, custom, buffered and file destinations. Execution values are unchanged.
Selecting a diagnostic sink alone no longer authorizes plaintext output.

For intentional plaintext debugging only, set this exact acknowledgement:

```sh
export TEAQL_ALLOW_SENSITIVE_PLAINTEXT_LOGS=I_UNDERSTAND_SENSITIVE_DATA_MAY_BE_WRITTEN_TO_DISK
```

Invalid, empty or truthy shortcut values do not enable it. Enabling it emits a
value-free warning. Credential-classified fields remain hidden. The switch grants
permission; it does not force every sink to reveal values. Restart after changing
the environment. Previously written files are not erased.

Without reliable parameter/field provenance, SQL logs use conservative redaction;
SQL may be labeled non-replayable. Operations, timing and safe intent remain.
Do not put unrelated secrets in comments/purpose, or print raw business events.
Arbitrary application and third-party driver logs are outside this boundary.

## Verification

Local runtime tests and `bash scripts/verify-examples.sh` passed before release
preparation. Retained real SQLite CRUD/failure canaries assert unchanged persisted
values and absence of sensitive markers in runtime log destinations. Exact/invalid
environment gates and credential behavior have separate regression fixtures.
Published-package verification is a separate gate, not implied by local results.
2 changes: 1 addition & 1 deletion teaql-android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>

<artifactId>teaql-android</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion teaql-business-id-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-cloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-cloud</artifactId>
<name>teaql-cloud</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-context-runtime-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>

<artifactId>teaql-context-runtime-tools</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion teaql-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-data-service-sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-db2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-db2</artifactId>
<name>teaql-db2</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-dm8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-dm8</artifactId>
<name>teaql-dm8</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-duckdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-duckdb</artifactId>
<name>teaql-duckdb</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-dynamic-fields-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-dynamic-fields-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-hana/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-hana</artifactId>
<name>teaql-hana</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>

<artifactId>teaql-jackson</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion teaql-mssql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-mssql</artifactId>
<name>teaql-mssql</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>

<artifactId>teaql-mysql</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion teaql-opentelemetry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>

<artifactId>teaql-opentelemetry</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion teaql-oracle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-oracle</artifactId>
<name>teaql-oracle</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-postgres/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>
<artifactId>teaql-postgres</artifactId>
<name>teaql-postgres</name>
Expand Down
2 changes: 1 addition & 1 deletion teaql-provider-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-provider-spring-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-query-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>

<artifactId>teaql-query-json</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion teaql-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion teaql-runtime-log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.teaql</groupId>
<artifactId>teaql-java-parent</artifactId>
<version>1.550-RELEASE</version>
<version>1.551-RELEASE</version>
</parent>

<artifactId>teaql-runtime-log</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ private String formatTraceChain(List<TraceNode> traceChain) {

@Override
public String formatExecutionLog(io.teaql.core.ExecutionMetadata metadata) {
metadata = io.teaql.runtime.LogPrivacy.sql(metadata, io.teaql.runtime.LogPrivacy.plaintextEnabled());
String ts = LocalDateTime.now().format(TS_FORMATTER);
String traceStr = formatTraceChain(metadata.getTraceChain());
String traceDisplay = traceStr.isEmpty() ? "" : " - [" + traceStr + "]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ private String escapeJson(String text) {

@Override
public String formatExecutionLog(io.teaql.core.ExecutionMetadata metadata) {
metadata = io.teaql.runtime.LogPrivacy.sql(metadata, io.teaql.runtime.LogPrivacy.plaintextEnabled());
String execution = String.format("{\"type\":\"EXEC_LOG\",\"tracePath\":%s,\"backend\":\"%s\",\"operation\":\"%s\",\"comment\":\"%s\",\"purpose\":\"%s\",\"auditReason\":\"%s\",\"elapsedUs\":%d,\"resultCount\":%s,\"affectedRows\":%s,\"summary\":\"%s\",\"parameterizedSQL\":\"%s\"",
formatTraceChain(metadata.getTraceChain()),
escapeJson(metadata.getBackend()),
Expand Down
Loading
Loading