Examples of ProjectData


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

            b.setEnabled(req.enabled);
        } else {
            b.setEnabled(true);
        }

        ProjectData created = identityService.createProject(b, owner, WellKnownRoles.ROLE_ID_ADMIN);

        WrappedProject response = new WrappedProject();
        response.project = toModel(created);
        return response;
    }
View Full Code Here

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

    }

    @GET
    @Path("{projectId}")
    public WrappedProject getProjectDetails(@PathParam("projectId") long projectId) throws CloudException {
        ProjectData project = getProject(projectId);

        WrappedProject response = new WrappedProject();
        response.project = toModel(project);

        return response;
View Full Code Here

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

    @GET
    @Path("{projectId}/users/{userId}/roles")
    public Roles getProjectDetails(@PathParam("projectId") long projectId, @PathParam("userId") long userId)
            throws CloudException {
        UserData user = getUser(userId);
        ProjectData project = getProject(projectId);

        Roles response = new Roles();
        response.roles = Lists.newArrayList();

        ProjectRoles projectRoles = Users.findProjectRoles(user, project.getId());
        if (projectRoles != null) {
            for (long roleId : projectRoles.getRoleList()) {
                RoleData role = identityService.findRole(roleId);
                if (role == null) {
                    log.warn("Role not found: {}", roleId);
View Full Code Here

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

        AuthenticatedUser authenticated = getAuthenticatedUser();

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

            ProjectData project = identityService.findProject(authenticated, projectId);
            if (project == null) {
                log.warn("Cannot find project {}", projectId);
                continue;
            }
View Full Code Here

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

            break;
        }

        case Project: {
            // Project scoped
            ProjectData scope = authRepository.getProjects().find(token.getProjectId());
            if (scope == null) {
                throw new IllegalStateException();
            }

            DomainData projectDomain = authRepository.getDomains().find(scope.getDomainId());
            if (projectDomain == null) {
                throw new IllegalStateException();
            }

            response.projectScope = toModel(projectDomain, scope);
            response.serviceCatalog = loginService.buildServiceMap(getBaseUrl(), scope);

            roles = tokenUtils.getProjectRoles(user, scope.getId());
            break;
        }

        default:
            break;
View Full Code Here

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

        V2AuthResponse response = new V2AuthResponse();

        Access access = response.access = new Access();
        V2Token token = access.token = new V2Token();

        ProjectData project = authentication.getProject();

        // We never pass domain; we can't build a domain token with V2
        TokenInfo tokenInfo = loginService.buildTokenInfo(authentication);

        token.expires = TokenAuth.getExpiration(tokenInfo);
        token.id = tokenService.encodeToken(tokenInfo);
        if (project != null) {
            Tenant tenant = new Tenant();
            tenant.id = "" + project.getId();
            tenant.name = project.getName();
            token.tenant = tenant;
        }

        if (project != null) {
            List<Service> v3Services = loginService.buildServiceMap(getBaseUrl(), project);
View Full Code Here

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

                throw new UnsupportedOperationException();
            }
            // domain = getDomain(Long.valueOf(req.domainId));
        }

        ProjectData project = getProject(Long.valueOf(req.defaultProjectId));

        UserData.Builder b = UserData.newBuilder();

        if (!Strings.isNullOrEmpty(req.description)) {
            b.setDescription(req.description);
        }

        b.setName(req.name);

        b.setDomainId(domain.getId());

        if (req.enabled != null) {
            b.setEnabled(req.enabled);
        } else {
            b.setEnabled(true);
        }

        if (project != null) {
            b.setDefaultProjectId(project.getId());
        }

        b.setEmail(req.email);

        UserData user = identityService.createUser(new UserCreationData(domainData, b, req.password));
View Full Code Here

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

        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);
                continue;
            }
View Full Code Here

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

    }

    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;
                }

                if (projectSpec.projectName.equals(p.getName())) {
                    projectRoles = i;
                    project = p;
                    break;
                }
            }
View Full Code Here

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

        // (and size matters, because this token gets passed as a cookie))
        token.setExpiration(expiration.getTime() / 1000L);

        token.setTokenScope(tokenScope);

        ProjectData project = authentication.getProject();
        if (project != null) {
            token.setProjectId(project.getId());
            if (authentication.getProjectRoleIds() != null) {
                for (long projectRoleId : authentication.getProjectRoleIds()) {
                    token.addRoles(projectRoleId);
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.