Search in sources :

Example 1 with ViewConfig

use of com.thoughtworks.go.config.ViewConfig in project gocd by gocd.

the class MingleConfigServiceIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    dbHelper.onSetUp();
    configHelper = new GoConfigFileHelper(goConfigDao);
    configHelper.onSetUp();
    configHelper.addPipeline("bar", "stage", MaterialConfigsMother.defaultMaterialConfigs(), "build");
    pipelineConfig = configHelper.addPipeline("foo", "stage", MaterialConfigsMother.defaultMaterialConfigs(), "build");
    configHelper.addMingleConfigToPipeline("foo", new MingleConfig("https://some-tracking-tool:8443", "project-super-secret", "hello=world"));
    CruiseConfig cruiseConfig = configHelper.load();
    PipelineConfigs group = cruiseConfig.findGroup("defaultGroup");
    group.setAuthorization(new Authorization(new ViewConfig(new AdminUser(new CaseInsensitiveString("authorized_user")))));
    configHelper.writeConfigFile(cruiseConfig);
    SecurityConfig securityConfig = new SecurityConfig(new LdapConfig(new GoCipher()), new PasswordFileConfig("/tmp/foo.passwd"), true);
    securityConfig.adminsConfig().add(new AdminUser(new CaseInsensitiveString("admin")));
    configHelper.addSecurity(securityConfig);
}
Also used : Authorization(com.thoughtworks.go.config.Authorization) LdapConfig(com.thoughtworks.go.config.LdapConfig) GoCipher(com.thoughtworks.go.security.GoCipher) SecurityConfig(com.thoughtworks.go.config.SecurityConfig) ViewConfig(com.thoughtworks.go.config.ViewConfig) AdminUser(com.thoughtworks.go.config.AdminUser) PipelineConfigs(com.thoughtworks.go.config.PipelineConfigs) GoConfigFileHelper(com.thoughtworks.go.util.GoConfigFileHelper) MingleConfig(com.thoughtworks.go.config.MingleConfig) PasswordFileConfig(com.thoughtworks.go.config.PasswordFileConfig) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Before(org.junit.Before)

Aggregations

AdminUser (com.thoughtworks.go.config.AdminUser)1 Authorization (com.thoughtworks.go.config.Authorization)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)1 LdapConfig (com.thoughtworks.go.config.LdapConfig)1 MingleConfig (com.thoughtworks.go.config.MingleConfig)1 PasswordFileConfig (com.thoughtworks.go.config.PasswordFileConfig)1 PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)1 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)1 ViewConfig (com.thoughtworks.go.config.ViewConfig)1 GoCipher (com.thoughtworks.go.security.GoCipher)1 GoConfigFileHelper (com.thoughtworks.go.util.GoConfigFileHelper)1 Before (org.junit.Before)1