use of com.yahoo.athenz.zts.store.MockZMSFileChangeLogStore in project athenz by yahoo.
the class ZTSImplTest method setup.
@BeforeMethod
public void setup() {
// we want to make sure we start we clean dir structure
ZTSTestUtils.deleteDirectory(new File(ZTS_DATA_STORE_PATH));
String privKeyName = System.getProperty(FilePrivateKeyStore.ATHENZ_PROP_PRIVATE_KEY);
File privKeyFile = new File(privKeyName);
String privKey = Crypto.encodedFile(privKeyFile);
privateKey = Crypto.loadPrivateKey(Crypto.ybase64DecodeString(privKey));
System.setProperty(ZTSConsts.ZTS_PROP_CERTSIGN_BASE_URI, "https://localhost:443/certsign/v2");
/* create our data store */
roleTokenDefaultTimeout = 2400;
System.setProperty(ZTSConsts.ZTS_PROP_ROLE_TOKEN_DEFAULT_TIMEOUT, Integer.toString(roleTokenDefaultTimeout));
roleTokenMaxTimeout = 96000;
System.setProperty(ZTSConsts.ZTS_PROP_ROLE_TOKEN_MAX_TIMEOUT, Integer.toString(roleTokenMaxTimeout));
System.setProperty(ZTSConsts.ZTS_PROP_AUTHORIZED_PROXY_USERS, "user_domain.proxy-user1,user_domain.proxy-user2");
ChangeLogStore structStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", privateKey, "0");
cloudStore = new CloudStore();
cloudStore.setHttpClient(null);
System.setProperty(ZTSConsts.ZTS_PROP_CERT_ALLOWED_O_VALUES, "Athenz, Inc.|My Test Company|Athenz|Yahoo");
System.setProperty(ZTSConsts.ZTS_PROP_NOAUTH_URI_LIST, "/zts/v1/schema,/zts/v1/status");
System.setProperty(ZTSConsts.ZTS_PROP_SELF_SIGNER_PRIVATE_KEY_FNAME, "src/test/resources/unit_test_private_encrypted.key");
System.setProperty(ZTSConsts.ZTS_PROP_SELF_SIGNER_PRIVATE_KEY_PASSWORD, "athenz");
ZTSTestUtils.deleteDirectory(new File("/tmp/zts_server_cert_store"));
System.setProperty(ZTSConsts.ZTS_PROP_CERT_FILE_STORE_PATH, "/tmp/zts_server_cert_store");
System.setProperty(ZTSConsts.ZTS_PROP_VALIDATE_SERVICE_IDENTITY, "false");
// enable ip validation for cert requests
System.setProperty(ZTSConsts.ZTS_PROP_CERT_REQUEST_VERIFY_IP, "true");
store = new DataStore(structStore, cloudStore, ztsMetric);
zts = new ZTSImpl(cloudStore, store);
ZTSImpl.serverHostName = "localhost";
authorizer = new ZTSAuthorizer(store);
// enable openid scope
AccessTokenRequest.setSupportOpenIdScope(true);
}
use of com.yahoo.athenz.zts.store.MockZMSFileChangeLogStore in project athenz by yahoo.
the class InstanceProviderManagerTest method setup.
@BeforeMethod
public void setup() {
// we want to make sure we start we clean dir structure
ZTSTestUtils.deleteDirectory(new File(ZTS_DATA_STORE_PATH));
File privKeyFile = new File(ZTS_PRIVATE_KEY);
String privKey = Crypto.encodedFile(privKeyFile);
privateKey = Crypto.loadPrivateKey(Crypto.ybase64DecodeString(privKey));
ChangeLogStore structStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", privateKey, "0");
System.setProperty(ZTSConsts.ZTS_PROP_PROVIDER_ENDPOINTS, ".athenz2.com,.athenz.com");
store = new DataStore(structStore, null, ztsMetric);
}
Aggregations