RACF authentication npm for z/OS
npm install racfBefore installing, download and install Node.js
IBM SDK for Node.js - z/OS 14.0 or IBM Open Enterprise SDK for Node.js 16 or higher is required.
In order to use this module, you must set the Program Control bit on Node and its dependent DLLs using the following command:
``bash`
extattr +p
A convenience script, setup.sh, is provided and can do this for you automatically
`bash`
. ./setup.sh
`bash`
npm install racf
`js
const racf = require("racf");
// Check if user belongs to a RACF group
if (racf.isUserInGroup("myuserid", "GROUP")) {
// Authenticate user and password against RACF
var isSuccessful = racf.authenticate("myuserid", "mypassword");
console.log(isSuccessful);
}
// Get the user name with getUserName
console.log(racf.getUserName())
// Check Permissions to a resource class
// Read access to the BPX.SERVER resource in the FACILITY class is required for this function
let hasResource = racf.checkPermission(racf.getUserName(), "FACILITY", "BPX.SERVER", "READ");
`
Run the tests:
`bash`
RACF_TEST_ID="MYUSERID" RACF_TEST_PASSWORD="MYPASSWORD" RACF_TEST_INGROUP="DEV_REALGROUP" RACF_TEST_NOTINGROUP="DEVFAKEGROUP" npm test
scripr or the extattr command, you may receive the following error:
`
chattr() error: rv=-1, errno=8B, rsn=0924041B
``