Package org.apache.shindig.auth

Examples of org.apache.shindig.auth.SecurityToken


        assertEquals(expectedApplicationData.getAppUrl(), actualApplicationData.getAppUrl());
        assertEquals(expectedApplicationData.getData(), actualApplicationData.getData());
    }

    private SecurityToken getMockSecurityToken(String ownerId, String viewerId, String applicationId, Long moduleID) {
        SecurityToken securityToken;
        securityToken = createNiceMock(SecurityToken.class);
        expect(securityToken.getOwnerId()).andReturn(ownerId);
        expect(securityToken.getViewerId()).andReturn(viewerId);
        expect(securityToken.getAppId()).andReturn(applicationId);
        expect(securityToken.getModuleId()).andReturn(moduleID);
        replay(securityToken);
        return securityToken;
    }
View Full Code Here


    @Test
    public void getSecurityToken_validWidget() throws SecurityTokenException {
        expect(userService.getAuthenticatedUser()).andReturn(validPerson).anyTimes();
        replay(userService);

        SecurityToken securityToken = securityTokenService.getSecurityToken(validRegionWidget);
        validateSecurityToken(securityToken);
    }
View Full Code Here

        validPage.setOwner(new UserImpl(expectedOwnerId, expected));

        expect(userService.getAuthenticatedUser()).andReturn(validPerson).anyTimes();
        replay(userService);

        SecurityToken securityToken = securityTokenService.getSecurityToken(validRegionWidget);
        validateSecurityToken(securityToken, expected);
    }
View Full Code Here

        replay(userService);

        String encryptedToken = securityTokenService.getEncryptedSecurityToken(validRegionWidget);
        assertNotNull(encryptedToken);

        SecurityToken securityToken = securityTokenService.decryptSecurityToken(encryptedToken);
        validateSecurityToken(securityToken);
    }
View Full Code Here

        String encryptedToken = securityTokenService.getEncryptedSecurityToken(validRegionWidget);
        assertNotNull(encryptedToken);

        encryptedToken = securityTokenService.refreshEncryptedSecurityToken(encryptedToken);

        SecurityToken securityToken = securityTokenService.decryptSecurityToken(encryptedToken);
        validateSecurityToken(securityToken);
    }
View Full Code Here

    private void testGetPersonData(Set<String> fields, String ownerId, String viewerId, String applicationId,
                                   ApplicationData applicationData, Map<String, String> expectedData) throws Exception {

        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(new UserId(UserId.Type.userId, VALID_USER_ID)));

        SecurityToken securityToken = getMockSecurityToken(ownerId, viewerId, applicationId, VALID_MODULE_ID);

        List<Person> users = Arrays.asList(validPerson);
        GroupId groupId = new GroupId(GroupId.Type.self, "@self");
        expect(personService.getPeople(userIds, groupId, null, securityToken)).andReturn(users);
        replay(personService);
View Full Code Here

                                      ApplicationData applicationData) {

        UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID);
        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(userId));

        SecurityToken securityToken = getMockSecurityToken(ownerId, viewerId, VALID_APPLICATION_ID, VALID_MODULE_ID);

        List<Person> users = Arrays.asList(validPerson);
        GroupId groupId = new GroupId(GroupId.Type.self, "@self");
        expect(personService.getPeople(userIds, groupId, null, securityToken)).andReturn(users);
        replay(personService);
View Full Code Here

    private void testDeletePersonDataNoAppDataExpected(ApplicationData applicationData) throws InterruptedException, ExecutionException {

        UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID);
        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(userId));

        SecurityToken securityToken = getMockSecurityToken(VALID_OWNER_ID, VALID_VIEWER_ID, VALID_APPLICATION_ID, VALID_MODULE_ID);

        List<Person> users = Arrays.asList(validPerson);
        GroupId groupId = new GroupId(GroupId.Type.self, "@self");
        expect(personService.getPeople(userIds, groupId, null, securityToken)).andReturn(users);
        replay(personService);
View Full Code Here

                                      ApplicationData applicationData) {

        UserId userId = new UserId(UserId.Type.userId, VALID_USER_ID);
        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(userId));

        SecurityToken securityToken = getMockSecurityToken(VALID_OWNER_ID, VALID_VIEWER_ID, VALID_APPLICATION_ID, VALID_MODULE_ID);

        List<Person> users = Arrays.asList(validPerson);
        GroupId groupId = new GroupId(GroupId.Type.self, "@self");
        expect(personService.getPeople(userIds, groupId, null, securityToken)).andReturn(users);
        replay(personService);
View Full Code Here

        assertEquals(expectedApplicationData.getAppUrl(), actualApplicationData.getAppUrl());
        assertEquals(expectedApplicationData.getData(), actualApplicationData.getData());
    }

    private SecurityToken getMockSecurityToken(String ownerId, String viewerId, String applicationId, Long moduleID) {
        SecurityToken securityToken;
        securityToken = createNiceMock(SecurityToken.class);
        expect(securityToken.getOwnerId()).andReturn(ownerId);
        expect(securityToken.getViewerId()).andReturn(viewerId);
        expect(securityToken.getAppId()).andReturn(applicationId);
        expect(securityToken.getModuleId()).andReturn(moduleID);
        replay(securityToken);
        return securityToken;
    }
View Full Code Here

TOP

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

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.