New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sap/audit-logging

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/audit-logging - npm Package Compare versions

Comparing version 5.1.0 to 5.3.0

19

CHANGELOG.md

@@ -8,2 +8,21 @@ # Change Log

## 5.3.0 - 2021-11-22
### Added
- Added mTLS support.
- Custom Timestamp functionality via .at() method for messages.
### Updated
- Documentation with mTLS support guidelines.
- Documentation with custom timestamp usage.
- *@sap/xssec* library to v3.2.10.
## 5.2.0 - 2021-10-08
### Added
- Added express middleware functionality.
### Updated
- Documentation with express middleware usage steps.
## 5.1.0 - 2021-08-12

@@ -10,0 +29,0 @@

33

index.js

@@ -8,2 +8,5 @@ 'use strict';

var deprecate = require('util').deprecate;
var NodeCache = require('node-cache');
var auditCache = new NodeCache();
var https = require('https');

@@ -13,2 +16,4 @@ var auditLog = deprecate(require('./lib/v1/audit-log'), 'Audit log v1 APIs are deprecated. Use v2 if available on the Audit log server.');

const AUDIT_V2_OPTIONS_CACHE_KEY = 'AUDIT_V2_OPTIONS';
auditLog.v2 = function (credentials, securityContext, callback) {

@@ -30,7 +35,23 @@ // Backwards compatible.

debug('Sending request to %s', uri);
fetch(uri, {
let cachedv2ServiceOptions = auditCache.get(`${AUDIT_V2_OPTIONS_CACHE_KEY}-${uri}`);
if (cachedv2ServiceOptions) {
return callback(null, auditLogV2(credentials, cachedv2ServiceOptions, securityContext));
}
let options = {
method: 'get',
headers: { 'Content-Type': 'application/json' }
}).then(function (res) {
};
if (credentials && credentials.uaa && credentials.uaa.certificate) {
const httpsAgent = new https.Agent({
certificate: credentials.uaa.certificate,
key: credentials.uaa.key
});
options.agent = httpsAgent;
}
debug('Sending request to %s', uri);
fetch(uri, options).then(function (res) {
status = res.status;

@@ -62,2 +83,8 @@ return res.text();

let cachingResult = auditCache.set(`${AUDIT_V2_OPTIONS_CACHE_KEY}-${uri}`, v2ServiceOptions);
if (!cachingResult) {
debug('Failed to cache v2 service options. Retrying: %s', !cachingResult);
cachingResult = auditCache.set(`${AUDIT_V2_OPTIONS_CACHE_KEY}-${uri}`, v2ServiceOptions);
}
return callback(null, auditLogV2(credentials, v2ServiceOptions, securityContext));

@@ -64,0 +91,0 @@ }).catch(function (err) {

@@ -24,5 +24,13 @@ 'use strict';

MessageBase.prototype.at = function (ts) {
if (!(ts instanceof Date)) {
ts = new Date(ts);
}
this.customTime = ts.toISOString();
return this;
};
MessageBase.prototype._update = function () {
this._content.uuid = utils.uuid();
this._content.time = new Date().toISOString();
this._content.time = this.customTime || new Date().toISOString();
};

@@ -29,0 +37,0 @@

24

lib/transports/ServiceTransport.js

@@ -67,3 +67,3 @@ 'use strict';

fetch(url, {
const options = {
method: method,

@@ -84,3 +84,13 @@ retryDelay: 3000,

agent: this.requestAgent
}).then(function (res) {
};
if (this.credentials && this.credentials.uaa && this.credentials.uaa.certificate) {
const httpsAgent = new https.Agent({
certificate: this.credentials.uaa.certificate,
key: this.credentials.uaa.key
});
options.agent = httpsAgent;
}
fetch(url, options).then(function (res) {
debug('Auditlog response: status %s', res.status);

@@ -131,3 +141,5 @@ statusCode = res.status;

}
else if (this.credentials.uaa && this.credentials.uaa.clientid && this.credentials.uaa.clientsecret && this.credentials.uaa.url) {
else if (this.credentials.uaa && this.credentials.uaa.clientid
&& (this.credentials.uaa.clientsecret || (this.credentials.uaa.key && this.credentials.uaa.certificate))
&& this.credentials.uaa.url) {
requests.requestClientCredentialsToken(null, this.credentials.uaa, null, null, (err, token) => {

@@ -148,4 +160,6 @@ if (err) {

assert(
(credentials.user && credentials.password && credentials.url) ||
(credentials.url && credentials.uaa && credentials.uaa.clientid && credentials.uaa.clientsecret && credentials.uaa.url),
(credentials.user && credentials.password && credentials.url)
|| (credentials.url && credentials.uaa && credentials.uaa.clientid
&& (credentials.uaa.clientsecret || (credentials.uaa.key && credentials.uaa.certificate))
&& credentials.uaa.url),
'credentials are missing information!');

@@ -152,0 +166,0 @@ }

{
"name": "@sap/audit-logging",
"version": "5.1.0",
"version": "5.3.0",
"lockfileVersion": 1,

@@ -8,10 +8,9 @@ "requires": true,

"@sap/xssec": {
"version": "3.2.2",
"version": "3.2.10",
"requires": {
"debug": "4.1.1",
"axios": "^0.21.4",
"debug": "4.3.2",
"jsonwebtoken": "^8.5.1",
"lru-cache": "6.0.0",
"node-rsa": "^1.1.1",
"request": "^2.88.2",
"requestretry": "4.0.0",
"valid-url": "1.0.9"

@@ -21,5 +20,5 @@ },

"debug": {
"version": "4.1.1",
"version": "4.3.2",
"requires": {
"ms": "^2.1.1"
"ms": "2.1.2"
}

@@ -29,13 +28,4 @@ }

},
"ajv": {
"version": "6.12.6",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"asn1": {
"version": "0.2.4",
"version": "0.2.6",
"requires": {

@@ -45,18 +35,6 @@ "safer-buffer": "~2.1.0"

},
"assert-plus": {
"version": "1.0.0"
},
"asynckit": {
"version": "0.4.0"
},
"aws-sign2": {
"version": "0.7.0"
},
"aws4": {
"version": "1.11.0"
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"axios": {
"version": "0.21.4",
"requires": {
"tweetnacl": "^0.14.3"
"follow-redirects": "^1.14.0"
}

@@ -67,20 +45,5 @@ },

},
"caseless": {
"version": "0.12.0"
"clone": {
"version": "2.1.2"
},
"combined-stream": {
"version": "1.0.8",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"core-util-is": {
"version": "1.0.2"
},
"dashdash": {
"version": "1.14.1",
"requires": {
"assert-plus": "^1.0.0"
}
},
"debug": {

@@ -90,19 +53,4 @@ "version": "4.2.0",

"ms": "2.1.2"
},
"dependencies": {
"ms": {
"version": "2.1.2"
}
}
},
"delayed-stream": {
"version": "1.0.0"
},
"ecc-jsbn": {
"version": "0.1.2",
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"ecdsa-sig-formatter": {

@@ -114,70 +62,8 @@ "version": "1.0.11",

},
"extend": {
"version": "3.0.2"
},
"extsprintf": {
"version": "1.3.0"
},
"fast-deep-equal": {
"version": "3.1.3"
},
"fast-json-stable-stringify": {
"version": "2.1.0"
},
"fetch-retry": {
"version": "4.1.0"
},
"forever-agent": {
"version": "0.6.1"
"follow-redirects": {
"version": "1.14.5"
},
"form-data": {
"version": "2.3.3",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"getpass": {
"version": "0.1.7",
"requires": {
"assert-plus": "^1.0.0"
}
},
"har-schema": {
"version": "2.0.0"
},
"har-validator": {
"version": "5.1.5",
"requires": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
}
},
"http-signature": {
"version": "1.2.0",
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"is-typedarray": {
"version": "1.0.0"
},
"isstream": {
"version": "0.1.2"
},
"jsbn": {
"version": "0.1.1"
},
"json-schema": {
"version": "0.2.3"
},
"json-schema-traverse": {
"version": "0.4.1"
},
"json-stringify-safe": {
"version": "5.0.1"
},
"jsonwebtoken": {

@@ -198,11 +84,2 @@ "version": "8.5.1",

},
"jsprim": {
"version": "1.4.1",
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"jwa": {

@@ -223,5 +100,2 @@ "version": "1.4.1",

},
"lodash": {
"version": "4.17.21"
},
"lodash.includes": {

@@ -254,14 +128,11 @@ "version": "4.3.0"

},
"mime-db": {
"version": "1.49.0"
"ms": {
"version": "2.1.2"
},
"mime-types": {
"version": "2.1.32",
"node-cache": {
"version": "5.1.0",
"requires": {
"mime-db": "1.49.0"
"clone": "2.x"
}
},
"ms": {
"version": "2.1.3"
},
"node-fetch": {

@@ -276,50 +147,2 @@ "version": "2.6.1"

},
"oauth-sign": {
"version": "0.9.0"
},
"performance-now": {
"version": "2.1.0"
},
"psl": {
"version": "1.8.0"
},
"punycode": {
"version": "2.1.1"
},
"qs": {
"version": "6.5.2"
},
"request": {
"version": "2.88.2",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"requestretry": {
"version": "4.0.0",
"requires": {
"extend": "^3.0.2",
"lodash": "^4.17.10",
"when": "^3.7.7"
}
},
"safe-buffer": {

@@ -334,55 +157,5 @@ "version": "5.2.1"

},
"sshpk": {
"version": "1.16.1",
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"tough-cookie": {
"version": "2.5.0",
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5"
},
"uri-js": {
"version": "4.4.1",
"requires": {
"punycode": "^2.1.0"
}
},
"uuid": {
"version": "3.4.0"
},
"valid-url": {
"version": "1.0.9"
},
"verror": {
"version": "1.10.0",
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
},
"when": {
"version": "3.7.8"
},
"yallist": {

@@ -389,0 +162,0 @@ "version": "4.0.0"

{
"name": "@sap/audit-logging",
"description": "Provides audit logging functionalities for Node.js applications",
"version": "5.1.0",
"version": "5.3.0",
"license": "SEE LICENSE IN LICENSE file",

@@ -29,5 +29,6 @@ "main": "index.js",

"dependencies": {
"@sap/xssec": "^3.2.2",
"@sap/xssec": "^3.2.10",
"debug": "4.2.0",
"fetch-retry": "4.1.0",
"node-cache": "5.1.0",
"node-fetch": "2.6.1"

@@ -34,0 +35,0 @@ },

@@ -11,2 +11,7 @@ # @sap/audit-logging

* [Versions](#versions)
* [Express Middleware](#express-middleware)
- [Simple Usage](#simple-usage)
- [Making Use of the SecurityContext and User Token Exchange Flow](#making-use-of-the-securitycontext-and-user-token-exchange-flow)
- [Plugging Middleware Only When Needed](#plugging-middleware-only-when-needed)
* [mTLS Support](#mtls-support)
- [API - v1](#api---v1)

@@ -75,2 +80,97 @@ * [Importing the library](#importing-the-library)

### Express Middleware
The Audit Log client provides an easier way to use the auditlog client in an express application. Below you can find a few examples on how to make use of the express middleware. The middleware works with both **v1** and **v2** of the Auditlog Service.
#### Simple Usage
```js
const express = require("express");
const app = express();
const auditMiddleware = require('./node-audit-logging/middleware');
// Config for auditLoggingService.
const auditLogConfig = {...}; // Retrieved from the environment using @sap/xsenv.
// app.use(auditMiddleware(auditLogConfig, 1)); // Here we select using v1.
app.use(auditMiddleware(auditLogConfig, 2));
app.get('/', async function (req, res) {
let auditLog = req.auditLog;
// ...
});
```
#### Making Use of the SecurityContext and User Token Exchange Flow
In order to make use also of the *SecurityContext* that comes from the *@sap/xssec* library, you need to make sure you import the *@sap/xssec* middleware before the auditlogging. **This only works with the OAuth2 plan.**
```js
const express = require('express');
// Includes required for xssec.
const passport = require('passport');
const { JWTStrategy } = require('xssec');
// Includes required for auditLogging.
const auditLogMiddleware = require('@sap/audit-logging/middleware');
const app = express();
// Config for xssec middelware.
const xsuaaConfig = {...}; // Retrieved from the environment using @sap/xsenv.
passport.use(new JWTStrategy(xsuaaConfig));
app.use(passport.initialize());
app.use(passport.authenticate('JWT', { session: false, failWithError: true }));
// Config for auditLoggingService.
const auditLogConfig = {...}; // Retrieved from the environment using @sap/xsenv.
app.use(auditLogMiddleware(auditLogConfig));
app.get('/', async function (req, res) {
let auditLog = req.auditLog;
// ...
});
```
#### Plugging Middleware Only When Needed
If you have the case where you do not want to include the auditLog to a request, you can plug the middleware only on the routes it is required:
```js
const express = require('express');
// Includes required for xssec.
const passport = require('passport');
const { JWTStrategy } = require('xssec');
// Includes required for auditLogging.
const auditLogMiddleware = require('@sap/audit-logging/middleware');
const app = express();
// Config for xssec middelware.
const xsuaaConfig = {...}; // Retrieved from the environment using @sap/xsenv.
passport.use(new JWTStrategy(xsuaaConfig));
app.use(passport.initialize());
app.use(passport.authenticate('JWT', { session: false, failWithError: true }));
// Config for auditLoggingService.
const auditLogConfig = {...}; // Retrieved from the environment using @sap/xsenv.
// In this API we need auditlog, so we add the auditLogMiddleware
app.get('/withAuditLog', auditLogMiddleware(auditLogConfig), function(req, res) {
let auditLog = req.auditLog; // This will be undefined.
// ...
});
// Here we do not need the auditLog, so we do not add the auditLogMiddleware.
app.get('/withoutAuditLog', function(req, res) {
let auditLog = req.auditLog; // This will be undefined.
// ...
});
```
### mTLS Support
The library also supports certificate based authentication. In order to use this type of authentication, you need to create x509 credentials and pass them to the auditlog library the same way you would pass all other credential types. If you are retrieving credentials via *@sap/xsenv* you might need to create **binding** and not **service key**.
For further information how to create the appropriate credential type, visit [Audit Log Retrieval API Usage for the Cloud Foundry Environment](https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/30ece35bac024ca69de8b16bff79c413.html).
## API - v1

@@ -107,5 +207,8 @@

};
var auditLog = require('@sap/audit-logging')(credentials);
var auditLog = require('@sap/audit-logging')(credentials, securityContext);
```
* `credentials` - Retrieved from the environment.
* `securityContext` - *Optional* - created manually or through usage of the req.AuthInfo from **@sap/xssec**.
### Data access messages

@@ -125,2 +228,3 @@

.by('John Doe')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -139,2 +243,3 @@ ```

* `tenant` - takes a string which specifies the tenant id. The provided value is ignored by older versions of the Audit log service that do not support setting a tenant.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -152,2 +257,3 @@

.by('$USER')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -166,2 +272,3 @@ ```

* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -173,3 +280,3 @@

#### Standard Plan (deprecated)
#### Standard Plan (deprecated)

@@ -191,2 +298,3 @@ ```js

.by('John Doe')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -211,2 +319,3 @@ ```

* `tenant` - takes a string which specifies the tenant id. The provided value is ignored by older versions of the Audit log service that do not support setting a tenant.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -231,2 +340,3 @@

.by('$USER')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -251,2 +361,3 @@ ```

* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**. The provided value is ignored by older versions of the Audit log service that do not support setting a tenant.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -280,2 +391,3 @@

.successful(true)
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -294,2 +406,3 @@ ```

* `tenant` - takes a string which specifies the tenant id. The provided value is ignored by older versions of the Audit log service that do not support setting a tenant.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -305,2 +418,3 @@

.successful(true)
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -319,2 +433,3 @@ ```

* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**. The provided value is ignored by older versions of the Audit log service that do not support setting a tenant.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -345,2 +460,3 @@

.externalIP('127.0.0.1')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -353,2 +469,3 @@ ```

* `tenant` - takes a string which specifies the tenant id. The provided value is ignored by older versions of the Audit log service that do not support setting a tenant.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -363,2 +480,3 @@

.externalIP('127.0.0.1')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(...);

@@ -371,2 +489,3 @@ ```

* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**. The provided value is ignored by older versions of the Audit log service that do not support setting a tenant.
* `at(time)` - sets a custom timestamp for event time.
* `log` - See [here](#logging-a-message)

@@ -439,3 +558,3 @@

var auditLogging = require('@sap/audit-logging');
auditLogging.v2(credentials, function(err, auditLog) {
auditLogging.v2(credentials, securityContext, function(err, auditLog) {
if (err) {

@@ -449,2 +568,6 @@ // if the Audit log server does not support version 2 of the REST APIs

* `credentials` - Retrieved from the environment.
* `securityContext` - *Optional* - created manually or through usage of the req.AuthInfo from **@sap/xssec**.
*Note: This method is backwards compatible if you provide the callback instead of the securityContext it will still work.*
### Data access messages

@@ -467,2 +590,3 @@

.by('John Doe')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(function (err) {

@@ -481,2 +605,3 @@

* `by` - takes a string which identifies the *user* performing the action. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.
* `log` - logs the message.

@@ -498,3 +623,4 @@

.tenant('$PROVIDER') // or .tenant('$SUBSCRIBER')
.by('$USER')
.by('$USER')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(function (err) {

@@ -513,2 +639,3 @@

* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.
* `log` - logs the message.

@@ -526,3 +653,4 @@

.tenant('tenantId')
.by('John Doe');
.by('John Doe')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z');

@@ -541,2 +669,3 @@ message.logPrepare(function (err) {

* `by` - takes a string which identifies the *user* performing the action. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.
* `logPrepare` - Used to log that a user has started an operation over the data.

@@ -554,3 +683,4 @@ * `logSuccess` - Used to log that the operation over the data has been completed successfully.

.tenant('$PROVIDER') // or .tenant('$SUBSCRIBER')
.by('$USER');
.by('$USER')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z');

@@ -569,2 +699,3 @@ message.logPrepare(function (err) {

* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.
* `logPrepare` - Used to log that a user has started an operation over the data.

@@ -582,3 +713,4 @@ * `logSuccess` - Used to log that the operation over the data has been completed successfully.

.tenant('tenantId')
.by('Application Admin');
.by('Application Admin')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z');

@@ -596,2 +728,3 @@ message.logPrepare(function (err) {

* `by` - takes a string which identifies the *user* performing the action. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.
* `logPrepare` - Used to log that a user has started a configuration change operation.

@@ -607,3 +740,4 @@ * `logSuccess` - Used to log that the operation has been completed successfully.

.tenant('$PROVIDER') // or .tenant('$SUBSCRIBER')
.by('$USER');
.by('$USER')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z');

@@ -621,2 +755,3 @@ message.logPrepare(function (err) {

* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.
* `logPrepare` - Used to log that a user has started a configuration change operation.

@@ -635,2 +770,3 @@ * `logSuccess` - Used to log that the operation has been completed successfully.

.by('John Doe')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(function (err) {

@@ -645,2 +781,3 @@

* `tenant` - takes a string which specifies the tenant id.
* `at(time)` - sets a custom timestamp for event time.
* `log` - logs the message.

@@ -655,2 +792,3 @@

.by('$USER')
.at(42 || new Date() || '1970-01-01T00:00:00.042Z')
.log(function (err) {

@@ -663,4 +801,5 @@

* `externalIP` - states the IP of the machine that contacts the system. Specifying it is optional, but if provided, should be either IPv4 or IPv6.
* `by` - takes a string which identifies the *user* performing the action. This is **mandatory**.
* `tenant` - takes a string which specifies the tenant id.
* `by` - takes a fixed string '$USER' that is a placeholder replaced by the service. This is **mandatory**.
* `tenant` - takes a specific string placeholder ('$PROVIDER' or '$SUBSCRIBER') that is replaced by the service. This is **mandatory**.
* `at(time)` - sets a custom timestamp for event time.f
* `log` - logs the message.

@@ -667,0 +806,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc