1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- "use strict";
- /**
- * A group of security checks.
- * @interface
- * @memberof module:SecurityCheck
- */
- class CheckGroup {
- constructor() {
- this._name = this.setName();
- this._checks = this.setChecks();
- }
- /**
- * The security check group name; to be overridden by child class.
- */
- setName() {
- throw `Check group has no name.`;
- }
- name() {
- return this._name;
- }
- /**
- * The security checks; to be overridden by child class.
- */
- setChecks() {
- throw `Check group has no checks.`;
- }
- checks() {
- return this._checks;
- }
- /**
- * Runs all checks.
- */
- async run() {
- for (const check of this._checks) {
- check.run();
- }
- }
- }
- module.exports = CheckGroup;
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJDaGVja0dyb3VwIiwiY29uc3RydWN0b3IiLCJfbmFtZSIsInNldE5hbWUiLCJfY2hlY2tzIiwic2V0Q2hlY2tzIiwibmFtZSIsImNoZWNrcyIsInJ1biIsImNoZWNrIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9TZWN1cml0eS9DaGVja0dyb3VwLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQSBncm91cCBvZiBzZWN1cml0eSBjaGVja3MuXG4gKiBAaW50ZXJmYWNlXG4gKiBAbWVtYmVyb2YgbW9kdWxlOlNlY3VyaXR5Q2hlY2tcbiAqL1xuY2xhc3MgQ2hlY2tHcm91cCB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMuX25hbWUgPSB0aGlzLnNldE5hbWUoKTtcbiAgICB0aGlzLl9jaGVja3MgPSB0aGlzLnNldENoZWNrcygpO1xuICB9XG5cbiAgLyoqXG4gICAqIFRoZSBzZWN1cml0eSBjaGVjayBncm91cCBuYW1lOyB0byBiZSBvdmVycmlkZGVuIGJ5IGNoaWxkIGNsYXNzLlxuICAgKi9cbiAgc2V0TmFtZSgpIHtcbiAgICB0aHJvdyBgQ2hlY2sgZ3JvdX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