mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
refactor(core): Remove unused security audit telemetry event (no-changelog) (#10105)
This commit is contained in:
parent
c0264f0cff
commit
dd54390b0a
|
@ -7,7 +7,6 @@ import { RISK_CATEGORIES } from '@/security-audit/constants';
|
||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
import type { Risk } from '@/security-audit/types';
|
import type { Risk } from '@/security-audit/types';
|
||||||
import { BaseCommand } from './BaseCommand';
|
import { BaseCommand } from './BaseCommand';
|
||||||
import { EventRelay } from '@/eventbus/event-relay.service';
|
|
||||||
|
|
||||||
export class SecurityAudit extends BaseCommand {
|
export class SecurityAudit extends BaseCommand {
|
||||||
static description = 'Generate a security audit report for this n8n instance';
|
static description = 'Generate a security audit report for this n8n instance';
|
||||||
|
@ -61,8 +60,6 @@ export class SecurityAudit extends BaseCommand {
|
||||||
} else {
|
} else {
|
||||||
process.stdout.write(JSON.stringify(result, null, 2));
|
process.stdout.write(JSON.stringify(result, null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
Container.get(EventRelay).emit('security-audit-generated-via-cli');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async catch(error: Error) {
|
async catch(error: Error) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import type { Event } from './event.types';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class EventRelay extends EventEmitter {
|
export class EventRelay extends EventEmitter {
|
||||||
emit<K extends keyof Event>(eventName: K, arg?: Event[K]) {
|
emit<K extends keyof Event>(eventName: K, arg: Event[K]) {
|
||||||
super.emit(eventName, arg);
|
super.emit(eventName, arg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,10 +257,6 @@ export type Event = {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
'security-audit-generated-via-cli': {
|
|
||||||
// no payload
|
|
||||||
};
|
|
||||||
|
|
||||||
'variable-created': {
|
'variable-created': {
|
||||||
variableType: string;
|
variableType: string;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,9 +44,6 @@ export class TelemetryEventRelay {
|
||||||
this.eventRelay.on('license-renewal-attempted', (event) => {
|
this.eventRelay.on('license-renewal-attempted', (event) => {
|
||||||
this.licenseRenewalAttempted(event);
|
this.licenseRenewalAttempted(event);
|
||||||
});
|
});
|
||||||
this.eventRelay.on('security-audit-generated-via-cli', () => {
|
|
||||||
this.securityAuditGeneratedViaCli();
|
|
||||||
});
|
|
||||||
this.eventRelay.on('variable-created', (event) => {
|
this.eventRelay.on('variable-created', (event) => {
|
||||||
this.variableCreated(event);
|
this.variableCreated(event);
|
||||||
});
|
});
|
||||||
|
@ -172,10 +169,6 @@ export class TelemetryEventRelay {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private securityAuditGeneratedViaCli() {
|
|
||||||
void this.telemetry.track('Instance generated security audit via CLI command');
|
|
||||||
}
|
|
||||||
|
|
||||||
private variableCreated({ variableType }: Event['variable-created']) {
|
private variableCreated({ variableType }: Event['variable-created']) {
|
||||||
void this.telemetry.track('User created variable', {
|
void this.telemetry.track('User created variable', {
|
||||||
variable_type: variableType,
|
variable_type: variableType,
|
||||||
|
|
Loading…
Reference in a new issue