Examples of AuthenticatedUser


Examples of io.fathom.cloud.identity.model.AuthenticatedUser

    IdentityService identityService;

    @Override
    @Transactional
    public Auth authenticate(Long projectId, String username, String password) throws CloudException {
        AuthenticatedUser authentication = loginService.authenticate(projectId, username, password);

        if (authentication == null) {
            return null;
        }
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

        // TODO: Same roles as auth??
        b.addRoles(WellKnownRoles.ROLE_ID_MEMBER);

        {
            AuthenticatedUser authenticatedUser = toAuthenticatedUser(auth);

            ByteString tokenSecret = secretService.buildTokenSecret(authenticatedUser);
            b.setTokenSecret(tokenSecret);

            // For now, we can't get the secret without going through a user
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

        b.setDomainId(domain.getId());

        b.setEnabled(true);

        AuthenticatedUser owner = toAuthenticatedUser(auth);

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

        return created.getId();
    }
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

    }

    public AuthenticatedUser toAuthenticatedUser(Auth auth) throws CloudException {
        TokenAuth tokenAuth = (TokenAuth) auth;
        TokenInfo tokenInfo = tokenAuth.getTokenInfo();
        AuthenticatedUser authenticatedUser = loginService.authenticate(tokenInfo);
        return authenticatedUser;
    }
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

    private void doProjectGrant() throws CloudException {
        Auth auth = getAuth();

        Project project = auth.getProject();

        AuthenticatedUser authenticatedUser = ((AuthServiceImpl) authService).toAuthenticatedUser(auth);
        AuthenticatedProject authenticatedProject = identityService.authenticateToProject(authenticatedUser,
                project.getId());

        RoleData role = getRole();
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

        UserData user = identityService.createUser(new UserCreationData(domain, userBuilder, password));

        Long projectId = null;

        AuthenticatedUser authenticatedUser = loginService.authenticate(projectId, username, password);
        if (authenticatedUser == null) {
            throw new IllegalStateException();
        }

        boolean CREATE_PROJECT = false;
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

        }
        log.info("Authenticated as: {}", username);

        Long projectId = findProjectId(auth, projectName);

        AuthenticatedUser authenticatedUser = ((AuthServiceImpl) authService).toAuthenticatedUser(auth);

        identityService.fixupProject(authenticatedUser, projectId);

        return null;
    }
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

    @PUT
    @Path("{project_id}/users/{user_id}/roles/{role_id}")
    public Response grantRoleToUserOnProject(@PathParam("project_id") long projectId,
            @PathParam("user_id") long userId, @PathParam("role_id") long roleId) throws CloudException {
        AuthenticatedUser currentUser = getAuthenticatedUser();
        UserData grantee = getUser(userId);

        AuthenticatedProject authenticatedProject = identityService.authenticateToProject(currentUser, projectId);
        if (authenticatedProject == null) {
            // Forbidden?
View Full Code Here

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

        return Response.noContent().build();
    }

    @POST
    public WrappedProject createProject(WrappedProject wrappedProject) throws CloudException {
        AuthenticatedUser owner = getAuthenticatedUser();

        Project req = wrappedProject.project;

        ProjectData.Builder b = ProjectData.newBuilder();

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

        b.setName(req.name);

        if (!Strings.isNullOrEmpty(req.domainId)) {
            // Not sure what good can come of this...
            throw new UnsupportedOperationException();
        }
        b.setDomainId(owner.getDomainId());

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

Examples of io.fathom.cloud.identity.model.AuthenticatedUser

    public GetTenantsResponse doTenantsGet() throws CloudException {
        GetTenantsResponse response = new GetTenantsResponse();
        List<TenantDetails> tenants = response.tenants = Lists.newArrayList();

        UserData user = getUser();
        AuthenticatedUser authenticated = getAuthenticatedUser();

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

            ProjectData project = identityService.findProject(authenticated, projectId);
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.