Clean-up scopes names when reading from config When customising GitHub OAuth Scopes for login, we need to make sure that scope names are cleaned up from heading/trailing spaces Change-Id: I36d3ad968ee8f0b896eaeb9862b6c3fc4e1be944
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java index 7d30d19..43d778a 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java
@@ -126,7 +126,7 @@ if (Strings.emptyToNull(scopesString) != null) { String[] scopesStrings = scopesString.split(","); for (String scope : scopesStrings) { - scopes.add(Enum.valueOf(Scope.class, scope)); + scopes.add(Enum.valueOf(Scope.class, scope.trim())); } }