Package io.fathom.cloud.server.model

Examples of io.fathom.cloud.server.model.User


        // This is entirely wrong
        warnStub();

        Auth auth = getAuth();

        User user = auth.getUser();
        if (user == null) {
            throw new WebApplicationException(Status.UNAUTHORIZED);
        }

        if (!id.equals("root")) {
View Full Code Here


        WrappedCertificate response = new WrappedCertificate();
        response.certificate = new Certificate();

        Auth auth = getAuth();

        User user = auth.getUser();
        if (user == null) {
            throw new WebApplicationException(Status.UNAUTHORIZED);
        }

        X500Principal subject = new X500Principal("CN=" + "user-" + user.getId());

        CertificateAndKey certificateAndKey = createSelfSigned(subject, 2048);

        response.certificate.privateKey = Hex.toHex(certificateAndKey.getPrivateKey().getEncoded());
        response.certificate.data = Hex.toHex(certificateAndKey.getPublicKey().getEncoded());
View Full Code Here

        // UserData user = authStore.getUsers().find(credential.getUserId());
        // return user;
    }

    protected User getUser() throws CloudException {
        User user = findUser();
        if (user == null) {
            throw new WebApplicationException(Status.UNAUTHORIZED);
        }
        return user;
    }
View Full Code Here

    }

    @Override
    public User getUser() {
        if (token.hasUserId()) {
            return new User(token.getUserId());
        }
        return null;
    }
View Full Code Here

    private UserData user = null;

    protected UserData getUser() throws CloudException {
        if (this.user == null) {
            Auth auth = getAuth();
            User user = null;
            if (auth != null) {
                user = auth.getUser();
            }
            if (user == null) {
                throw new WebApplicationException(Status.UNAUTHORIZED);
            }

            this.user = identityService.findUser(user.getId());
        }
        return this.user;
    }
View Full Code Here

    @GET
    @Path("{bucket}")
    public void watchBucket(@Suspended final AsyncResponse response, @QueryParam("since") String since)
            throws CloudException {
        User user = getAuth().getUser();

        Project project = findProject(projectName);
        if (project == null) {
            throw new WebApplicationException(Status.NOT_FOUND);
        }
View Full Code Here

            return doAnonymousRead();
        }

        Project project = getProject();

        User user = getAuth().getUser();
        FsBucket bucket = fs.findBucket(user, project, bucketName);
        if (bucket == null) {
            throw new WebApplicationException(Status.NOT_FOUND);
        }
View Full Code Here

    private Response doAnonymousRead() throws CloudException {
        FsFile found = null;

        FsBucket bucket;
        User user = null;

        // Check for a public file
        String projectName = getProjectName();
        Project project = new Project(Long.valueOf(projectName));
        bucket = fs.findBucket(user, project, bucketName);
View Full Code Here

    }

    private FsFile findFile() throws CloudException {
        FsFile found;

        User user = null;

        FsBucket bucket;

        if (!isAuthenticated()) {
            // Check for a public file
View Full Code Here

TOP

Related Classes of io.fathom.cloud.server.model.User

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.