Package io.fathom.cloud.protobuf.IdentityModel

Examples of io.fathom.cloud.protobuf.IdentityModel.UserData


    @GET
    @Path("{id}")
    @Produces({ JSON })
    public WrappedUser getUserDetails(@PathParam("id") long id) throws CloudException {
        UserData user = getUser(id);

        WrappedUser response = new WrappedUser();
        response.user = toModel(user);

        return response;
View Full Code Here


    }

    @DELETE
    @Path("{id}")
    public Response deleteUser(@PathParam("id") long id) throws Exception {
        UserData user = getUser(id);

        if (user.getId() == getUser().getId()) {
            // Prevent users from shooting themselves in the foot
            throw new IllegalArgumentException();
        }

        identityService.deleteUser(user);
View Full Code Here

    @GET
    @Path("{id}/projects")
    @Produces({ JSON })
    public Projects getUserProjects(@PathParam("id") long id) throws CloudException {
        UserData user = getUser(id);

        Projects response = new Projects();
        response.projects = Lists.newArrayList();

        for (ProjectRoles projectRole : user.getProjectRolesList()) {
            long projectId = projectRole.getProject();

            ProjectData project = authRepository.getProjects().find(projectId);
            if (project == null) {
                log.warn("Cannot find project {}", projectId);
View Full Code Here

        if (TokenAuth.hasExpired(tokenInfo)) {
            // This is treated the same as an invalid token
            return null;
        }

        UserData userData = authRepository.getUsers().find(tokenInfo.getUserId());
        if (userData == null) {
            return null;
        }

        UserWithSecret userWithSecret = null;
View Full Code Here

    private AuthenticatedUser toAuthenticationV2(DomainData domain, ProjectSpec projectSpec,
            UserWithSecret userWithSecret) throws CloudException {
        ProjectData project = null;
        ProjectRoles projectRoles = null;

        UserData user = userWithSecret.getUserData();

        if (projectSpec.projectId != 0) {
            return buildProjectToken(domain, projectSpec.projectId, userWithSecret);
        } else if (!Strings.isNullOrEmpty(projectSpec.projectName)) {
            for (ProjectRoles i : user.getProjectRolesList()) {
                ProjectData p = authRepository.getProjects().find(i.getProject());
                if (p == null) {
                    continue;
                }
View Full Code Here

        CredentialData credential = authRepository.getUsernames(domain).find(username);
        if (credential == null) {
            return null;
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            return null;
        }

        UserWithSecret userWithSecret = secretService.checkPassword(user, credential, password);
View Full Code Here

        CredentialData credential = authRepository.getUsernames(domain).find(username);
        if (credential == null) {
            throw new IllegalArgumentException();
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            throw new IllegalArgumentException();
        }

        secretService.changePassword(user, credential, password, recoveryKey);
View Full Code Here

        if (credential == null) {
            log.info("No credential found for {}", keyId);
            return null;
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            log.warn("User not found for credential {}", credential);
            return null;
        }
View Full Code Here

        CredentialData credential = authRepository.getPublicKeyCredentials(domain.getId()).find(keyId);
        if (credential == null) {
            return null;
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            return null;
        }

        UserWithSecret userWithSecret = secretService.checkPublicKey(user, credential, clientCertificate, challenge,
View Full Code Here

        }

        TokenScope scope = TokenScope.Project;
        ProjectRoles projectRoles = null;

        UserData user = userWithSecret.getUserData();

        projectRoles = Users.findProjectRoles(user, project.getId());
        if (projectRoles == null) {
            return null;
        }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.protobuf.IdentityModel.UserData

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.