Package org.intalio.tempo.security

Examples of org.intalio.tempo.security.Property


  @Stub Property[] prop;
  @Mock HttpClient c;
  @Specification
  public void test() throws Exception {
    prop = new  Property[1];
    prop[0] = new Property("a", "a");
    byte[] payload = new String("hello").getBytes();
    expect.that(new Expectations(){{
      atLeast(1).of(am).getFilename();will(returnValue("abc"));
      atLeast(1).of(am).getMimeType();will(returnValue("text/html"));
      ignoring(c);will(returnValue(200));
View Full Code Here


        n3auth.setWsEndpoint("internal://");
        //n3auth = new N3AuthStrategy();
        final TokenService ts = ((FakeN3AuthStrategy)n3auth).connect2tokenService();
        expect.that(new Expectations(){{
            Property[] p = new Property[2];
            p[0] = new Property( AuthenticationConstants.PROPERTY_USER, "test/system-test");
            p[1] = new Property(AuthenticationConstants.PROPERTY_ROLES, "test/testrole");
           one(ts).getTokenProperties(SYSTEM_TEST_TOKEN);will(returnValue(p));
        }});      
        n3auth.authenticate(credentials);      
       
        final AuthCredentials credentials2 = new AuthCredentials(SYSTEM_TEST_TOKEN);
        credentials2.getAuthorizedUsers().add("intalio\\jan.lategahn@db.com ");
        credentials2.getAuthorizedRoles().add("test/testrole23");
        expect.that(new Expectations(){{
            Property[] p = new Property[2];
            p[0] = new Property( AuthenticationConstants.PROPERTY_USER, "intalio\\jan.lategahn@db.com");
            p[1] = new Property(AuthenticationConstants.PROPERTY_ROLES, "test/testrole23");
           one(ts).getTokenProperties(SYSTEM_TEST_TOKEN);will(returnValue(p));
        }});      
        Property[] p = n3auth.authenticate(credentials2);
        expect.that(p!=null);
    }
View Full Code Here

    }

    @Specification
    public void testN3AuthProvider() throws Exception {
        final Property[] properties = new Property[5];
        properties[0] = new Property("issued", "1222330753605");
        properties[1] = new Property("user", "exolab\\castor");
        properties[2] = new Property("fullName", "Castor Workaholic");
        properties[3] = new Property("email", "castor@exolab.org");
        properties[4] = new Property("roles", "exolab\\committer,exolab\\participant");
       
        expect.that(new Expectations() {
            {
                one(tc).getTokenProperties(SYSTEM_TEST_TOKEN); will(returnValue(properties));
            }
View Full Code Here

            Property[] properties = connect2tokenService().getTokenProperties(participantToken);
            String invokerUser = (String) PropertyUtils.getProperty(properties, "user").getValue();
            if (_logger.isDebugEnabled()) {
                _logger.debug("Token '" + participantToken + "' is resolved to " + invokerUser);
            }
            Property roleProperty = PropertyUtils.getProperty(properties, "roles");
            String[] invokerRoles = StringArrayUtils.parseCommaDelimited((String) roleProperty.getValue());
            if (_logger.isDebugEnabled()) {
                String roles = "";
                for (int i = 0; i < invokerRoles.length; i++)
                    roles += (i == 0 ? "" : ",") + invokerRoles[i];
                _logger.debug("User " + invokerUser + " with roles " + roles);
View Full Code Here

TOP

Related Classes of org.intalio.tempo.security.Property

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.