brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Mongodb authentication
Date Mon, 14 Sep 2015 17:57:30 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/894#discussion_r39425008
  
    --- Diff: software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/mongodb/sharding/MongoDBShardedDeploymentImpl.java
---
    @@ -53,22 +54,36 @@
         @Override
         public void init() {
             super.init();
    -        
    -        setAttribute(CONFIG_SERVER_CLUSTER, addChild(EntitySpec.create(MongoDBConfigServerCluster.class)
    +
    +        EntitySpec<MongoDBConfigServerCluster> configServerClusterSpec = EntitySpec.create(MongoDBConfigServerCluster.class)
                     .configure(MongoDBConfigServerCluster.MEMBER_SPEC, getConfig(MONGODB_CONFIG_SERVER_SPEC))
    -                .configure(DynamicCluster.INITIAL_SIZE, getConfig(CONFIG_CLUSTER_SIZE))));
    -        setAttribute(ROUTER_CLUSTER, addChild(EntitySpec.create(MongoDBRouterCluster.class)
    +                .configure(DynamicCluster.INITIAL_SIZE, getConfig(CONFIG_CLUSTER_SIZE));
    +        MongoDBAuthenticationUtils.setAuthenticationConfig(configServerClusterSpec, this);
    +        sensors().set(CONFIG_SERVER_CLUSTER, addChild(configServerClusterSpec));
    +
    +        EntitySpec<MongoDBRouterCluster> routerClusterSpec = EntitySpec.create(MongoDBRouterCluster.class)
                     .configure(MongoDBRouterCluster.MEMBER_SPEC, getConfig(MONGODB_ROUTER_SPEC))
                     .configure(DynamicCluster.INITIAL_SIZE, getConfig(INITIAL_ROUTER_CLUSTER_SIZE))
    -                .configure(MongoDBRouter.CONFIG_SERVERS, attributeWhenReady(getAttribute(CONFIG_SERVER_CLUSTER),
MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES))));
    -        setAttribute(SHARD_CLUSTER, addChild(EntitySpec.create(MongoDBShardCluster.class)
    +                .configure(MongoDBRouter.CONFIG_SERVERS, attributeWhenReady(getAttribute(CONFIG_SERVER_CLUSTER),
MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES));
    +        MongoDBAuthenticationUtils.setAuthenticationConfig(routerClusterSpec, this);
    +        sensors().set(ROUTER_CLUSTER, addChild(routerClusterSpec));
    +
    +        EntitySpec<MongoDBShardCluster> shardClusterSpec = EntitySpec.create(MongoDBShardCluster.class)
                     .configure(MongoDBShardCluster.MEMBER_SPEC, getConfig(MONGODB_REPLICA_SET_SPEC))
    -                .configure(DynamicCluster.INITIAL_SIZE, getConfig(INITIAL_SHARD_CLUSTER_SIZE))));
    +                .configure(DynamicCluster.INITIAL_SIZE, getConfig(INITIAL_SHARD_CLUSTER_SIZE));
    +        MongoDBAuthenticationUtils.setAuthenticationConfig(shardClusterSpec, this);
    +        sensors().set(SHARD_CLUSTER, addChild(shardClusterSpec));
    +
             addEnricher(Enrichers.builder()
                     .propagating(MongoDBConfigServerCluster.CONFIG_SERVER_ADDRESSES)
                     .from(getAttribute(CONFIG_SERVER_CLUSTER))
                     .build());
    -        
    +
    +        // Advertise even if default are used (root password is set in MongoDBAuthenticationUtils)
    +        sensors().set(MongoDBAuthenticationMixins.AUTHENTICATION_DATABASE, config().get(MongoDBAuthenticationMixins.AUTHENTICATION_DATABASE));
    +        sensors().set(MongoDBAuthenticationMixins.ROOT_USERNAME, config().get(MongoDBAuthenticationMixins.ROOT_USERNAME));
    +        sensors().set(MongoDBAuthenticationMixins.MONGODB_KEYFILE_DESTINATION, config().get(MongoDBAuthenticationMixins.MONGODB_KEYFILE_CONTENTS));
    --- End diff --
    
    I think you've used `MONGODB_KEYFILE_CONTENTS` incorrectly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message