Search in sources :

Example 11 with PasswordPolicyStateAccountUsabilityWarning

use of com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning in project ldapsdk by pingidentity.

the class GetPasswordPolicyStateIssuesResponseControlTestCase method testSingleWarning.

/**
 * Tests the behavior for a control with only a single warning and no notices
 * or errors.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testSingleWarning() throws Exception {
    final List<PasswordPolicyStateAccountUsabilityNotice> notices = Collections.emptyList();
    final List<PasswordPolicyStateAccountUsabilityWarning> warnings = Collections.singletonList(new PasswordPolicyStateAccountUsabilityWarning(WARNING_TYPE_ACCOUNT_EXPIRING, WARNING_NAME_ACCOUNT_EXPIRING, "The account is expiring"));
    final List<PasswordPolicyStateAccountUsabilityError> errors = Collections.emptyList();
    GetPasswordPolicyStateIssuesResponseControl c = new GetPasswordPolicyStateIssuesResponseControl(notices, warnings, errors);
    c = new GetPasswordPolicyStateIssuesResponseControl().decodeControl(c.getOID(), c.isCritical(), c.getValue());
    assertNotNull(c.getOID());
    assertEquals(c.getOID(), "1.3.6.1.4.1.30221.2.5.47");
    assertFalse(c.isCritical());
    assertNotNull(c.getValue());
    assertNotNull(c.getNotices());
    assertTrue(c.getNotices().isEmpty());
    assertNotNull(c.getWarnings());
    assertFalse(c.getWarnings().isEmpty());
    assertEquals(c.getWarnings().size(), 1);
    assertEquals(c.getWarnings().get(0).getIntValue(), WARNING_TYPE_ACCOUNT_EXPIRING);
    assertEquals(c.getWarnings().get(0).getName(), WARNING_NAME_ACCOUNT_EXPIRING);
    assertEquals(c.getWarnings().get(0).getMessage(), "The account is expiring");
    assertNotNull(c.getErrors());
    assertTrue(c.getErrors().isEmpty());
    assertNull(c.getAuthenticationFailureReason());
    assertNotNull(c.getControlName());
    assertNotNull(c.toString());
}
Also used : PasswordPolicyStateAccountUsabilityNotice(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityNotice) PasswordPolicyStateAccountUsabilityError(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityError) PasswordPolicyStateAccountUsabilityWarning(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning) Test(org.testng.annotations.Test)

Example 12 with PasswordPolicyStateAccountUsabilityWarning

use of com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning in project ldapsdk by pingidentity.

the class ResultUtilsTestCase method getFormatResponseControlData.

/**
 * Retrieves a set of data for testing the {@code formatResponseControl}
 * method.
 *
 * @return  The test data.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@DataProvider(name = "formatResponseControlData")
public Iterator<Object[]> getFormatResponseControlData() throws Exception {
    final LinkedList<Object[]> resultList = new LinkedList<Object[]>();
    // A generic response control with no value.
    resultList.add(new Object[] { new Control("1.2.3.4"), Arrays.asList("#      Response Control:", "#           OID:  1.2.3.4", "#           Is Critical:  false") });
    // A generic response control with a value.
    resultList.add(new Object[] { new Control("1.2.3.4", true, new ASN1OctetString("control value")), Arrays.asList("#      Response Control:", "#           OID:  1.2.3.4", "#           Is Critical:  true", "#           Raw Value:", "#                63 6f 6e 74 72 6f 6c 20 76 61 6c 75 " + "65            control value") });
    // A valid authorization identity response control.
    resultList.add(new Object[] { new AuthorizationIdentityResponseControl("u:test.user"), Arrays.asList("#      Authorization Identity Response Control:", "#           OID:  " + AuthorizationIdentityResponseControl.AUTHORIZATION_IDENTITY_RESPONSE_OID, "#           Authorization ID:  u:test.user") });
    // An invalid authorization identity response control.
    resultList.add(new Object[] { new Control(AuthorizationIdentityResponseControl.AUTHORIZATION_IDENTITY_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + AuthorizationIdentityResponseControl.AUTHORIZATION_IDENTITY_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid content synchronization done response control.
    resultList.add(new Object[] { new ContentSyncDoneControl(new ASN1OctetString("cookie"), true), Arrays.asList("#      Content Synchronization Done Response Control:", "#           OID:  " + ContentSyncDoneControl.SYNC_DONE_OID, "#           Refresh Deletes:  true", "#           Cookie Data:", "#                63 6f 6f 6b 69 " + "65                                 cookie") });
    // An invalid content synchronization done response control.
    resultList.add(new Object[] { new Control(ContentSyncDoneControl.SYNC_DONE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + ContentSyncDoneControl.SYNC_DONE_OID, "#           Is Critical:  false") });
    // A valid content synchronization state response control.
    final UUID uuid = CryptoHelper.getRandomUUID();
    resultList.add(new Object[] { new ContentSyncStateControl(ContentSyncState.MODIFY, uuid, new ASN1OctetString("cookie")), Arrays.asList("#      Content Synchronization State Response Control:", "#           OID:  " + ContentSyncStateControl.SYNC_STATE_OID, "#           Entry UUID:  " + uuid.toString(), "#           Synchronization State:  MODIFY", "#           Cookie Data:", "#                63 6f 6f 6b 69 " + "65                                 cookie") });
    // An invalid content synchronization state response control.
    resultList.add(new Object[] { new Control(ContentSyncStateControl.SYNC_STATE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + ContentSyncStateControl.SYNC_STATE_OID, "#           Is Critical:  false") });
    // A valid entry change notification control.
    resultList.add(new Object[] { new EntryChangeNotificationControl(PersistentSearchChangeType.MODIFY_DN, "ou=People,dc=example,dc=com", 123456789L), Arrays.asList("#      Entry Change Notification Control:", "#           OID:  " + EntryChangeNotificationControl.ENTRY_CHANGE_NOTIFICATION_OID, "#           Change Type:  moddn", "#           Change Number:  123456789", "#           Previous DN:  ou=People,dc=example,dc=com") });
    // An invalid entry change notification control.
    resultList.add(new Object[] { new Control(EntryChangeNotificationControl.ENTRY_CHANGE_NOTIFICATION_OID), Arrays.asList("#      Response Control:", "#           OID:  " + EntryChangeNotificationControl.ENTRY_CHANGE_NOTIFICATION_OID, "#           Is Critical:  false") });
    // A valid password expired control.
    resultList.add(new Object[] { new PasswordExpiredControl(), Arrays.asList("#      Password Expired Response Control:", "#           OID:  " + PasswordExpiredControl.PASSWORD_EXPIRED_OID) });
    // An invalid password expired control.
    resultList.add(new Object[] { new Control(PasswordExpiredControl.PASSWORD_EXPIRED_OID, false, new ASN1OctetString("control value")), Arrays.asList("#      Response Control:", "#           OID:  " + PasswordExpiredControl.PASSWORD_EXPIRED_OID, "#           Is Critical:  false", "#           Raw Value:", "#                63 6f 6e 74 72 6f 6c 20 76 61 6c 75 " + "65            control value") });
    // A valid password expiring control.
    resultList.add(new Object[] { new PasswordExpiringControl(12345), Arrays.asList("#      Password Expiring Response Control:", "#           OID:  " + PasswordExpiringControl.PASSWORD_EXPIRING_OID, "#           Seconds Until Expiration:  12345") });
    // An invalid password expiring control.
    resultList.add(new Object[] { new Control(PasswordExpiringControl.PASSWORD_EXPIRING_OID), Arrays.asList("#      Response Control:", "#           OID:  " + PasswordExpiringControl.PASSWORD_EXPIRING_OID, "#           Is Critical:  false") });
    // A valid post-read response control.
    resultList.add(new Object[] { new PostReadResponseControl(new ReadOnlyEntry("dn: dc=example,dc=com", "objectClass: top", "objectClass: domain", "dc: example")), Arrays.asList("#      Post-Read Response Control:", "#           OID:  " + PostReadResponseControl.POST_READ_RESPONSE_OID, "#           Post-Read Entry:", "#                dn: dc=example,dc=com", "#                objectClass: top", "#                objectClass: domain", "#                dc: example") });
    // An invalid post-read response control.
    resultList.add(new Object[] { new Control(PostReadResponseControl.POST_READ_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + PostReadResponseControl.POST_READ_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid pre-read response control.
    resultList.add(new Object[] { new PreReadResponseControl(new ReadOnlyEntry("dn: dc=example,dc=com", "objectClass: top", "objectClass: domain", "dc: example")), Arrays.asList("#      Pre-Read Response Control:", "#           OID:  " + PreReadResponseControl.PRE_READ_RESPONSE_OID, "#           Pre-Read Entry:", "#                dn: dc=example,dc=com", "#                objectClass: top", "#                objectClass: domain", "#                dc: example") });
    // An invalid pre-read response control.
    resultList.add(new Object[] { new Control(PreReadResponseControl.PRE_READ_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + PreReadResponseControl.PRE_READ_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid server-side sort response control.
    resultList.add(new Object[] { new ServerSideSortResponseControl(ResultCode.INVALID_ATTRIBUTE_SYNTAX, "objectClass", false), Arrays.asList("#      Server-Side Sort Response Control:", "#           OID:  " + ServerSideSortResponseControl.SERVER_SIDE_SORT_RESPONSE_OID, "#           Result Code:  21 (invalid attribute syntax)", "#           Attribute Name:  objectClass") });
    // An invalid server-side sort response control.
    resultList.add(new Object[] { new Control(ServerSideSortResponseControl.SERVER_SIDE_SORT_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + ServerSideSortResponseControl.SERVER_SIDE_SORT_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid simple paged results response control.
    resultList.add(new Object[] { new SimplePagedResultsControl(12345, new ASN1OctetString("cookie")), Arrays.asList("#      Simple Paged Results Response Control:", "#           OID:  " + SimplePagedResultsControl.PAGED_RESULTS_OID, "#           Estimated Total Result Set Size:  12345", "#           Cookie Data:", "#                63 6f 6f 6b 69 " + "65                                 cookie") });
    // An invalid simple paged results response control.
    resultList.add(new Object[] { new Control(SimplePagedResultsControl.PAGED_RESULTS_OID), Arrays.asList("#      Response Control:", "#           OID:  " + SimplePagedResultsControl.PAGED_RESULTS_OID, "#           Is Critical:  false") });
    // A valid virtual list view response control.
    resultList.add(new Object[] { new VirtualListViewResponseControl(12345, 67890, ResultCode.SUCCESS, new ASN1OctetString("cookie")), Arrays.asList("#      Virtual List View Response Control:", "#           OID:  " + VirtualListViewResponseControl.VIRTUAL_LIST_VIEW_RESPONSE_OID, "#           Result Code:  0 (success)", "#           Estimated Content Count:  67890", "#           Target Position:  12345", "#           Context ID:", "#                63 6f 6f 6b 69 " + "65                                 cookie") });
    // An invalid virtual list view response control.
    resultList.add(new Object[] { new Control(VirtualListViewResponseControl.VIRTUAL_LIST_VIEW_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + VirtualListViewResponseControl.VIRTUAL_LIST_VIEW_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid account usable response control that indicates the account is
    // usable.
    resultList.add(new Object[] { new AccountUsableResponseControl(12345), Arrays.asList("#      Account Usable Response Control:", "#           OID:  " + AccountUsableResponseControl.ACCOUNT_USABLE_RESPONSE_OID, "#           Account Is Usable:  true", "#           Password Is Expired:  false", "#           Must Change Password:  false", "#           Account Is Inactive:  false", "#           Seconds Until Password Expiration:  12345") });
    // A valid account usable response control that indicates the account is not
    // usable.
    resultList.add(new Object[] { new AccountUsableResponseControl(true, true, true, 12345, 67890), Arrays.asList("#      Account Usable Response Control:", "#           OID:  " + AccountUsableResponseControl.ACCOUNT_USABLE_RESPONSE_OID, "#           Account Is Usable:  false", "#           Unusable Reasons:", "#                The account has been locked or deactivated.", "#                The password must be changed before any " + "other operations will be allowed.", "#                The password is expired.", "#                12345 grace logins are available.", "#                The account will be automatically unlocked " + "in 67890 seconds.", "#           Password Is Expired:  true", "#           Must Change Password:  true", "#           Account Is Inactive:  true", "#           Remaining Grace Logins:  12345", "#           Seconds Until Account Unlock:  67890") });
    // An invalid account usable response control.
    resultList.add(new Object[] { new Control(AccountUsableResponseControl.ACCOUNT_USABLE_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + AccountUsableResponseControl.ACCOUNT_USABLE_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid assured replication response control that indicates the account
    // is usable.
    resultList.add(new Object[] { new AssuredReplicationResponseControl(AssuredReplicationLocalLevel.PROCESSED_ALL_SERVERS, true, "local message", AssuredReplicationRemoteLevel.RECEIVED_ANY_REMOTE_LOCATION, false, "remote message", "csn", Arrays.asList(new AssuredReplicationServerResult(AssuredReplicationServerResultCode.COMPLETE, (short) 12345, (short) 12346), new AssuredReplicationServerResult(AssuredReplicationServerResultCode.TIMEOUT, (short) 12347, (short) 12348))), Arrays.asList("#      Assured Replication Response Control:", "#           OID:  " + AssuredReplicationResponseControl.ASSURED_REPLICATION_RESPONSE_OID, "#           Change Sequence Number:  csn", "#           Local Assurance Level:  PROCESSED_ALL_SERVERS", "#           Local Assurance Satisfied:  true", "#           Local Assurance Message:  local message", "#           Remote Assurance Level:  " + "RECEIVED_ANY_REMOTE_LOCATION", "#           Remote Assurance Satisfied:  false", "#           Remote Assurance Message:  remote message", "#           Server Result:", "#                Server Result Code:  COMPLETE", "#                Replication Server ID:  12345", "#                Replica ID:  12346", "#           Server Result:", "#                Server Result Code:  TIMEOUT", "#                Replication Server ID:  12347", "#                Replica ID:  12348") });
    // An invalid assured replication response control.
    resultList.add(new Object[] { new Control(AssuredReplicationResponseControl.ASSURED_REPLICATION_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + AssuredReplicationResponseControl.ASSURED_REPLICATION_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid generate password response control without a password expiration
    // time.
    resultList.add(new Object[] { new GeneratePasswordResponseControl("generated-password", false, (Long) null), Arrays.asList("#      Generate Password Response Control:", "#           OID:  " + GeneratePasswordResponseControl.GENERATE_PASSWORD_RESPONSE_OID, "#           Generated Password:  generated-password", "#           Must Change Password:  false") });
    // A valid generate password response control with a password expiration
    // time.
    resultList.add(new Object[] { new GeneratePasswordResponseControl("generated-password", true, 86400L), Arrays.asList("#      Generate Password Response Control:", "#           OID:  " + GeneratePasswordResponseControl.GENERATE_PASSWORD_RESPONSE_OID, "#           Generated Password:  generated-password", "#           Must Change Password:  true", "#           Seconds Until Expiration:  86400") });
    // An invalid generate password response control.
    resultList.add(new Object[] { new Control(GeneratePasswordResponseControl.GENERATE_PASSWORD_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + GeneratePasswordResponseControl.GENERATE_PASSWORD_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid get authorization entry response control for an unauthenticated
    // connection.
    resultList.add(new Object[] { new GetAuthorizationEntryResponseControl(false, true, "dn:", null, null, null), Arrays.asList("#      Get Authorization Entry Response Control:", "#           OID:  " + GetAuthorizationEntryResponseControl.GET_AUTHORIZATION_ENTRY_RESPONSE_OID, "#           Is Authenticated:  false") });
    // A valid get authorization entry response control for an authenticated
    // connection in which the authentication and authorization identities
    // match.
    resultList.add(new Object[] { new GetAuthorizationEntryResponseControl(true, true, "u:test.user", new ReadOnlyEntry("dn: uid=test.user,ou=People,dc=example,dc=com", "objectClass: top", "objectClass: person", "objectClass: organizationalPerson", "objectClass: inetOrgPerson", "uid: test.user", "givenName: Test", "sn: User", "cn: Test User"), null, null), Arrays.asList("#      Get Authorization Entry Response Control:", "#           OID:  " + GetAuthorizationEntryResponseControl.GET_AUTHORIZATION_ENTRY_RESPONSE_OID, "#           Is Authenticated:  true", "#           Authentication and Authorization Identities " + "Match:  true", "#           Authentication Identity ID:  u:test.user", "#           Authentication Identity Entry:", "#                dn: uid=test.user,ou=People,dc=example," + "dc=com", "#                objectClass: top", "#                objectClass: person", "#                objectClass: organizationalPerson", "#                objectClass: inetOrgPerson", "#                uid: test.user", "#                givenName: Test", "#                sn: User", "#                cn: Test User") });
    // A valid get authorization entry response control for an authenticated
    // connection in which the authentication and authorization identities
    // differ.
    resultList.add(new Object[] { new GetAuthorizationEntryResponseControl(true, false, "u:test.user", new ReadOnlyEntry("dn: uid=test.user,ou=People,dc=example,dc=com", "objectClass: top", "objectClass: person", "objectClass: organizationalPerson", "objectClass: inetOrgPerson", "uid: test.user", "givenName: Test", "sn: User", "cn: Test User"), "u:another.user", new ReadOnlyEntry("dn: uid=another.user,ou=People,dc=example,dc=com", "objectClass: top", "objectClass: person", "objectClass: organizationalPerson", "objectClass: inetOrgPerson", "uid: another.user", "givenName: Another", "sn: User", "cn: Another User")), Arrays.asList("#      Get Authorization Entry Response Control:", "#           OID:  " + GetAuthorizationEntryResponseControl.GET_AUTHORIZATION_ENTRY_RESPONSE_OID, "#           Is Authenticated:  true", "#           Authentication and Authorization Identities " + "Match:  false", "#           Authentication Identity ID:  u:test.user", "#           Authentication Identity Entry:", "#                dn: uid=test.user,ou=People,dc=example," + "dc=com", "#                objectClass: top", "#                objectClass: person", "#                objectClass: organizationalPerson", "#                objectClass: inetOrgPerson", "#                uid: test.user", "#                givenName: Test", "#                sn: User", "#                cn: Test User", "#           Authorization Identity ID:  u:another.user", "#           Authorization Identity Entry:", "#                dn: uid=another.user,ou=People,dc=example," + "dc=com", "#                objectClass: top", "#                objectClass: person", "#                objectClass: organizationalPerson", "#                objectClass: inetOrgPerson", "#                uid: another.user", "#                givenName: Another", "#                sn: User", "#                cn: Another User") });
    // An invalid get authorization identity response control.
    resultList.add(new Object[] { new Control(GetAuthorizationEntryResponseControl.GET_AUTHORIZATION_ENTRY_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + GetAuthorizationEntryResponseControl.GET_AUTHORIZATION_ENTRY_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid get backend set ID response control with a single backend set ID.
    resultList.add(new Object[] { new GetBackendSetIDResponseControl("rpID", "bsID"), Arrays.asList("#      Get Backend Set ID Response Control:", "#           OID:  " + GetBackendSetIDResponseControl.GET_BACKEND_SET_ID_RESPONSE_OID, "#           Entry-Balancing Request Processor ID:  rpID", "#           Backend Set ID:  bsID") });
    // A valid get backend set ID response control with multiple backend set
    // IDs.
    resultList.add(new Object[] { new GetBackendSetIDResponseControl("rpID", Arrays.asList("bs1", "bs2")), Arrays.asList("#      Get Backend Set ID Response Control:", "#           OID:  " + GetBackendSetIDResponseControl.GET_BACKEND_SET_ID_RESPONSE_OID, "#           Entry-Balancing Request Processor ID:  rpID", "#           Backend Set ID:  bs1", "#           Backend Set ID:  bs2") });
    // An invalid get backend set ID response control.
    resultList.add(new Object[] { new Control(GetBackendSetIDResponseControl.GET_BACKEND_SET_ID_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + GetBackendSetIDResponseControl.GET_BACKEND_SET_ID_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid get password policy state issues response control without any
    // issues.
    resultList.add(new Object[] { new GetPasswordPolicyStateIssuesResponseControl(null, null, null), Arrays.asList("#      Get Password Policy State Issues Response Control:", "#           OID:  " + GetPasswordPolicyStateIssuesResponseControl.GET_PASSWORD_POLICY_STATE_ISSUES_RESPONSE_OID) });
    // A valid get password policy state issues response control with multiple
    // notices, warnings, and errors, and an authentication failure reason
    resultList.add(new Object[] { new GetPasswordPolicyStateIssuesResponseControl(Arrays.asList(new PasswordPolicyStateAccountUsabilityNotice(PasswordPolicyStateAccountUsabilityNotice.NOTICE_TYPE_IN_MINIMUM_PASSWORD_AGE, PasswordPolicyStateAccountUsabilityNotice.NOTICE_NAME_IN_MINIMUM_PASSWORD_AGE, "You can't change your password yet"), new PasswordPolicyStateAccountUsabilityNotice(PasswordPolicyStateAccountUsabilityNotice.NOTICE_TYPE_OUTSTANDING_RETIRED_PASSWORD, PasswordPolicyStateAccountUsabilityNotice.NOTICE_NAME_OUTSTANDING_RETIRED_PASSWORD, "You have a valid retired password")), Arrays.asList(new PasswordPolicyStateAccountUsabilityWarning(PasswordPolicyStateAccountUsabilityWarning.WARNING_TYPE_ACCOUNT_EXPIRING, PasswordPolicyStateAccountUsabilityWarning.WARNING_NAME_ACCOUNT_EXPIRING, "Your account will expire soon"), new PasswordPolicyStateAccountUsabilityWarning(PasswordPolicyStateAccountUsabilityWarning.WARNING_TYPE_PASSWORD_EXPIRING, PasswordPolicyStateAccountUsabilityWarning.WARNING_NAME_PASSWORD_EXPIRING, "Your password will expire soon")), Arrays.asList(new PasswordPolicyStateAccountUsabilityError(PasswordPolicyStateAccountUsabilityError.ERROR_TYPE_ACCOUNT_DISABLED, PasswordPolicyStateAccountUsabilityError.ERROR_NAME_ACCOUNT_DISABLED, "Your account is disabled"), new PasswordPolicyStateAccountUsabilityError(PasswordPolicyStateAccountUsabilityError.ERROR_TYPE_ACCOUNT_EXPIRED, PasswordPolicyStateAccountUsabilityError.ERROR_NAME_ACCOUNT_EXPIRED, "Your account is expired")), new AuthenticationFailureReason(AuthenticationFailureReason.FAILURE_TYPE_ACCOUNT_NOT_USABLE, AuthenticationFailureReason.FAILURE_NAME_ACCOUNT_NOT_USABLE, "Your account is not usable")), Arrays.asList("#      Get Password Policy State Issues Response Control:", "#           OID:  " + GetPasswordPolicyStateIssuesResponseControl.GET_PASSWORD_POLICY_STATE_ISSUES_RESPONSE_OID, "#           Authentication Failure Reason:", "#                Failure Type:  account-not-usable", "#                Failure Message:  Your account is not usable", "#           Account Usability Error:", "#                Error Name:  account-disabled", "#                Error Message:  Your account is disabled", "#           Account Usability Error:", "#                Error Name:  account-expired", "#                Error Message:  Your account is expired", "#           Account Usability Warning:", "#                Warning Name:  account-expiring", "#                Warning Message:  Your account will expire " + "soon", "#           Account Usability Warning:", "#                Warning Name:  password-expiring", "#                Warning Message:  Your password will " + "expire soon", "#           Account Usability Notice:", "#                Notice Name:  in-minimum-password-age", "#                Notice Message:  You can't change your " + "password yet", "#           Account Usability Notice:", "#                Notice Name:  outstanding-retired-password", "#                Notice Message:  You have a valid retired " + "password") });
    // An invalid get password policy state issues response control.
    resultList.add(new Object[] { new Control(GetPasswordPolicyStateIssuesResponseControl.GET_PASSWORD_POLICY_STATE_ISSUES_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + GetPasswordPolicyStateIssuesResponseControl.GET_PASSWORD_POLICY_STATE_ISSUES_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid get recent login history response control without any successful
    // or failed attempts.
    resultList.add(new Object[] { new GetRecentLoginHistoryResponseControl(new RecentLoginHistory(null, null)), Arrays.asList("#      Get Recent Login History Response Control:", "#           OID:  " + GetRecentLoginHistoryResponseControl.GET_RECENT_LOGIN_HISTORY_RESPONSE_OID, "#           No Successful Attempts", "#           No Failed Attempts") });
    // A valid get recent login history response control with both successful
    // and failed attempts.
    final long currentTime = System.currentTimeMillis();
    final TreeSet<RecentLoginHistoryAttempt> successes = new TreeSet<>();
    successes.add(new RecentLoginHistoryAttempt(true, currentTime, "simple", "1.2.3.4", null, 0L));
    final TreeSet<RecentLoginHistoryAttempt> failures = new TreeSet<>();
    failures.add(new RecentLoginHistoryAttempt(false, (currentTime - 5_000L), "simple", "1.2.3.4", "invalid-credentials", 1L));
    RecentLoginHistory recentLoginHistory = new RecentLoginHistory(successes, failures);
    resultList.add(new Object[] { new GetRecentLoginHistoryResponseControl(recentLoginHistory), Arrays.asList("#      Get Recent Login History Response Control:", "#           OID:  " + GetRecentLoginHistoryResponseControl.GET_RECENT_LOGIN_HISTORY_RESPONSE_OID, "#           Successful Attempt:", "#                Timestamp:  " + StaticUtils.encodeRFC3339Time(currentTime), "#                Authentication Method:  simple", "#                Client IP Address:  1.2.3.4", "#                Additional Attempt Count:  0", "#           Failed Attempt:", "#                Timestamp:  " + StaticUtils.encodeRFC3339Time(currentTime - 5_000L), "#                Authentication Method:  simple", "#                Client IP Address:  1.2.3.4", "#                Failure Reason:  invalid-credentials", "#                Additional Attempt Count:  1") });
    // An invalid recent login history response control.
    resultList.add(new Object[] { new Control(GetRecentLoginHistoryResponseControl.GET_RECENT_LOGIN_HISTORY_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + GetRecentLoginHistoryResponseControl.GET_RECENT_LOGIN_HISTORY_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid get server ID response control.
    resultList.add(new Object[] { new GetServerIDResponseControl("serverID"), Arrays.asList("#      Get Server ID Response Control:", "#           OID:  " + GetServerIDResponseControl.GET_SERVER_ID_RESPONSE_OID, "#           Server ID:  serverID") });
    // An invalid get server ID response control.
    resultList.add(new Object[] { new Control(GetServerIDResponseControl.GET_SERVER_ID_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + GetServerIDResponseControl.GET_SERVER_ID_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid get user resource limits response control with a minimal set of
    // fields and unlimited values where possible.
    resultList.add(new Object[] { new GetUserResourceLimitsResponseControl(0L, 0L, 0L, 0L, null, null), Arrays.asList("#      Get User Resource Limits Response Control:", "#           OID:  " + GetUserResourceLimitsResponseControl.GET_USER_RESOURCE_LIMITS_RESPONSE_OID, "#           Size Limit:  Unlimited", "#           Time Limit:  Unlimited", "#           Idle Time Limit:  Unlimited", "#           Lookthrough Limit:  Unlimited") });
    // A valid get user resource limits response control with all fields and
    // definite limits.
    resultList.add(new Object[] { new GetUserResourceLimitsResponseControl(12345L, 67890L, 98765L, 54321L, "uid=equivalent.user,ou=People,dc=example,dc=com", "CCP", Arrays.asList("cn=Group 1,ou=Groups,dc=example,dc=com", "cn=Group 2,ou=Groups,dc=example,dc=com"), Arrays.asList("bypass-read-acl", "config-read"), Arrays.asList(new Attribute("other-attr-1", "value1"), new Attribute("other-attr-2", "value2"))), Arrays.asList("#      Get User Resource Limits Response Control:", "#           OID:  " + GetUserResourceLimitsResponseControl.GET_USER_RESOURCE_LIMITS_RESPONSE_OID, "#           Size Limit:  12345", "#           Time Limit:  67890 seconds", "#           Idle Time Limit:  98765 seconds", "#           Lookthrough Limit:  54321", "#           Equivalent Authorization User DN:  " + "uid=equivalent.user,ou=People,dc=example,dc=com", "#           Client Connection Policy Name:  CCP", "#           Group DNs:", "#                cn=Group 1,ou=Groups,dc=example,dc=com", "#                cn=Group 2,ou=Groups,dc=example,dc=com", "#           Privileges:", "#                bypass-read-acl", "#                config-read", "#           Other Attributes:", "#                other-attr-1: value1", "#                other-attr-2: value2") });
    // An invalid get user resource limits response control.
    resultList.add(new Object[] { new Control(GetUserResourceLimitsResponseControl.GET_USER_RESOURCE_LIMITS_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + GetUserResourceLimitsResponseControl.GET_USER_RESOURCE_LIMITS_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid intermediate client response control.
    resultList.add(new Object[] { new IntermediateClientResponseControl(new IntermediateClientResponseValue(new IntermediateClientResponseValue(null, "upstream.server.address", false, "upstreamServerName", "upstreamSessionID", "upstreamResponseID"), "intermediate.server.address", true, "intermediateServerName", "intermediateSessionID", "intermediateResponseID")), Arrays.asList("#      Intermediate Client Response Control:", "#           OID:  " + IntermediateClientResponseControl.INTERMEDIATE_CLIENT_RESPONSE_OID, "#           Upstream Server Address:  " + "intermediate.server.address", "#           Upstream Server Secure:  true", "#           Server Name:  intermediateServerName", "#           Server Session ID:  intermediateSessionID", "#           Server Response ID:  intermediateResponseID", "#           Upstream Response:", "#                Upstream Server Address:  " + "upstream.server.address", "#                Upstream Server Secure:  false", "#                Server Name:  upstreamServerName", "#                Server Session ID:  upstreamSessionID", "#                Server Response ID:  upstreamResponseID") });
    // An invalid intermediate client response control.
    resultList.add(new Object[] { new Control(IntermediateClientResponseControl.INTERMEDIATE_CLIENT_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + IntermediateClientResponseControl.INTERMEDIATE_CLIENT_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid join result control.
    resultList.add(new Object[] { new JoinResultControl(ResultCode.SUCCESS, "diag", "dc=example,dc=com", Arrays.asList("ldap://ds1.example.com:389/dc=example,dc=com", "ldap://ds2.example.com:389/dc=example,dc=com"), Arrays.asList(new JoinedEntry(new ReadOnlyEntry("dn: ou=joined 1,dc=example,dc=com", "objectClass: top", "objectClass: organizationalUnit", "ou: joined 1"), Arrays.asList(new JoinedEntry(new ReadOnlyEntry("dn: ou=joined 1a,dc=example,dc=com", "objectClass: top", "objectClass: organizationalUnit", "ou: joined 1a"), null), new JoinedEntry(new ReadOnlyEntry("dn: ou=joined 1b,dc=example,dc=com", "objectClass: top", "objectClass: organizationalUnit", "ou: joined 1b"), null))), new JoinedEntry(new ReadOnlyEntry("dn: ou=joined 2,dc=example,dc=com", "objectClass: top", "objectClass: organizationalUnit", "ou: joined 2"), Arrays.asList(new JoinedEntry(new ReadOnlyEntry("dn: ou=joined 2a,dc=example,dc=com", "objectClass: top", "objectClass: organizationalUnit", "ou: joined 2a"), null), new JoinedEntry(new ReadOnlyEntry("dn: ou=joined 2b,dc=example,dc=com", "objectClass: top", "objectClass: organizationalUnit", "ou: joined 2b"), null))))), Arrays.asList("#      Join Result Control:", "#           OID:  " + JoinResultControl.JOIN_RESULT_OID, "#           Join Result Code:  0 (success)", "#           Join Diagnostic Message:  diag", "#           Join Matched DN:  dc=example,dc=com", "#           Join Referral URL:  " + "ldap://ds1.example.com:389/dc=example,dc=com", "#           Join Referral URL:  " + "ldap://ds2.example.com:389/dc=example,dc=com", "#           Joined With Entry:", "#                dn: ou=joined 1,dc=example,dc=com", "#                objectClass: top", "#                objectClass: organizationalUnit", "#                ou: joined 1", "#                     Joined With Entry:", "#                          dn: ou=joined 1a,dc=example,dc=com", "#                          objectClass: top", "#                          objectClass: organizationalUnit", "#                          ou: joined 1a", "#                     Joined With Entry:", "#                          dn: ou=joined 1b,dc=example,dc=com", "#                          objectClass: top", "#                          objectClass: organizationalUnit", "#                          ou: joined 1b", "#           Joined With Entry:", "#                dn: ou=joined 2,dc=example,dc=com", "#                objectClass: top", "#                objectClass: organizationalUnit", "#                ou: joined 2", "#                     Joined With Entry:", "#                          dn: ou=joined 2a,dc=example,dc=com", "#                          objectClass: top", "#                          objectClass: organizationalUnit", "#                          ou: joined 2a", "#                     Joined With Entry:", "#                          dn: ou=joined 2b,dc=example,dc=com", "#                          objectClass: top", "#                          objectClass: organizationalUnit", "#                          ou: joined 2b") });
    // An invalid join result control.
    resultList.add(new Object[] { new Control(JoinResultControl.JOIN_RESULT_OID), Arrays.asList("#      Response Control:", "#           OID:  " + JoinResultControl.JOIN_RESULT_OID, "#           Is Critical:  false") });
    // A valid matching entry count response control for an examined count.
    resultList.add(new Object[] { MatchingEntryCountResponseControl.createExactCountResponse(12345, true, true, true, false, true, Filter.createEqualityFilter("objectClass", "person"), Arrays.asList("debug message 1", "debug message 2")), Arrays.asList("#      Matching Entry Count Response Control:", "#           OID:  " + MatchingEntryCountResponseControl.MATCHING_ENTRY_COUNT_RESPONSE_OID, "#           Count Type:  Examined", "#           Count Value:  12345", "#           Search Is Indexed:  true", "#           Short Circuited:  true", "#           Fully Indexed:  false", "#           Candidates Are in Scope:  true", "#           Remaining Filter:  (objectClass=person)", "#           Debug Info:", "#                debug message 1", "#                debug message 2") });
    // A valid matching entry count response control for an unexamined count.
    resultList.add(new Object[] { MatchingEntryCountResponseControl.createExactCountResponse(67890, false, true, Arrays.asList("debug message 1", "debug message 2")), Arrays.asList("#      Matching Entry Count Response Control:", "#           OID:  " + MatchingEntryCountResponseControl.MATCHING_ENTRY_COUNT_RESPONSE_OID, "#           Count Type:  Unexamined", "#           Count Value:  67890", "#           Search Is Indexed:  true", "#           Debug Info:", "#                debug message 1", "#                debug message 2") });
    // A valid matching entry count response control for an upper bound count.
    resultList.add(new Object[] { MatchingEntryCountResponseControl.createUpperBoundResponse(98765, false, Arrays.asList("debug message 1", "debug message 2")), Arrays.asList("#      Matching Entry Count Response Control:", "#           OID:  " + MatchingEntryCountResponseControl.MATCHING_ENTRY_COUNT_RESPONSE_OID, "#           Count Type:  Upper Bound", "#           Count Value:  98765", "#           Search Is Indexed:  false", "#           Debug Info:", "#                debug message 1", "#                debug message 2") });
    // A valid matching entry count response control for an unknown count.
    resultList.add(new Object[] { MatchingEntryCountResponseControl.createUnknownCountResponse(Arrays.asList("debug message 1", "debug message 2")), Arrays.asList("#      Matching Entry Count Response Control:", "#           OID:  " + MatchingEntryCountResponseControl.MATCHING_ENTRY_COUNT_RESPONSE_OID, "#           Count Type:  Unknown", "#           Search Is Indexed:  false", "#           Debug Info:", "#                debug message 1", "#                debug message 2") });
    // An invalid matching entry count response control.
    resultList.add(new Object[] { new Control(MatchingEntryCountResponseControl.MATCHING_ENTRY_COUNT_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + MatchingEntryCountResponseControl.MATCHING_ENTRY_COUNT_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid password policy response control for a password that is about to
    // expire.
    resultList.add(new Object[] { new PasswordPolicyResponseControl(PasswordPolicyWarningType.TIME_BEFORE_EXPIRATION, 12345, null), Arrays.asList("#      Password Policy Response Control:", "#           OID:  " + PasswordPolicyResponseControl.PASSWORD_POLICY_RESPONSE_OID, "#           Error Type:  None", "#           Warning Type:  time before expiration", "#           Warning Value:  12345") });
    // A valid password policy response control for an account that is locked.
    resultList.add(new Object[] { new PasswordPolicyResponseControl(null, -1, PasswordPolicyErrorType.ACCOUNT_LOCKED), Arrays.asList("#      Password Policy Response Control:", "#           OID:  " + PasswordPolicyResponseControl.PASSWORD_POLICY_RESPONSE_OID, "#           Error Type:  account locked", "#           Warning Type:  None") });
    // An invalid password policy response control.
    resultList.add(new Object[] { new Control(PasswordPolicyResponseControl.PASSWORD_POLICY_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + PasswordPolicyResponseControl.PASSWORD_POLICY_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid password validation details response control for a validation
    // details response.
    final LinkedHashMap<String, String> r1Map = new LinkedHashMap<String, String>(2);
    r1Map.put("prop1a", "value1a");
    r1Map.put("prop1b", "value1b");
    final LinkedHashMap<String, String> r2Map = new LinkedHashMap<String, String>(2);
    r2Map.put("prop2a", "value2a");
    r2Map.put("prop2b", "value2b");
    resultList.add(new Object[] { new PasswordValidationDetailsResponseControl(PasswordValidationDetailsResponseType.VALIDATION_DETAILS, Arrays.asList(new PasswordQualityRequirementValidationResult(new PasswordQualityRequirement("Requirement 1", "first-requirement", r1Map), true, "Requirement 1 was satisfied"), new PasswordQualityRequirementValidationResult(new PasswordQualityRequirement("Requirement 2", "second-requirement", r2Map), false, "Requirement 2 was not satisfied")), false, true, 12345), Arrays.asList("#      Password Validation Details Response Control:", "#           OID:  " + PasswordValidationDetailsResponseControl.PASSWORD_VALIDATION_DETAILS_RESPONSE_OID, "#           Result Type:  Validation Result", "#                Password Quality Requirement Validation " + "Result:", "#                     Password Quality Requirement " + "Description:  Requirement 1", "#                     Client-Side Validation Type:  " + "first-requirement", "#                     Client-Side Validation Property:  " + "prop1a=value1a", "#                     Client-Side Validation Property:  " + "prop1b=value1b", "#                     Requirement Satisfied:  true", "#                     Additional Validation Info:  " + "Requirement 1 was satisfied", "#                Password Quality Requirement Validation " + "Result:", "#                     Password Quality Requirement " + "Description:  Requirement 2", "#                     Client-Side Validation Type:  " + "second-requirement", "#                     Client-Side Validation Property:  " + "prop2a=value2a", "#                     Client-Side Validation Property:  " + "prop2b=value2b", "#                     Requirement Satisfied:  false", "#                     Additional Validation Info:  " + "Requirement 2 was not satisfied", "#           Missing Current Password:  false", "#           Must Change Password:  true", "#           Seconds Until Expiration:  12345") });
    // A valid password validation details response control for a "no password
    // provided" response.
    resultList.add(new Object[] { new PasswordValidationDetailsResponseControl(PasswordValidationDetailsResponseType.NO_PASSWORD_PROVIDED, null, true, false, null), Arrays.asList("#      Password Validation Details Response Control:", "#           OID:  " + PasswordValidationDetailsResponseControl.PASSWORD_VALIDATION_DETAILS_RESPONSE_OID, "#           Result Type:  No Password Provided", "#           Missing Current Password:  true", "#           Must Change Password:  false") });
    // A valid password validation details response control for a "multiple
    // passwords provided" response.
    resultList.add(new Object[] { new PasswordValidationDetailsResponseControl(PasswordValidationDetailsResponseType.MULTIPLE_PASSWORDS_PROVIDED, null, true, false, null), Arrays.asList("#      Password Validation Details Response Control:", "#           OID:  " + PasswordValidationDetailsResponseControl.PASSWORD_VALIDATION_DETAILS_RESPONSE_OID, "#           Result Type:  Multiple Passwords Provided", "#           Missing Current Password:  true", "#           Must Change Password:  false") });
    // A valid password validation details response control for a "no validation
    // attempted" response.
    resultList.add(new Object[] { new PasswordValidationDetailsResponseControl(PasswordValidationDetailsResponseType.NO_VALIDATION_ATTEMPTED, null, true, false, null), Arrays.asList("#      Password Validation Details Response Control:", "#           OID:  " + PasswordValidationDetailsResponseControl.PASSWORD_VALIDATION_DETAILS_RESPONSE_OID, "#           Result Type:  No Validation Attempted", "#           Missing Current Password:  true", "#           Must Change Password:  false") });
    // An invalid password validation details response control.
    resultList.add(new Object[] { new Control(PasswordValidationDetailsResponseControl.PASSWORD_VALIDATION_DETAILS_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + PasswordValidationDetailsResponseControl.PASSWORD_VALIDATION_DETAILS_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid soft delete response control.
    resultList.add(new Object[] { new SoftDeleteResponseControl("ou=test+entryUUID=" + uuid.toString() + ",dc=example,dc=com"), Arrays.asList("#      Soft Delete Response Control:", "#           OID:  " + SoftDeleteResponseControl.SOFT_DELETE_RESPONSE_OID, "#           Soft-Deleted Entry DN:  ou=test+entryUUID=" + uuid.toString() + ",dc=example,dc=com") });
    // An invalid soft delete response control.
    resultList.add(new Object[] { new Control(SoftDeleteResponseControl.SOFT_DELETE_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + SoftDeleteResponseControl.SOFT_DELETE_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid transaction settings response control.
    resultList.add(new Object[] { new TransactionSettingsResponseControl(12345, true), Arrays.asList("#      Transaction Settings Response Control:", "#           OID:  " + TransactionSettingsResponseControl.TRANSACTION_SETTINGS_RESPONSE_OID, "#           Number of Lock Conflicts:  12345", "#           Backend Lock Acquired:  true") });
    // An invalid transaction settings response control.
    resultList.add(new Object[] { new Control(TransactionSettingsResponseControl.TRANSACTION_SETTINGS_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + TransactionSettingsResponseControl.TRANSACTION_SETTINGS_RESPONSE_OID, "#           Is Critical:  false") });
    // A valid uniqueness response control in which all of the tests passed.
    resultList.add(new Object[] { new UniquenessResponseControl("all-passed", true, true, null), Arrays.asList("#      Uniqueness Response Control:", "#           OID:  " + UniquenessResponseControl.UNIQUENESS_RESPONSE_OID, "#           Uniqueness ID:  all-passed", "#           Pre-Commit Validation Status:  Passed", "#           Post-Commit Validation Status:  Passed") });
    // A valid uniqueness response control in which the pre-commit attempt
    // failed.
    resultList.add(new Object[] { new UniquenessResponseControl("pre-commit-failed", false, null, "The pre-commit attempt failed"), Arrays.asList("#      Uniqueness Response Control:", "#           OID:  " + UniquenessResponseControl.UNIQUENESS_RESPONSE_OID, "#           Uniqueness ID:  pre-commit-failed", "#           Pre-Commit Validation Status:  Failed", "#           Post-Commit Validation Status:  Not Attempted", "#           Message:  The pre-commit attempt failed") });
    // A valid uniqueness response control in which the pre-commit attempt
    // passed but the post-commit attempt failed.
    resultList.add(new Object[] { new UniquenessResponseControl("post-commit-failed", true, false, "The post-commit attempt failed"), Arrays.asList("#      Uniqueness Response Control:", "#           OID:  " + UniquenessResponseControl.UNIQUENESS_RESPONSE_OID, "#           Uniqueness ID:  post-commit-failed", "#           Pre-Commit Validation Status:  Passed", "#           Post-Commit Validation Status:  Failed", "#           Message:  The post-commit attempt failed") });
    // A valid uniqueness response control in which no validation was attempted.
    resultList.add(new Object[] { new UniquenessResponseControl("not-attempted", null, null, "No validation was attempted"), Arrays.asList("#      Uniqueness Response Control:", "#           OID:  " + UniquenessResponseControl.UNIQUENESS_RESPONSE_OID, "#           Uniqueness ID:  not-attempted", "#           Pre-Commit Validation Status:  Not Attempted", "#           Post-Commit Validation Status:  Not Attempted", "#           Message:  No validation was attempted") });
    // An invalid uniqueness response control.
    resultList.add(new Object[] { new Control(UniquenessResponseControl.UNIQUENESS_RESPONSE_OID), Arrays.asList("#      Response Control:", "#           OID:  " + UniquenessResponseControl.UNIQUENESS_RESPONSE_OID, "#           Is Critical:  false") });
    return resultList.iterator();
}
Also used : JoinResultControl(com.unboundid.ldap.sdk.unboundidds.controls.JoinResultControl) PasswordPolicyStateAccountUsabilityError(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityError) AuthorizationIdentityResponseControl(com.unboundid.ldap.sdk.controls.AuthorizationIdentityResponseControl) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) AccountUsableResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.AccountUsableResponseControl) LinkedHashMap(java.util.LinkedHashMap) PasswordQualityRequirement(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordQualityRequirement) GetAuthorizationEntryResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetAuthorizationEntryResponseControl) TreeSet(java.util.TreeSet) AssuredReplicationResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.AssuredReplicationResponseControl) UUID(java.util.UUID) PostReadResponseControl(com.unboundid.ldap.sdk.controls.PostReadResponseControl) RecentLoginHistory(com.unboundid.ldap.sdk.unboundidds.controls.RecentLoginHistory) GetRecentLoginHistoryResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetRecentLoginHistoryResponseControl) IntermediateClientResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.IntermediateClientResponseControl) LinkedList(java.util.LinkedList) IntermediateClientResponseValue(com.unboundid.ldap.sdk.unboundidds.controls.IntermediateClientResponseValue) GetBackendSetIDResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetBackendSetIDResponseControl) AuthenticationFailureReason(com.unboundid.ldap.sdk.unboundidds.controls.AuthenticationFailureReason) ContentSyncDoneControl(com.unboundid.ldap.sdk.controls.ContentSyncDoneControl) EntryChangeNotificationControl(com.unboundid.ldap.sdk.controls.EntryChangeNotificationControl) PreReadResponseControl(com.unboundid.ldap.sdk.controls.PreReadResponseControl) PasswordExpiringControl(com.unboundid.ldap.sdk.controls.PasswordExpiringControl) GetUserResourceLimitsResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetUserResourceLimitsResponseControl) SoftDeleteResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.SoftDeleteResponseControl) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) RecentLoginHistoryAttempt(com.unboundid.ldap.sdk.unboundidds.controls.RecentLoginHistoryAttempt) Attribute(com.unboundid.ldap.sdk.Attribute) GetServerIDResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetServerIDResponseControl) JoinedEntry(com.unboundid.ldap.sdk.unboundidds.controls.JoinedEntry) IntermediateClientResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.IntermediateClientResponseControl) TransactionSettingsResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.TransactionSettingsResponseControl) Control(com.unboundid.ldap.sdk.Control) UniquenessResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.UniquenessResponseControl) SimplePagedResultsControl(com.unboundid.ldap.sdk.controls.SimplePagedResultsControl) PasswordValidationDetailsResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.PasswordValidationDetailsResponseControl) VirtualListViewResponseControl(com.unboundid.ldap.sdk.controls.VirtualListViewResponseControl) GetPasswordPolicyStateIssuesResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetPasswordPolicyStateIssuesResponseControl) AccountUsableResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.AccountUsableResponseControl) GetServerIDResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetServerIDResponseControl) SoftDeleteResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.SoftDeleteResponseControl) PasswordExpiredControl(com.unboundid.ldap.sdk.controls.PasswordExpiredControl) PasswordExpiringControl(com.unboundid.ldap.sdk.controls.PasswordExpiringControl) PostReadResponseControl(com.unboundid.ldap.sdk.controls.PostReadResponseControl) GetAuthorizationEntryResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetAuthorizationEntryResponseControl) ServerSideSortResponseControl(com.unboundid.ldap.sdk.controls.ServerSideSortResponseControl) MatchingEntryCountResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.MatchingEntryCountResponseControl) GeneratePasswordResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GeneratePasswordResponseControl) EntryChangeNotificationControl(com.unboundid.ldap.sdk.controls.EntryChangeNotificationControl) GetUserResourceLimitsResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetUserResourceLimitsResponseControl) AssuredReplicationResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.AssuredReplicationResponseControl) ContentSyncStateControl(com.unboundid.ldap.sdk.controls.ContentSyncStateControl) GetRecentLoginHistoryResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetRecentLoginHistoryResponseControl) JoinResultControl(com.unboundid.ldap.sdk.unboundidds.controls.JoinResultControl) GetBackendSetIDResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetBackendSetIDResponseControl) PasswordPolicyResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.PasswordPolicyResponseControl) PreReadResponseControl(com.unboundid.ldap.sdk.controls.PreReadResponseControl) AuthorizationIdentityResponseControl(com.unboundid.ldap.sdk.controls.AuthorizationIdentityResponseControl) ContentSyncDoneControl(com.unboundid.ldap.sdk.controls.ContentSyncDoneControl) PasswordPolicyResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.PasswordPolicyResponseControl) GeneratePasswordResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GeneratePasswordResponseControl) GetPasswordPolicyStateIssuesResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.GetPasswordPolicyStateIssuesResponseControl) AssuredReplicationServerResult(com.unboundid.ldap.sdk.unboundidds.controls.AssuredReplicationServerResult) PasswordValidationDetailsResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.PasswordValidationDetailsResponseControl) TransactionSettingsResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.TransactionSettingsResponseControl) ServerSideSortResponseControl(com.unboundid.ldap.sdk.controls.ServerSideSortResponseControl) ReadOnlyEntry(com.unboundid.ldap.sdk.ReadOnlyEntry) VirtualListViewResponseControl(com.unboundid.ldap.sdk.controls.VirtualListViewResponseControl) PasswordPolicyStateAccountUsabilityNotice(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityNotice) ContentSyncStateControl(com.unboundid.ldap.sdk.controls.ContentSyncStateControl) PasswordQualityRequirementValidationResult(com.unboundid.ldap.sdk.unboundidds.controls.PasswordQualityRequirementValidationResult) PasswordPolicyStateAccountUsabilityWarning(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning) SimplePagedResultsControl(com.unboundid.ldap.sdk.controls.SimplePagedResultsControl) PasswordExpiredControl(com.unboundid.ldap.sdk.controls.PasswordExpiredControl) UniquenessResponseControl(com.unboundid.ldap.sdk.unboundidds.controls.UniquenessResponseControl) DataProvider(org.testng.annotations.DataProvider)

Example 13 with PasswordPolicyStateAccountUsabilityWarning

use of com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning in project ldapsdk by pingidentity.

the class ManageAccountTestCase method testAllSuccessResult.

/**
 * Tests the behavior when running the tool and expecting a success result.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testAllSuccessResult() throws Exception {
    // Get an instance of the manage-account tool that we will run to generate a
    // sample variable rate data file.  Not only can we use this file to get
    // test coverage later, but we can also use the tool instance to get the
    // argument parser available so that we can introspect it to get information
    // about what arguments we can use.
    final String variableRateDataFile = createTempFile().getAbsolutePath();
    final ManageAccount tool = new ManageAccount(null, null);
    assertEquals(tool.runTool("--generateSampleRateFile", variableRateDataFile), ResultCode.SUCCESS);
    final ArgumentParser parser = tool.getArgumentParser();
    assertNotNull(parser);
    // Create some other files that will be used for testing.
    final String rejectFile = createTempFile().getAbsolutePath();
    final String dnFile = createTempFile("# Comment at the top", "uid=user.1,ou=People,dc=example,dc=com", "# Comment in the middle. Also, blank line follows.", "", "uid=user.2,ou=People,dc=example,dc=com", "dn:uid=user.3,ou=People,dc=example,dc=com", "dn: uid=user.4,ou=People,dc=example,dc=com", "dn::" + Base64.encode("uid=user.5,ou=People,dc=example,dc=com"), "dn:: " + Base64.encode("uid=user.6,ou=People,dc=example,dc=com"), "", "# Comment at the end").getAbsolutePath();
    // Create an in-memory directory server instance with fake support for the
    // password policy state extended operation.
    final InMemoryDirectoryServerConfig cfg = new InMemoryDirectoryServerConfig("dc=example,dc=com");
    final String[] referralURLs = { "ldap://ds1.example.com:389/dc=example,dc=com", "ldap://ds2.example.com:389/dc=example,dc=com" };
    final PasswordPolicyStateOperation[] resultOperations = { new PasswordPolicyStateOperation(PasswordPolicyStateOperation.OP_TYPE_GET_ACCOUNT_DISABLED_STATE, new ASN1OctetString[] { new ASN1OctetString("false") }), new PasswordPolicyStateOperation(PasswordPolicyStateOperation.OP_TYPE_GET_FAILURE_LOCKOUT_TIME, null), new PasswordPolicyStateOperation(PasswordPolicyStateOperation.OP_TYPE_GET_ACCOUNT_USABILITY_NOTICES, new ASN1OctetString[] { new ASN1OctetString(new PasswordPolicyStateAccountUsabilityNotice(PasswordPolicyStateAccountUsabilityNotice.NOTICE_TYPE_IN_MINIMUM_PASSWORD_AGE, PasswordPolicyStateAccountUsabilityNotice.NOTICE_NAME_IN_MINIMUM_PASSWORD_AGE, "notice message").toString()), new ASN1OctetString("Notice 2") }), new PasswordPolicyStateOperation(PasswordPolicyStateOperation.OP_TYPE_GET_ACCOUNT_USABILITY_WARNINGS, new ASN1OctetString[] { new ASN1OctetString(new PasswordPolicyStateAccountUsabilityWarning(PasswordPolicyStateAccountUsabilityWarning.WARNING_TYPE_ACCOUNT_EXPIRING, PasswordPolicyStateAccountUsabilityWarning.WARNING_NAME_ACCOUNT_EXPIRING, "warning message").toString()), new ASN1OctetString("Warning 2") }), new PasswordPolicyStateOperation(PasswordPolicyStateOperation.OP_TYPE_GET_ACCOUNT_USABILITY_ERRORS, new ASN1OctetString[] { new ASN1OctetString(new PasswordPolicyStateAccountUsabilityError(PasswordPolicyStateAccountUsabilityError.ERROR_TYPE_ACCOUNT_EXPIRED, PasswordPolicyStateAccountUsabilityError.ERROR_NAME_ACCOUNT_EXPIRED, "error message").toString()), new ASN1OctetString("Error 2") }) };
    cfg.addExtendedOperationHandler(new CannedResponsePWPStateInMemoryExtendedOperationHandler(new PasswordPolicyStateExtendedResult(-1, ResultCode.SUCCESS, "Success", "ou=Matched DN,dc=example,dc=com", referralURLs, "uid=test.user,ou=People,dc=example,dc=com", resultOperations, null)));
    final InMemoryDirectoryServer ds = new InMemoryDirectoryServer(cfg);
    ds.startListening();
    try {
        final ArrayList<String> argList = new ArrayList<String>(20);
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        for (final ManageAccountSubCommandType t : ManageAccountSubCommandType.values()) {
            for (final String name : t.getAllNames()) {
                argList.clear();
                argList.add(name);
                argList.add("--hostname");
                argList.add("127.0.0.1");
                argList.add("--port");
                argList.add(String.valueOf(ds.getListenPort()));
                argList.add("--targetDN");
                argList.add("uid=test.user,ou=People,dc=example,dc=com");
                final SubCommand sc = parser.getSubCommand(name);
                assertNotNull(sc);
                final ArgumentParser subCommandParser = sc.getArgumentParser();
                final Argument a = subCommandParser.getNamedArgument('O');
                if (a == null) {
                    String[] args = argList.toArray(StaticUtils.NO_STRINGS);
                    assertEquals(ManageAccount.main(out, out, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                    out.reset();
                    args = argList.toArray(StaticUtils.NO_STRINGS);
                    assertEquals(ManageAccount.main(out, out, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                    continue;
                }
                if (!a.isRequired()) {
                    out.reset();
                    String[] args = argList.toArray(StaticUtils.NO_STRINGS);
                    assertEquals(ManageAccount.main(null, null, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                    argList.add("--suppressEmptyResultOperations");
                    args = argList.toArray(StaticUtils.NO_STRINGS);
                    out.reset();
                    assertEquals(ManageAccount.main(null, null, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                    argList.remove(argList.size() - 1);
                }
                final String value1;
                final String value2;
                if (a instanceof BooleanValueArgument) {
                    value1 = "true";
                    value2 = "false";
                } else if (a instanceof StringArgument) {
                    if (sc.hasName("set-last-login-ip-address")) {
                        value1 = "1.2.3.4";
                        value2 = "5.6.7.8";
                    } else {
                        value1 = "value 1";
                        value2 = "value 2";
                    }
                } else if (a instanceof TimestampArgument) {
                    final long now = System.currentTimeMillis();
                    value1 = StaticUtils.encodeGeneralizedTime(now - 1L);
                    value2 = StaticUtils.encodeGeneralizedTime(now);
                } else {
                    throw new AssertionError("Unexpected argument type for argument " + a.getIdentifierString() + " in subcommand " + name + ":  " + a.getClass().getName());
                }
                argList.add("--ratePerSecond");
                argList.add("100");
                argList.add("--variableRateData");
                argList.add(variableRateDataFile);
                argList.add("--rejectFile");
                argList.add(rejectFile);
                argList.add("--targetDNFile");
                argList.add(dnFile);
                argList.add("--numThreads");
                argList.add("10");
                argList.add("--numSearchThreads");
                argList.add("10");
                argList.add(a.getIdentifierString());
                argList.add(value1);
                out.reset();
                String[] args = argList.toArray(StaticUtils.NO_STRINGS);
                assertEquals(ManageAccount.main(null, null, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                out.reset();
                argList.add("--suppressEmptyResultOperations");
                args = argList.toArray(StaticUtils.NO_STRINGS);
                assertEquals(ManageAccount.main(null, null, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                argList.remove(argList.size() - 1);
                if (a.getMaxOccurrences() > 1) {
                    argList.add(a.getIdentifierString());
                    argList.add(value2);
                    out.reset();
                    args = argList.toArray(StaticUtils.NO_STRINGS);
                    assertEquals(ManageAccount.main(null, null, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                    out.reset();
                    argList.add("--suppressEmptyResultOperations");
                    args = argList.toArray(StaticUtils.NO_STRINGS);
                    assertEquals(ManageAccount.main(null, null, args), ResultCode.SUCCESS, "Failed with arguments " + argList + ":  " + StaticUtils.toUTF8String(out.toByteArray()));
                    argList.remove(argList.size() - 1);
                }
            }
        }
    } finally {
        ds.shutDown(true);
    }
}
Also used : ASN1OctetString(com.unboundid.asn1.ASN1OctetString) PasswordPolicyStateAccountUsabilityError(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityError) BooleanValueArgument(com.unboundid.util.args.BooleanValueArgument) Argument(com.unboundid.util.args.Argument) StringArgument(com.unboundid.util.args.StringArgument) TimestampArgument(com.unboundid.util.args.TimestampArgument) InMemoryDirectoryServerConfig(com.unboundid.ldap.listener.InMemoryDirectoryServerConfig) ArrayList(java.util.ArrayList) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) PasswordPolicyStateExtendedResult(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateExtendedResult) ArgumentParser(com.unboundid.util.args.ArgumentParser) BooleanValueArgument(com.unboundid.util.args.BooleanValueArgument) TimestampArgument(com.unboundid.util.args.TimestampArgument) SubCommand(com.unboundid.util.args.SubCommand) InMemoryDirectoryServer(com.unboundid.ldap.listener.InMemoryDirectoryServer) PasswordPolicyStateOperation(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateOperation) ByteArrayOutputStream(java.io.ByteArrayOutputStream) StringArgument(com.unboundid.util.args.StringArgument) PasswordPolicyStateAccountUsabilityNotice(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityNotice) PasswordPolicyStateAccountUsabilityWarning(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning) Test(org.testng.annotations.Test)

Example 14 with PasswordPolicyStateAccountUsabilityWarning

use of com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning in project ldapsdk by pingidentity.

the class PasswordPolicyStateJSON method getAccountUsabilityWarnings.

/**
 * Retrieves a list of information about any warning conditions that may soon
 * affect usability of the user's account.
 *
 * @return  A list of information about any warning conditions that may soon
 *          affect the usability of the user's account.  The returned list may
 *          be empty if there are no account usability warnings or if this was
 *          not included in the password policy state JSON object.
 */
@NotNull()
public List<PasswordPolicyStateAccountUsabilityWarning> getAccountUsabilityWarnings() {
    final List<PasswordPolicyStateAccountUsabilityWarning> warnings = new ArrayList<>();
    final List<JSONValue> values = passwordPolicyStateObject.getFieldAsArray(ACCOUNT_USABILITY_WARNINGS.getFieldName());
    if (values != null) {
        for (final JSONValue v : values) {
            if (v instanceof JSONObject) {
                final JSONObject o = (JSONObject) v;
                final String typeName = o.getFieldAsString(USABILITY_FIELD_TYPE_NAME);
                final Integer typeID = o.getFieldAsInteger(USABILITY_FIELD_TYPE_ID);
                final String message = o.getFieldAsString(USABILITY_FIELD_MESSAGE);
                if ((typeName != null) && (typeID != null)) {
                    warnings.add(new PasswordPolicyStateAccountUsabilityWarning(typeID, typeName, message));
                }
            }
        }
    }
    return Collections.unmodifiableList(warnings);
}
Also used : JSONValue(com.unboundid.util.json.JSONValue) JSONObject(com.unboundid.util.json.JSONObject) ArrayList(java.util.ArrayList) PasswordPolicyStateAccountUsabilityWarning(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning) JSONString(com.unboundid.util.json.JSONString) NotNull(com.unboundid.util.NotNull)

Example 15 with PasswordPolicyStateAccountUsabilityWarning

use of com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning in project ldapsdk by pingidentity.

the class GetPasswordPolicyStateIssuesResponseControl method encodeValue.

/**
 * Encodes the provided information into an ASN.1 octet string suitable for
 * use as the value of this control.
 *
 * @param  notices            The set of password policy state usability
 *                            notices to include.  It may be {@code null} or
 *                            empty if there are no notices.
 * @param  warnings           The set of password policy state usability
 *                            warnings to include.  It may be {@code null} or
 *                            empty if there are no warnings.
 * @param  errors             The set of password policy state usability
 *                            errors to include.  It may be {@code null} or
 *                            empty if there are no errors.
 * @param  authFailureReason  The authentication failure reason for the bind
 *                            operation.  It may be {@code null} if there is
 *                            no authentication failure reason.
 *
 * @return  The ASN.1 octet string containing the encoded control value.
 */
@NotNull()
private static ASN1OctetString encodeValue(@Nullable final List<PasswordPolicyStateAccountUsabilityNotice> notices, @Nullable final List<PasswordPolicyStateAccountUsabilityWarning> warnings, @Nullable final List<PasswordPolicyStateAccountUsabilityError> errors, @Nullable final AuthenticationFailureReason authFailureReason) {
    final ArrayList<ASN1Element> elements = new ArrayList<>(4);
    if ((notices != null) && (!notices.isEmpty())) {
        final ArrayList<ASN1Element> noticeElements = new ArrayList<>(notices.size());
        for (final PasswordPolicyStateAccountUsabilityNotice n : notices) {
            if (n.getMessage() == null) {
                noticeElements.add(new ASN1Sequence(new ASN1Integer(n.getIntValue()), new ASN1OctetString(n.getName())));
            } else {
                noticeElements.add(new ASN1Sequence(new ASN1Integer(n.getIntValue()), new ASN1OctetString(n.getName()), new ASN1OctetString(n.getMessage())));
            }
        }
        elements.add(new ASN1Sequence(TYPE_NOTICES, noticeElements));
    }
    if ((warnings != null) && (!warnings.isEmpty())) {
        final ArrayList<ASN1Element> warningElements = new ArrayList<>(warnings.size());
        for (final PasswordPolicyStateAccountUsabilityWarning w : warnings) {
            if (w.getMessage() == null) {
                warningElements.add(new ASN1Sequence(new ASN1Integer(w.getIntValue()), new ASN1OctetString(w.getName())));
            } else {
                warningElements.add(new ASN1Sequence(new ASN1Integer(w.getIntValue()), new ASN1OctetString(w.getName()), new ASN1OctetString(w.getMessage())));
            }
        }
        elements.add(new ASN1Sequence(TYPE_WARNINGS, warningElements));
    }
    if ((errors != null) && (!errors.isEmpty())) {
        final ArrayList<ASN1Element> errorElements = new ArrayList<>(errors.size());
        for (final PasswordPolicyStateAccountUsabilityError e : errors) {
            if (e.getMessage() == null) {
                errorElements.add(new ASN1Sequence(new ASN1Integer(e.getIntValue()), new ASN1OctetString(e.getName())));
            } else {
                errorElements.add(new ASN1Sequence(new ASN1Integer(e.getIntValue()), new ASN1OctetString(e.getName()), new ASN1OctetString(e.getMessage())));
            }
        }
        elements.add(new ASN1Sequence(TYPE_ERRORS, errorElements));
    }
    if (authFailureReason != null) {
        if (authFailureReason.getMessage() == null) {
            elements.add(new ASN1Sequence(TYPE_AUTH_FAILURE_REASON, new ASN1Integer(authFailureReason.getIntValue()), new ASN1OctetString(authFailureReason.getName())));
        } else {
            elements.add(new ASN1Sequence(TYPE_AUTH_FAILURE_REASON, new ASN1Integer(authFailureReason.getIntValue()), new ASN1OctetString(authFailureReason.getName()), new ASN1OctetString(authFailureReason.getMessage())));
        }
    }
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
}
Also used : ASN1OctetString(com.unboundid.asn1.ASN1OctetString) PasswordPolicyStateAccountUsabilityNotice(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityNotice) ASN1Sequence(com.unboundid.asn1.ASN1Sequence) PasswordPolicyStateAccountUsabilityError(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityError) ASN1Element(com.unboundid.asn1.ASN1Element) ArrayList(java.util.ArrayList) PasswordPolicyStateAccountUsabilityWarning(com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning) ASN1Integer(com.unboundid.asn1.ASN1Integer) NotNull(com.unboundid.util.NotNull)

Aggregations

PasswordPolicyStateAccountUsabilityWarning (com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityWarning)16 PasswordPolicyStateAccountUsabilityError (com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityError)15 PasswordPolicyStateAccountUsabilityNotice (com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateAccountUsabilityNotice)15 Test (org.testng.annotations.Test)10 Control (com.unboundid.ldap.sdk.Control)5 ASN1OctetString (com.unboundid.asn1.ASN1OctetString)4 LDAPException (com.unboundid.ldap.sdk.LDAPException)4 AuthenticationFailureReason (com.unboundid.ldap.sdk.unboundidds.controls.AuthenticationFailureReason)4 ArrayList (java.util.ArrayList)4 NotNull (com.unboundid.util.NotNull)3 BindResult (com.unboundid.ldap.sdk.BindResult)2 Entry (com.unboundid.ldap.sdk.Entry)2 PasswordPolicyStateExtendedResult (com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateExtendedResult)2 PasswordPolicyStateOperation (com.unboundid.ldap.sdk.unboundidds.extensions.PasswordPolicyStateOperation)2 JSONObject (com.unboundid.util.json.JSONObject)2 JSONString (com.unboundid.util.json.JSONString)2 JSONValue (com.unboundid.util.json.JSONValue)2 LinkedHashMap (java.util.LinkedHashMap)2 ASN1Element (com.unboundid.asn1.ASN1Element)1 ASN1Integer (com.unboundid.asn1.ASN1Integer)1