use of com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock in project vespa by vespa-engine.
the class ControllerContainerTest method addUserToHostedOperatorRole.
protected void addUserToHostedOperatorRole(AthenzIdentity athenzIdentity) {
AthenzClientFactoryMock mock = (AthenzClientFactoryMock) container.components().getComponent(AthenzClientFactoryMock.class.getName());
mock.getSetup().addHostedOperator(athenzIdentity);
}
use of com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock in project vespa by vespa-engine.
the class ApplicationApiTest method addScrewdriverUserToDeployRole.
/**
* In production this happens outside hosted Vespa, so there is no API for it and we need to reach down into the
* mock setup to replicate the action.
*/
private void addScrewdriverUserToDeployRole(ScrewdriverId screwdriverId, AthenzDomain domain, com.yahoo.vespa.hosted.controller.api.identifiers.ApplicationId applicationId) {
AthenzClientFactoryMock mock = (AthenzClientFactoryMock) container.components().getComponent(AthenzClientFactoryMock.class.getName());
AthenzIdentity screwdriverIdentity = HostedAthenzIdentities.from(screwdriverId);
AthenzDbMock.Application athenzApplication = mock.getSetup().domains.get(domain).applications.get(applicationId);
athenzApplication.addRoleMember(ApplicationAction.deploy, screwdriverIdentity);
}
use of com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock in project vespa by vespa-engine.
the class ControllerTester method createController.
private static Controller createController(ControllerDb db, CuratorDb curator, RotationsConfig rotationsConfig, ConfigServerClientMock configServerClientMock, ManualClock clock, GitHubMock gitHubClientMock, ZoneRegistryMock zoneRegistryMock, AthenzDbMock athensDb, MemoryNameService nameService, ArtifactRepository artifactRepository, EntityService entityService) {
Controller controller = new Controller(db, curator, rotationsConfig, gitHubClientMock, entityService, new MockOrganization(clock), new MemoryGlobalRoutingService(), zoneRegistryMock, configServerClientMock, new NodeRepositoryClientMock(), new MockMetricsService(), nameService, new MockRoutingGenerator(), new ChefMock(), clock, new AthenzClientFactoryMock(athensDb), artifactRepository);
controller.updateVersionStatus(VersionStatus.compute(controller));
return controller;
}
use of com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock in project vespa by vespa-engine.
the class ContainerControllerTester method authorize.
/*
* Authorize action on tenantDomain/application for a given screwdriverId
*/
public void authorize(AthenzDomain tenantDomain, ScrewdriverId screwdriverId, ApplicationAction action, Application application) {
AthenzClientFactoryMock mock = (AthenzClientFactoryMock) containerTester.container().components().getComponent(AthenzClientFactoryMock.class.getName());
mock.getSetup().domains.get(tenantDomain).applications.get(new com.yahoo.vespa.hosted.controller.api.identifiers.ApplicationId(application.id().application().value())).addRoleMember(action, HostedAthenzIdentities.from(screwdriverId));
}
use of com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock in project vespa by vespa-engine.
the class ContainerControllerTester method addTenantAthenzDomain.
private AthenzDomain addTenantAthenzDomain(String domainName, String userName) {
AthenzClientFactoryMock mock = (AthenzClientFactoryMock) containerTester.container().components().getComponent(AthenzClientFactoryMock.class.getName());
AthenzDomain athensDomain = new AthenzDomain(domainName);
AthenzDbMock.Domain domain = new AthenzDbMock.Domain(athensDomain);
domain.markAsVespaTenant();
domain.admin(AthenzIdentities.from(new AthenzDomain("domain"), userName));
mock.getSetup().addDomain(domain);
return athensDomain;
}
Aggregations