(bucketNotifConfig)
| 516 | } |
| 517 | |
| 518 | function bucketNotifAssert(bucketNotifConfig) { |
| 519 | assert(Array.isArray(bucketNotifConfig), |
| 520 | 'bad config: bucket notification configuration must be an array'); |
| 521 | bucketNotifConfig.forEach(c => { |
| 522 | const { resource, type, host, port, auth } = c; |
| 523 | assert(typeof resource === 'string', |
| 524 | 'bad config: bucket notification configuration resource must be a string'); |
| 525 | assert(typeof type === 'string', |
| 526 | 'bad config: bucket notification configuration type must be a string'); |
| 527 | assert(typeof host === 'string' && host !== '', |
| 528 | 'bad config: hostname must be a non-empty string'); |
| 529 | if (port) { |
| 530 | assert(Number.isInteger(port, 10) && port > 0, |
| 531 | 'bad config: port must be a positive integer'); |
| 532 | } |
| 533 | if (auth) { |
| 534 | assert(typeof auth === 'object', |
| 535 | 'bad config: bucket notification auth must be an object'); |
| 536 | } |
| 537 | }); |
| 538 | return bucketNotifConfig; |
| 539 | } |
| 540 | |
| 541 | function parseIntegrityChecks(config) { |
| 542 | const integrityChecks = { |
no outgoing calls
no test coverage detected