How to properly read parameters from the yamcs.$project.yaml configuration

27 views
Skip to first unread message

Patrick Dohmen

unread,
Jan 11, 2026, 5:46:22 AMJan 11
to yamcs
Hello group,

I am struggling while trying to read the configuration of the parameters to my CommandPostProcessor.

Trying to read the following does not work:

// Load secret key from configuration
if (config.containsKey("secretKey")) {
this.secretKey = config.getString("secretKey");
} else {
// Consider loading from environment variable as a more secure alternative
this.secretKey = System.getenv("YAMCS_HMAC_SECRET_KEY");
if (this.secretKey == null) {
throw new IllegalArgumentException(
"HMAC secret key must be provided via 'secretKey' config or YAMCS_HMAC_SECRET_KEY environment variable");
}
}

The configuration is as follows:

virtualChannels:
- vcId: 0 # VCID_MANAGEMENT
service: "PACKET"
commandPostprocessorClassName: com.erminaz.MyCommandPostprocessor
#commandPostprocessorArgs:
args:
secretKey: "your-base64-secret-key"
algorithm: "HmacSHA256"
#hmacLength: 16 # Optional: truncate to 16 bytes

I've just attached to most interesting parts for readability, if you're suggesting that the mistake I am doing is somewhere else in those files I can link to a repository.

Best regards,
Patrick, DL4PD

fabia...@spaceapplications.com

unread,
Jan 12, 2026, 5:15:02 AMJan 12
to yamcs
Configuration options for a postprocessor would need to be provided with commandPostprocessorArgs (commented out in your picture)

Patrick Dohmen

unread,
Jan 12, 2026, 6:57:57 AMJan 12
to yamcs
Neither of both approaches did work, that's why I left the commented regions.
Could you give an example on how this should work?

Thanks for having a look!

Patrick Dohmen

unread,
Jan 12, 2026, 11:55:12 AMJan 12
to yamcs
Finally:
It was an indentation error in the map...

Geez...

Thanks for your efforts!

fabia...@spaceapplications.com schrieb am Montag, 12. Januar 2026 um 11:15:02 UTC+1:
Reply all
Reply to author
Forward
0 new messages