This project provides a command-line tool for generating Mekari HMAC authentication headers and performing API requests to Mekari services.
The tool is written in Node.js and compiled into a standalone Windows
executable using pkg. It is designed to be called from systems that
cannot easily generate HMAC signatures, such as Progress OpenEdge 10.2.
Progress OpenEdge 10.2 does not provide built-in support for HMAC SHA256 or modern REST integrations. This tool acts as a bridge between OpenEdge and Mekari APIs by:
- Accepting API parameters via command line arguments
- Generating the required HMAC authentication signature
- Sending the HTTP request to the Mekari API
- Returning the response
This allows legacy systems to interact with Mekari APIs without implementing cryptographic logic inside OpenEdge.
The integration flow works as follows:
Progress OpenEdge
→ OS-COMMAND
→ mekari-hmac-auth.exe
→ Mekari API
The executable performs the HMAC signing and HTTP request.
- Node.js 16
- npm
- pkg (for building the executable)
Install pkg globally:
npm install -g pkg
Clone the repository:
git clone https://github.com/your-repository/mekari-hmac-auth.git
cd mekari-hmac-auth
Install dependencies:
npm install
To compile the CLI into a Windows executable:
pkg main.js --targets node16-win-x64 --output mekari-hmac-auth
This will generate:
mekari-hmac-auth.exe
The executable accepts the following parameters:
mekari-hmac-auth.exe METHOD PATH_WITH_QUERY CLIENT_ID CLIENT_SECRET BASE_URL
Example:
mekari-hmac-auth.exe POST "/v2/klikpajak/v1/efaktur/out?auto_approval=false" CLIENT_ID CLIENT_SECRET https://api.mekari.com
Example response:
{ message: 'Unauthorized' }
401
{
date: 'Wed, 04 Mar 2026 09:49:34 GMT',
content-type: 'application/json; charset=utf-8'
}
To save the response to a file:
mekari-hmac-auth.exe POST "/v2/klikpajak/v1/efaktur/out?auto_approval=false" CLIENT_ID CLIENT_SECRET https://api.mekari.com > response.txt 2>&1
The response will be written to:
response.txt
Below is an example .p program that runs the executable and reads the
response.
DEFINE VARIABLE exe-path AS CHARACTER NO-UNDO.
DEFINE VARIABLE res-path AS CHARACTER NO-UNDO.
DEFINE VARIABLE cmd AS CHARACTER NO-UNDO.
DEFINE VARIABLE response AS LONGCHAR NO-UNDO.
DEFINE VARIABLE line AS CHARACTER NO-UNDO.
exe-path = "C:\integration\mekari-hmac-auth.exe".
res-path = "C:\integration\response.txt".
cmd = 'cmd /c ""'
+ exe-path + '" '
+ '"POST" '
+ '"/v2/klikpajak/v1/efaktur/out?auto_approval=false" '
+ '"CLIENT_ID" '
+ '"CLIENT_SECRET" '
+ '"https://api.mekari.com" '
+ '> "' + res-path + '" 2>&1"'.
OS-COMMAND SILENT VALUE(cmd).
INPUT FROM VALUE(res-path).
response = "".
REPEAT:
IMPORT UNFORMATTED line NO-ERROR.
IF ERROR-STATUS:ERROR THEN LEAVE.
response = response + line + CHR(10).
END.
INPUT CLOSE.
MESSAGE response VIEW-AS ALERT-BOX.cmd /cis required so Windows command redirection (>) works when executed from OpenEdge.2>&1ensures both stdout and stderr are captured.- The executable should output only API responses to simplify parsing.
Avoid hardcoding API credentials inside the OpenEdge program or the executable. Consider using:
- environment variables
- encrypted configuration files
- secure credential storage
MIT License.