Package org.apache.shindig.auth

Examples of org.apache.shindig.auth.BasicSecurityTokenCodec


      testName = testName + ".xml";
    }

    String gadgetUrl = EndToEndServer.SERVER_URL + '/' + testName;
    String url = EndToEndServer.GADGET_BASEURL + "?url=" + URLEncoder.encode(gadgetUrl, "UTF-8");
    BasicSecurityTokenCodec codec = new BasicSecurityTokenCodec();
    url += "&st=" + URLEncoder.encode(codec.encodeToken(token), "UTF-8");
    if (testMethod != null) {
      url += "&testMethod=" + URLEncoder.encode(testMethod, "UTF-8");
    }
    if (caja) {
      url += "&caja=1&libs=caja";
View Full Code Here


  }

  SecurityTokenCodec getCodecByType(String tokenType) {
    if ("insecure".equals(tokenType)) {
      if (this.insecureCodec == null) {
        this.insecureCodec = new BasicSecurityTokenCodec(this.config);
      }
      return this.insecureCodec;
    }

    if ("secure".equals(tokenType)) {
View Full Code Here

      testName = testName + ".xml";
    }

    String gadgetUrl = EndToEndServer.SERVER_URL + '/' + testName;
    String url = EndToEndServer.GADGET_BASEURL + "?url=" + URLEncoder.encode(gadgetUrl, "UTF-8");
    BasicSecurityTokenCodec codec = new BasicSecurityTokenCodec();
    url += "&st=" + URLEncoder.encode(codec.encodeToken(token), "UTF-8");
    if (testMethod != null) {
      url += "&testMethod=" + URLEncoder.encode(testMethod, "UTF-8");
    }
    if (caja) {
      url += "&caja=1&libs=caja";
View Full Code Here

  @Test
  public void testReadConfigEndpointsDown() throws Exception {
    EasyMock.expect(mockFetcher.fetch(EasyMock.isA(HttpRequest.class))).andReturn(
        new HttpResponse("")).anyTimes();
    replay();
    fetcher.setSecurityTokenCodec( new BasicSecurityTokenCodec() );
    Multimap<String, String> services = fetcher.getServicesForContainer("default", "dontcare");
    verify();
    assertEquals(configuredServices, services);
  }
View Full Code Here

        new HttpResponse(service1.toString()));
    EasyMock.expect(mockFetcher.fetch(EasyMock.isA(HttpRequest.class))).andReturn(
        new HttpResponse(service2.toString()));

    replay();
    fetcher.setSecurityTokenCodec( new BasicSecurityTokenCodec() );
    Multimap<String, String> services = fetcher.getServicesForContainer("default", "dontcare");
    verify();
    Multimap<String, String> mergedServices = LinkedHashMultimap.create(configuredServices);
    mergedServices.putAll(endPoint1, endPoint1Services);
    mergedServices.putAll(endPoint2, endPoint2Services);
View Full Code Here

    JsonContainerConfig containerConfig =
        new JsonContainerConfig(config,
            Expressions.forTesting(new Functions()));
    CapturingHttpFetcher httpFetcher = new CapturingHttpFetcher();
    fetcher = new DefaultServiceFetcher(containerConfig, httpFetcher);
    fetcher.setSecurityTokenCodec( new BasicSecurityTokenCodec() );
    Multimap<String, String> services = fetcher.getServicesForContainer("default", "dontcare");
    assertEquals(configuredServices, services);
    assertNotNull( httpFetcher.request );
    assertTrue( httpFetcher.request.isInternalRequest() );
  }
View Full Code Here

      testName = testName + ".xml";
    }

    String gadgetUrl = EndToEndServer.SERVER_URL + '/' + testName;
    String url = EndToEndServer.GADGET_BASEURL + "?url=" + URLEncoder.encode(gadgetUrl, "UTF-8");
    BasicSecurityTokenCodec codec = new BasicSecurityTokenCodec();
    url += "&st=" + URLEncoder.encode(codec.encodeToken(token), "UTF-8");
    if (testMethod != null) {
      url += "&testMethod=" + URLEncoder.encode(testMethod, "UTF-8");
    }
    if (caja) {
      url += "&caja=1&libs=caja";
View Full Code Here

      testName = testName + ".xml";
    }

    String gadgetUrl = EndToEndServer.SERVER_URL + '/' + testName;
    String url = EndToEndServer.GADGET_BASEURL + "?url=" + URLEncoder.encode(gadgetUrl, "UTF-8");
    BasicSecurityTokenCodec codec = new BasicSecurityTokenCodec();
    url += "&st=" + URLEncoder.encode(codec.encodeToken(token), "UTF-8");
    if (testMethod != null) {
      url += "&testMethod=" + URLEncoder.encode(testMethod, "UTF-8");
    }
    if (caja) {
      url += "&caja=1&libs=caja";
View Full Code Here

  @Test
  public void testReadConfigEndpointsDown() throws Exception {
    EasyMock.expect(mockFetcher.fetch(EasyMock.isA(HttpRequest.class))).andReturn(
        new HttpResponse("")).anyTimes();
    replay();
    fetcher.setSecurityTokenCodec( new BasicSecurityTokenCodec() );
    Multimap<String, String> services = fetcher.getServicesForContainer("default", "dontcare");
    verify();
    assertEquals(configuredServices, services);
  }
View Full Code Here

        new HttpResponse(service1.toString()));
    EasyMock.expect(mockFetcher.fetch(EasyMock.isA(HttpRequest.class))).andReturn(
        new HttpResponse(service2.toString()));

    replay();
    fetcher.setSecurityTokenCodec( new BasicSecurityTokenCodec() );
    Multimap<String, String> services = fetcher.getServicesForContainer("default", "dontcare");
    verify();
    Multimap<String, String> mergedServices = LinkedHashMultimap.create(configuredServices);
    mergedServices.putAll(endPoint1, endPoint1Services);
    mergedServices.putAll(endPoint2, endPoint2Services);
View Full Code Here

TOP

Related Classes of org.apache.shindig.auth.BasicSecurityTokenCodec

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.