Package org.intalio.tempo.workflow.tas.core

Examples of org.intalio.tempo.workflow.tas.core.AuthCredentials


//            _client = new TokenClient(endpoint);
//        } else {
//            _client = new TokenClientMock();
//        }
       
        AuthCredentials credentials = new AuthCredentials(SYSTEM_TEST_TOKEN);
        credentials.getAuthorizedUsers().add("test/system-test");
        credentials.getAuthorizedRoles().add("test/testrole");
       
        N3AuthStrategy n3auth = new FakeN3AuthStrategy();
        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));
View Full Code Here


     */
    private static AuthCredentials parseAuthCredentials(OMElement credentialElement)
            throws InvalidMessageFormatException {
        String participantToken = _xpathHelper.getRequiredString(credentialElement, "tas:participantToken");

        AuthCredentials credentials = new AuthCredentials(participantToken);
        OMElement usersElement = _xpathHelper.getElement(credentialElement, "tas:authorizedUsers");
        if (usersElement != null) {
            OMElement[] userElements = _xpathHelper.getElements(usersElement, "tas:user");
            for (OMElement userElement : userElements) {
                String user = userElement.getText().trim();
                credentials.getAuthorizedUsers().add(user);
            }
        }

        OMElement rolesElement = _xpathHelper.getElement(credentialElement, "tas:authorizedRoles");
        if (rolesElement != null) {
            OMElement[] roleElements = _xpathHelper.getElements(rolesElement, "tas:role");
            for (OMElement roleElement : roleElements) {
                String role = roleElement.getText().trim();
                credentials.getAuthorizedRoles().add(role);
            }
        }

        return credentials;
    }
View Full Code Here

            OMElement metadataElement = _xpathHelper.getRequiredElement(addRequestElement, "tas:attachmentMetadata");
            AttachmentMetadata metadata = TASAxis2Bridge.parseAttachmentMetadata(metadataElement);

            OMElement credentialElement = _xpathHelper.getRequiredElement(addRequestElement, "tas:authCredentials");
            AuthCredentials credentials = TASAxis2Bridge.parseAuthCredentials(credentialElement);

            OMElement localFileUrlElement = _xpathHelper.getElement(addRequestElement, "tas:localFileURL");
            OMElement payloadElement = _xpathHelper.getElement(addRequestElement, "tas:payload");
            OMElement plaintextElement = _xpathHelper.getElement(addRequestElement, "tas:plaintext");
View Full Code Here

    public OMElement delete(OMElement deleteRequestElement) throws AxisFault {
        try {
            _logger.debug("Request: delete");
            OMElement credentialElement = _xpathHelper
                    .getRequiredElement(deleteRequestElement, "tas:authCredentials");
            AuthCredentials credentials = TASAxis2Bridge.parseAuthCredentials(credentialElement);
            String attachmentUrl = _xpathHelper.getRequiredString(deleteRequestElement, "tas:attachmentURL");
            _serviceImpl.delete(credentials, attachmentUrl);
            OMElement responseElement = TASAxis2Bridge.createOkResponse();
            return responseElement;
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.intalio.tempo.workflow.tas.core.AuthCredentials

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.