Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
sls-helper-plugin-janis
Advanced tools
A Serverless Helper plugin to add custom helpers for JANIS Commerce
A plugin for JANIS Commerce to use with the Serverless Helper Framework.
Used to implement a base service with minimal setup
Option | Type | Description | Attributes | Default value |
---|---|---|---|---|
serviceName | string | The service name | Required | |
servicePort | number | The service port | Required | |
apiSecrets | Object | A mapping of stages to Service API Secret | undefined |
Used to implement Lambda APIs requests and response templates as custom props
No options
Used to implement APIs authorizers as custom props
No options
Used to implement APIs CORS configuration as custom props
If options is undefined
or set to true
it will use the default CORS config for every property.
You can also customize or override every property:
Option | Type | Description | Default value |
---|---|---|---|
replace | boolean | Indicates whether it should replace the CORS properties or merge then with the default | false |
origins | array | An array of allowed origins | See below |
headers | array | An array of allowed headers | See below |
allowCredentials | boolean | Indicates whether the credentials header should be set | true |
maxAge | number | The time in seconds thar CORS headers should be cached | 600 |
[
'https://${self:custom.janisDomains.${self:custom.stage}}',
'https://app.${self:custom.janisDomains.${self:custom.stage}}',
'http://localhost:3001',
'http://janis.localhost:3001',
'http://app.janis.localhost:3001'
]
[
'content-type',
'janis-api-key',
'janis-api-secret',
'janis-client',
'x-api-key',
'x-janis-page',
'x-janis-page-size'
]
Used to implement JANIS CRUD APIs.
Option | Type | Description | Attributes | Default value |
---|---|---|---|---|
entityName | string | The entity name | Required | |
handler | string | The lambda handler path and function | src/lambda/RestApi/index.handler | |
path | string | The API path | /[entity-name] (for apiList and apiPost) or /[entity-name]/{id} (for apiGet and apiPut) | |
caching | boolean | Set to true to enable cache | false | |
cors | boolean | Set to true to enable cors | false | |
queryParameters | object | A key value to map query string parameters to a boolean indicating if it's required or not | ||
requestHeaders | object | A key value to map headers to a boolean indicating if it's required or not | ||
authorizer | string | The name of the authorizer | Valid authorizers: FullAuthorizer, NoClientAuthorizer, LoggedAuthorizer, ApiKeyAuthorizer, UserAuthorizer, DevUserAuthorizer, ServiceAuthorizer, ServiceNoClientAuthorizer, ClientAuthorizer |
Used to implement JANIS Events listeners
Option | Type | Description | Attributes | Default value |
---|---|---|---|---|
entityName | string | The entity name | Required | |
eventName | string | The event name | Required | |
mustHaveClient | boolean | Indicates if authorizer must validate that client or not | false | |
listenersDirName | string | Indicates the path where the event listener files are placed | 'event-listeners' |
// serverless.js
'use strict';
const { helper } = require('sls-helper'); // eslint-disable-line
module.exports = helper({
hooks: [
['janis.base', {
serviceName: 'Catalog',
servicePort: 5000,
apiSecrets: {
beta: 'foo',
qa: 'bar',
prod: 'baz'
}
}],
'janis.templates',
'janis.authorizers',
'janis.cors',
['janis.apiList', {
entityName: 'product',
authorizer: 'FullAuthorizer',
cors: true
}],
['janis.apiGet', {
entityName: 'product',
authorizer: 'FullAuthorizer',
cors: true
}]
['janis.apiPost', {
entityName: 'product',
authorizer: 'FullAuthorizer',
cors: true
}],
['janis.apiPut', {
entityName: 'product',
authorizer: 'FullAuthorizer',
cors: true
}],
['janis.eventListener', {
entityName: 'product',
eventName: 'created',
mustHaveClient: true
}]
]
}, {});
[1.2.2] - 2019-12-26
FAQs
A Serverless Helper plugin to add custom helpers for Janis Commerce
The npm package sls-helper-plugin-janis receives a total of 226 weekly downloads. As such, sls-helper-plugin-janis popularity was classified as not popular.
We found that sls-helper-plugin-janis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.