authorjapps/zerocode

Removal of `masked tokens` feature from main

Open

#789 opened on Aug 16, 2026

 (1 comment) (0 reactions) (0 assignees)Java (447 forks)auto 404
good first issue

Repository metrics

Stars
 (1,010 stars)
PR merge metrics
 (Avg merge 1d 4h) (1 merged PR in 30d)

Description

Background

The repository currently implements a "masked tokens" feature using the ${MASKED:...} runtime token. Implementation details are below: codebase:

  • ZeroCodeValueTokens.java

    • Defines the token and masked replacement: MASKED = "MASKED:" and MASKED_STR = "masked".
    • MASKED is included in the known tokens list.
  • TokenUtils.java

    • Implements two helpers:
      • getMasksReplaced(String) — replaces ${MASKED:secret} with "masked".
      • getMasksRemoved(String) — removes the wrapper and leaves the inner content ("secret").
    • Token parsing and token-resolution codebase already handles other tokens; MASKED-specific logic lives here.
    • Unit tests in core/src/test/java/org/jsmart/zerocode/core/utils/TokenUtilsTest.java validate masked behavior (multiple occurrences, special chars, empty string, removal vs replacement).
  • Uses

    • core/src/main/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeAssertionsProcessorImpl.java
      • Calls getMasksRemoved and getMasksReplaced through the fieldMasksRemoved/fieldMasksApplied methods.
    • core/src/main/java/org/jsmart/zerocode/core/logbuilder/ZerocodeCorrelationshipLogger.java
      • Calls getMasksReplaced when preparing assertion strings for logs.
    • Tests exist verifying masking behavior.

Why remove

  • The original issue to implement masked tokens doesn't conform to the code and should be removed from main. Removing it means token handling, constants, helper methods, usages and tests must be removed (or reverted if introduced in a single PR) and the project should remain functional with CI green.

This is an unwanted(also unused) feature which was implemented and merged to main.

AC1:

  • Just find the PR and revert it(if it's just one PR). Otherwise identify the changes in the code and remove the feature(e.g. changes in classes, tests etc) via a new PR

AC2:

  • Make sure none other existing features are broken, CI is green as always

Contributor guide