use of org.neo4j.ogm.domain.gh777.UserInfo in project OA4MP by ncsa.
the class LDAPSSLSocketFactory method main.
public static void main(String[] args) {
try {
DebugUtil.dbg(LDAPSSLSocketFactory.class, System.getProperty("java.home") + "/lib/security/cacerts");
DebugUtil.setIsEnabled(true);
// System.setProperty("javax.net.debug", "ssl");
JSONObject json = JSONObject.fromObject(ldap);
LDAPConfiguration ldapConfiguration = LDAPConfigurationUtil.fromJSON(json);
setLdapConfiguration(ldapConfiguration);
ldapConfiguration.setContextName("");
getSslConfiguration().setTlsVersion(SSLConfigurationUtil.TLS_1_2);
getSslConfiguration().setUseDefaultJavaTrustStore(false);
getSslConfiguration().setKeystoreType("JKS");
getSslConfiguration().setKeystorePassword("changeit");
getSslConfiguration().setKeystore("/home/ncsa/temp/java-certs/cacerts2");
getSslConfiguration().setTrustRootType("JKS");
getSslConfiguration().setTrustRootPassword("changeit");
getSslConfiguration().setTrustRootPath("/home/ncsa/temp/java-certs/cacerts2");
LDAPClaimsSource x = new LDAPClaimsSource(ldapConfiguration, null);
LDAPSSLSocketFactory.setLdapConfiguration(ldapConfiguration);
x.createConnection();
UserInfo userInfo = new UserInfo();
userInfo.getMap().putAll(x.simpleSearch(x.context, "http://cilogon.org/serverA/users/10376", ldapConfiguration.getSearchAttributes()));
System.out.println(userInfo);
} catch (Throwable t) {
t.printStackTrace();
}
}
use of org.neo4j.ogm.domain.gh777.UserInfo in project OA4MP by ncsa.
the class OA2CLCCommands method get_user_info.
public void get_user_info(InputLine inputLine) throws Exception {
if (showHelp(inputLine)) {
getUIHelp();
return;
}
UserInfo userInfo = getService().getUserInfo(dummyAsset.getIdentifier().toString());
say("user info:");
for (String key : userInfo.getMap().keySet()) {
say(" " + key + " = " + userInfo.getMap().get(key));
}
}
use of org.neo4j.ogm.domain.gh777.UserInfo in project neo4j-ogm by neo4j.
the class SingleUseEntityMapperTest method oneTimeSetUp.
@BeforeClass
public static void oneTimeSetUp() {
sessionFactory = new SessionFactory(getDriver(), "org.neo4j.ogm.domain.gh551", "org.neo4j.ogm.domain.gh391", "org.neo4j.ogm.domain.gh750", "org.neo4j.ogm.domain.gh777", "org.neo4j.ogm.domain.cineasts.minimum", "org.neo4j.ogm.domain.gh813", "org.neo4j.ogm.domain.gh873");
// Prepare test data
Session session = sessionFactory.openSession();
session.query("MATCH (n) DETACH DELETE n", EMPTY_MAP);
session.query("unwind range(1,10) as x with x create (n:ThingEntity {name: 'Thing ' + x}) return n", EMPTY_MAP);
Actor actor = new Actor("A1");
Movie movie = new Movie("M1");
Role role = new Role("R1", actor, movie);
session.save(role);
movie = new Movie("M2");
role = new Role("R2", actor, movie);
session.save(role);
session.save(new UserInfo("Foo", "Bar", "i@do.com"));
MyNode myNode = new MyNode();
myNode.setId("the-id");
myNode.setType("the-type");
myNode.getAttributes().put("a1", "v1");
myNode.getAttributes().put("a2", "v2");
session.save(myNode);
}
use of org.neo4j.ogm.domain.gh777.UserInfo in project archiva-redback-core by apache.
the class NativeRoleServiceTest method getAssignedUsersNonRecursive.
@Test
void getAssignedUsersNonRecursive() {
String token = getAdminToken();
Map<String, Object> jsonAsMap = new HashMap<>();
jsonAsMap.put("user_id", "aragorn");
jsonAsMap.put("email", "aragorn@lordoftherings.org");
jsonAsMap.put("full_name", "Aragorn King of Gondor ");
jsonAsMap.put("password", "pAssw0rD");
try {
given().spec(getRequestSpec(token, getUserServicePath())).contentType(JSON).body(jsonAsMap).when().post().then().statusCode(201);
given().spec(getRequestSpec(token)).contentType(JSON).when().put("archiva-global-repository-observer/user/aragorn").then().statusCode(200);
Response result = given().spec(getRequestSpec(token)).contentType(JSON).when().get("archiva-global-repository-observer/user").then().statusCode(200).extract().response();
assertNotNull(result);
PagedResult<UserInfo> userResult = result.getBody().jsonPath().getObject("", PagedResult.class);
assertNotNull(userResult);
assertEquals(1, userResult.getPagination().getTotalCount());
List<UserInfo> users = result.getBody().jsonPath().getList("data", UserInfo.class);
assertArrayEquals(new String[] { "aragorn" }, users.stream().map(BaseUserInfo::getUserId).sorted().toArray(String[]::new));
} finally {
given().spec(getRequestSpec(token, getUserServicePath())).contentType(JSON).when().delete("aragorn").then().statusCode(200);
}
}
use of org.neo4j.ogm.domain.gh777.UserInfo in project archiva-redback-core by apache.
the class NativeRoleServiceTest method updateRole.
@Test
void updateRole() {
String token = getAdminToken();
try {
Response response = given().spec(getRequestSpec(token)).contentType(JSON).when().put("templates/archiva-repository-manager/repository13").then().statusCode(201).extract().response();
assertNotNull(response);
RoleInfo roleInfo = response.getBody().jsonPath().getObject("", RoleInfo.class);
Map<String, Object> jsonAsMap = new HashMap<>();
jsonAsMap.put("id", roleInfo.getId());
jsonAsMap.put("name", roleInfo.getName());
jsonAsMap.put("description", "This description was updated.");
response = given().spec(getRequestSpec(token)).contentType(JSON).when().body(jsonAsMap).patch(roleInfo.getId()).then().statusCode(200).extract().response();
assertNotNull(response);
RoleInfo updatedRole = response.getBody().jsonPath().getObject("", RoleInfo.class);
assertEquals(roleInfo.getId(), updatedRole.getId());
assertEquals(roleInfo.getName(), updatedRole.getName());
assertEquals("This description was updated.", updatedRole.getDescription());
assertEquals(true, updatedRole.isAssignable());
assertEquals(false, updatedRole.isPermanent());
response = given().spec(getRequestSpec(token)).contentType(JSON).when().get("archiva-repository-manager.repository13/user").then().extract().response();
List<UserInfo> userList = response.getBody().jsonPath().getList("data", UserInfo.class);
assertEquals(0, userList.size());
} finally {
given().spec(getRequestSpec(token)).contentType(JSON).when().delete("templates/archiva-repository-manager/repository13").then().statusCode(200);
given().spec(getRequestSpec(token)).contentType(JSON).when().delete("templates/archiva-repository-observer/repository13").then().statusCode(200);
}
}
Aggregations