Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.AuthenticationIdentity


        NotesUsernameType.findUsernameType("Invalid Name");
    assertNull(usernameType);
  }

  private AuthenticationIdentity getUserId() {
    return new AuthenticationIdentity() {

      @Override
      public String getDomain() {
        return "internet.com";
      }
View Full Code Here


    dnString = "CN=Test User1,,,DC=example,DC=com";
    assertEquals("example", IdentityUtil.getFirstDomainFromDN(dnString));
  }

  public void testGetCanonicalUsername() {
    AuthenticationIdentity identity =
        new SimpleAuthenticationIdentity("", DmInitialize.DM_PWD_OK1);
    String result = IdentityUtil.getCanonicalUsername(identity);
    assertEquals(null, result);

    identity =
View Full Code Here

    result = IdentityUtil.getCanonicalUsername(identity);
    assertEquals("Mary", result);
  }

  public void testGetDomain() {
    AuthenticationIdentity identity =
        new SimpleAuthenticationIdentity("", DmInitialize.DM_PWD_OK1);
    String result = IdentityUtil.getDomain(identity);
    assertEquals(null, result);

    identity =
View Full Code Here

   * @throws RepositoryException if an unexpected error occurs
   */
  public void testShowHiddenItems_true() throws RepositoryException {
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100", "2101"), responses);
  }
View Full Code Here

  public void testShowHiddenItems_false() throws RepositoryException {
    conn.setShowHiddenItems("false");
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100"), responses);
  }
View Full Code Here

  public void testHiddenItemSubtypes() throws RepositoryException {
    // Treated as false, does not ignore documents.
    conn.setShowHiddenItems("{ 144 }");
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100"), responses);
  }
View Full Code Here

  /** Tests a small authZ request with partially authorized results. */
  public void testAuthorizeDocids_small() throws RepositoryException {
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    Collection<AuthorizationResponse> responses =
        lam.authorizeDocids(ImmutableSet.of("2100", "2101", "2102", "2103"),
            identity);
    assertPermittedDocs(ImmutableSet.of("2100", "2101"), responses);
  }
View Full Code Here

   * (1000 docids per query), with partially authorized results.
   */
  public void testAuthorizeDocids_large() throws RepositoryException {
    afterInit();

    AuthenticationIdentity identity = new SimpleAuthenticationIdentity("fred");
    ImmutableSet.Builder<String> builder = new ImmutableSet.Builder<String>();
    for (int i = 2100; i < 3300; i++) {
      builder.add(String.valueOf(i));
    }
    Collection<AuthorizationResponse> responses =
View Full Code Here

        assertFalse("invalid user", authenticate("foo", "test"));
    }

    private boolean authenticate(String username, String password) {
        try {
            AuthenticationIdentity identity =
                new SimpleAuthenticationIdentity(username, password);
            return manager.authenticate(identity).isValid();
        }
        catch (RepositoryException e) {
            return false;
View Full Code Here

    SiteDiscoveryHelper siteDisc =
        new SiteDiscoveryHelper(sharepointClientContext, null);
    SharepointAuthorizationManager authMan = new SharepointAuthorizationManager(
        clientFactory, this.sharepointClientContext,
        siteDisc.getMatchingSiteCollections());
    AuthenticationIdentity authID = new SimpleAuthenticationIdentity(
        TestConfiguration.searchUserID, TestConfiguration.searchUserPwd);

    Set<String> docids = new HashSet<String>();
    docids.add(TestConfiguration.SearchDocID1);
    docids.add(TestConfiguration.SearchDocID2);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.AuthenticationIdentity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.