Skip to content

Commit

Permalink
Update index.d.ts and test.ts.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoolioh committed Jun 6, 2023
1 parent 1595f8b commit f7338c8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ tracer.init({
obfuscatorKeyRegex: '.*',
obfuscatorValueRegex: '.*',
blockedTemplateHtml: './blocked.html',
blockedTemplateJson: './blocked.json'
blockedTemplateJson: './blocked.json',
eventTracking: {
enabled: true,
mode: 'safe'
}
}
});

Expand Down
16 changes: 16 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,22 @@ export declare interface TracerOptions {
* Specifies a path to a custom blocking template json file.
*/
blockedTemplateJson?: string,

/**
* Controls the automated user event tracking configuration
*/
eventTracking?: {
/**
* Whether to enable automated user event tracking.
* @default true
*/
enabled?: boolean,
/**
* Constrols the automated user event tracking mode
* @default 'safe'
*/
mode?: string
}
};

/**
Expand Down
3 changes: 1 addition & 2 deletions packages/dd-trace/src/appsec/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function parseUser (login, passportUser, mode) {
}

if (passportUser) {
// Guess id
// Guess id
if (passportUser.id) {
user['usr.id'] = passportUser.id
} else if (passportUser._id) {
Expand Down Expand Up @@ -80,7 +80,6 @@ function passportTrackEvent (credentials, passportUser, rootSpan, mode) {

if (passportUser) {
// If a passportUser object is published then the login succeded
// TODO : test
setUserTags({ id: user['usr.id'] }, rootSpan)
// Prevent 'usr.id' from being reported again in the metadata
delete user['usr.id']
Expand Down

0 comments on commit f7338c8

Please sign in to comment.