MCPcopy Index your code
hub / github.com/scality/cloudserver / bucketNotifAssert

Function bucketNotifAssert

lib/Config.js:518–539  ·  view source on GitHub ↗
(bucketNotifConfig)

Source from the content-addressed store, hash-verified

516}
517
518function 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
541function parseIntegrityChecks(config) {
542 const integrityChecks = {

Callers 2

_getConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected