Allow unsetting of the support email group, disabling "support users"

In addition to just making good sense to not have support group for some
environments (local? unittest? crash?) - connecting with G Suit requires
additional permissions that are harder to find.

Specifically, it requires the Json Credentials that just aren't set in the
Dummy Keyring used on some environments.

So we make sure to not even *try* to create the credentials if the support
email isn't set

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=225589255
This commit is contained in:
guyben 2018-12-14 12:52:25 -08:00 committed by Michael Muller
parent 2ec8246097
commit 1004ef5621
5 changed files with 100 additions and 56 deletions

View file

@ -22,6 +22,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Ascii;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@ -424,8 +425,9 @@ public final class RegistryConfig {
*/
@Provides
@Config("gSuiteSupportGroupEmailAddress")
public static String provideGSuiteSupportGroupEmailAddress(RegistryConfigSettings config) {
return config.gSuite.supportGroupEmailAddress;
public static Optional<String> provideGSuiteSupportGroupEmailAddress(
RegistryConfigSettings config) {
return Optional.ofNullable(Strings.emptyToNull(config.gSuite.supportGroupEmailAddress));
}
/**