Skip to content

Commit

Permalink
Lint i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
fdaugan committed Mar 3, 2024
1 parent 99377a2 commit 0c15d2c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Cache resources TTL can be overridden from Configuration API with `cache.$name.t
| service:id:ldap:people-internal-dn | ou=internal,ou=people,dc=sample,dc=com | DN within the people DN to separate internal (writable) users from the other. (not yet fully implemented). |
| service:id:ldap:quarantine-dn | ou=quarantine,dc=sample,dc=com | DN outside the people DN. Receive the users moved from their source without deleting them. |
| service:id:ldap:self-search | false | When `true`, at authentication time, the admin credentials are used search and filter the user, and then the credentials are verified. |
| | | When `false`, the user's credentials are checked without search. Suports only `service:id:ldap:login-attributes` = `uid,mail`. |
| | | When `false`, the user's credentials are checked without search. Supports only `service:id:ldap:login-attributes` = `uid,mail`. |
| service:id:ldap:uid-attribute | uid | LDAP attribute name user identifier. |
| service:id:ldap:url | ldap://localhost:389 | This value is encrypted in database. |
| service:id:ldap:user-dn | cn=Manager,dc=sample,dc=com | DN of administrator. |
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ private void validateGroup(final String group, final String ou, final String pke
}

/**
* Search the LDAP Groups matching to the given criteria and for type "Project". Node identifier is ignored for now.
* Search the LDAP groups matching to the given criteria and of type "Project". Node identifier is ignored for now.
*
* @param criteria the search criteria.
* @return LDAP Groups matching the criteria.
Expand Down Expand Up @@ -709,7 +709,7 @@ public List<INamableBean<String>> findGroupsByName(@PathParam("criteria") final

/**
* Search the LDAP Customers matching to the given criteria and for type "Project". Node identifier is ignored for
* now. Node is ignored.
* now.
*
* @param criteria the search criteria.
* @return LDAP Customers matching the criteria.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void zzdeleteFromParentGroup() {
final Subscription childSubscription = createSubGroup(parentSubscription.getProject(), "sea-parent-for-2deletion",
"sea-parent-for-2deletion-sub");

// Check the sub-group and the parent are there
// Check the subgroup and the parent are there
Assertions.assertEquals(2, resource.findGroupsByName("sea-parent-for-2deletion").size());
final Map<String, String> parentParameters = subscriptionResource.getParameters(parentSubscription.getId());
Assertions.assertTrue(resource.checkSubscriptionStatus(parentParameters).getStatus().isUp());
Expand All @@ -82,7 +82,7 @@ void zzdeleteFromParentGroup() {
Assertions.assertEquals(1, resource.findGroupsByName("sea-parent-for-2deletion").size());
Assertions.assertTrue(getGroup().findAll().get("sea-parent-for-2deletion").getSubGroups().isEmpty());
Assertions.assertNull(getGroup().findAll().get("sea-parent-for-2deletion-sub"));
Assertions.assertEquals("sea-parent-for-2deletion", resource.findGroupsByName("sea-parent-for-2deletion").get(0).getId());
Assertions.assertEquals("sea-parent-for-2deletion", resource.findGroupsByName("sea-parent-for-2deletion").getFirst().getId());
Assertions.assertNull(getGroup().findAllNoCache().get("sea-parent-for-2deletion-sub"));

// Check the new status of the deleted child
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ protected void checkResult(final TableItem<UserOrgVo> tableItem) {
Assertions.assertEquals(1, tableItem.getRecordsFiltered());
Assertions.assertEquals(1, tableItem.getData().size());

final UserOrgVo userLdap = tableItem.getData().get(0);
final UserOrgVo userLdap = tableItem.getData().getFirst();
Assertions.assertEquals("flasta", userLdap.getId());
Assertions.assertEquals("Firsta", userLdap.getFirstName());
Assertions.assertEquals("Lasta", userLdap.getLastName());
Assertions.assertEquals("ing", userLdap.getCompany());
Assertions.assertEquals("flasta@ing.com", userLdap.getMails().get(0));
Assertions.assertEquals("flasta@ing.com", userLdap.getMails().getFirst());
Assertions.assertEquals(1, userLdap.getGroups().size());
Assertions.assertEquals("DIG RHA", userLdap.getGroups().get(0).getName());
Assertions.assertEquals("DIG RHA", userLdap.getGroups().getFirst().getName());
}

@Override
Expand Down Expand Up @@ -130,7 +130,7 @@ protected void findById(final UserOrg userLdap) {
Assertions.assertEquals("Fabrice", userLdap.getFirstName());
Assertions.assertEquals("Daugan", userLdap.getLastName());
Assertions.assertEquals("ligoj", userLdap.getCompany());
Assertions.assertEquals("fabrice.daugan@sample.com", userLdap.getMails().get(0));
Assertions.assertEquals("fabrice.daugan@sample.com", userLdap.getMails().getFirst());
Assertions.assertEquals(1, userLdap.getGroups().size());
Assertions.assertEquals("Hub Paris", userLdap.getGroups().iterator().next());
}
Expand All @@ -150,20 +150,20 @@ protected void rollbackUser() {
Assertions.assertEquals(1, tableItem.getRecordsFiltered());
Assertions.assertEquals(1, tableItem.getData().size());

UserOrgVo userLdap = tableItem.getData().get(0);
UserOrgVo userLdap = tableItem.getData().getFirst();
Assertions.assertEquals("jlast3", userLdap.getId());
Assertions.assertEquals("John3", userLdap.getFirstName());
Assertions.assertEquals("Last3", userLdap.getLastName());
Assertions.assertEquals("ing", userLdap.getCompany());
Assertions.assertEquals("john3.last3@ing.com", userLdap.getMails().get(0));
Assertions.assertEquals("john3.last3@ing.com", userLdap.getMails().getFirst());
Assertions.assertEquals(0, userLdap.getGroups().size());
}

protected DirContextAdapter getContext(final String base, final String uid) {
final AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("objectclass", "inetOrgPerson"));
filter.and(new EqualsFilter("objectClass", "inetOrgPerson"));
filter.and(new EqualsFilter("uid", uid));
return getTemplate().search(base, filter.encode(), (Object ctx) -> (DirContextAdapter) ctx).get(0);
return getTemplate().search(base, filter.encode(), (Object ctx) -> (DirContextAdapter) ctx).getFirst();
}

protected DirContextAdapter getContext(final String uid) {
Expand All @@ -186,10 +186,10 @@ protected void checkDnAndMember(final DirContextAdapter context, final String dn
*/
protected void checkMember(final String dn) {
final AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("objectclass", "groupOfUniqueNames"));
filter.and(new EqualsFilter("objectClass", "groupOfUniqueNames"));
filter.and(new EqualsFilter("cn", "ligoj-Jupiter"));
final DirContextAdapter groupContext = getTemplate()
.search("ou=ligoj,ou=project,dc=sample,dc=com", filter.encode(), (Object ctx) -> (DirContextAdapter) ctx).get(0);
.search("ou=ligoj,ou=project,dc=sample,dc=com", filter.encode(), (Object ctx) -> (DirContextAdapter) ctx).getFirst();
final String[] members = groupContext.getStringAttributes("uniqueMember");
Assertions.assertEquals(1, members.length);
Assertions.assertEquals(dn, members[0]);
Expand All @@ -215,7 +215,7 @@ protected DirContextAdapter checkUnlockedAfter() {
}

protected DirContextAdapter checkUnlocked() {
assertUnlocked(resource.findAll("ligoj", null, "admin-test", newUriInfo()).getData().get(0));
assertUnlocked(resource.findAll("ligoj", null, "admin-test", newUriInfo()).getData().getFirst());
assertUnlocked(getUser().findByIdNoCache("admin-test"));
assertUnlocked(getUser().findById("admin-test"));
Assertions.assertTrue(getGroup().findAll().get("ligoj-jupiter").getMembers().contains("admin-test"));
Expand All @@ -228,7 +228,7 @@ protected DirContextAdapter checkUnlocked() {
protected DirContextAdapter check(final String company, final String base, final String patternLocked,
final Consumer<SimpleUserOrg> checker) {
// Check the status at business layer
checker.accept(resource.findAll(company, null, "admin-test", newUriInfo()).getData().get(0));
checker.accept(resource.findAll(company, null, "admin-test", newUriInfo()).getData().getFirst());
checker.accept(resource.findById("admin-test"));

// Check the status at cache layer
Expand Down

0 comments on commit 0c15d2c

Please sign in to comment.