Credentials and sensitive-data security
Controls secret acquisition, use, logging and revocation.
Overview
Credentials, tokens and keys should come from protected provisioning with least privilege, auditing and consumer-compatible rotation. Keep them out of source, URIs, errors and logs. Removing an exposed value from a file does not invalidate it: address revocation/rotation and existing copies. GetErrorMessage and user arrays can include sensitive values; log selected fields rather than whole structures. This example logs only a constant event/state and handles no secret. (Sources: refs. 1–2.)
Commented example
#Include "Protheus.ch"
User Function Ed645()
// Allowed fields only: no password, token, request body or user array.
Local cEvent := "ED645_STAGE"
Local cState := "OK"
ConOut(cEvent+" "+cState)
Return NilLogs a technical marker and OK. It supplies neither a secrets manager nor secure-memory-erasure guarantees. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Control log access/retention and test rotation without breaking consumers. Assigning Nil does not erase copies in logs, dumps or backups.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.