Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@ibm-functions/iam-token-manager
Advanced tools
npm install @ibm-functions/iam-token-manager
Provide constructor parameters iamApikey
and iamUrl
(Optional) to create a new instance.
const itm = require('@ibm-functions/iam-token-manager')
const m = new itm({
"iamApikey":"1234ABCD..."
})
Use the function getToken
to get an IAM acess token. This function returns a Promise
.
m.getToken().then(token => console.log('Authorization:', 'Bearer', token))
output:
Authorization: Bearer eyJhbGciOiJIUz......sgrKIi8hdFs
Use the function getAuthHeader
to get a Bearer HTTP Authorization header including the token. This function returns a Promise
.
m.getAuthHeader().then(header => console.log('Authorization:', header))
output:
Authorization: Bearer eyJhbGciOiJIUz......sgrKIi8hdFs
const itm = require('@ibm-functions/iam-token-manager')
const m = new itm({
"iamApikey":"1234ABCD..."
})
const openwhisk = require('openwhisk')
const ow = openwhisk({
auth_handler:m
})
Note: Need to use a version of openwhisk
that supports auth_handler
plugin.
The nodejs v8 runtime provides an openwhisk npm module already including the iam token manager plugin pre-installed, it will use the environment variable __OW_IAM_NAMESPACE_API_KEY
as the iamApikey
var openwhisk = require('openwhisk');
function action() {
var ow = openwhisk();
return ow.actions.invoke('sample')
}
exports.main = action
FAQs
Helper library to handle IBM Cloud IAM Tokens
The npm package @ibm-functions/iam-token-manager receives a total of 123 weekly downloads. As such, @ibm-functions/iam-token-manager popularity was classified as not popular.
We found that @ibm-functions/iam-token-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.