Expose GitWeb config via /config/server/info REST endpoint

In the Gerrit Client retrieve the GitWeb configuration via REST and
remove the GitWeb configuration from the config that is embedded in
the host page data.

In order to provide the GitWeb configuration from the REST endpoint
the GitWeb configuration must be bound in the sysinjector (the binding
of the GitWebModule stays in the webinjector).

Change-Id: I640e645f6c9a72d5539f33e28721f0cff93e732d
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-05-08 13:40:40 +02:00
committed by David Pursehouse
parent e55a72f504
commit 7023f47c4b
24 changed files with 321 additions and 206 deletions

View File

@@ -0,0 +1,42 @@
// Copyright (C) 2011 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.config;
import com.google.gerrit.server.config.GitWebConfig;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class GitWebConfigTest {
private static final String VALID_CHARACTERS = "*()";
private static final String SOME_INVALID_CHARACTERS = "09AZaz$-_.+!',";
@Test
public void testValidPathSeparator() {
for(char c : VALID_CHARACTERS.toCharArray()) {
assertTrue("valid character rejected: " + c, GitWebConfig.isValidPathSeparator(c));
}
}
@Test
public void testInalidPathSeparator() {
for(char c : SOME_INVALID_CHARACTERS.toCharArray()) {
assertFalse("invalid character accepted: " + c, GitWebConfig.isValidPathSeparator(c));
}
}
}