Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/services/meta-classes/base.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,9 +969,10 @@ class BaseService extends ServiceWithHooks {
details: `Object B with stixId ${data.revoking.stixId} and modified ${data.revoking.modified} not found`,
});
}
if (objectB.stix.type !== this.type) {
const expectedRevokingType = this.type === 'software' ? objectA.stix.type : this.type;
if (objectB.stix.type !== expectedRevokingType) {
throw new BadRequestError({
details: `Revoking object must be of the same type (${this.type}), got ${objectB.stix.type}`,
details: `Revoking object must be of the same type (${expectedRevokingType}), got ${objectB.stix.type}`,
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/services/stix/software-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ class SoftwareService extends BaseService {
}
}

module.exports = new SoftwareService(null, softwareRepository);
module.exports = new SoftwareService('software', softwareRepository);
Loading