Package io.fathom.cloud.protobuf.CloudCommons

Examples of io.fathom.cloud.protobuf.CloudCommons.TokenScope


        UserWithSecret userWithSecret = checkSecret(tokenInfo);
        if (userWithSecret == null) {
            return null;
        }

        TokenScope scope = tokenInfo.getTokenScope();

        switch (scope) {
        case Domain:
            return buildDomainToken(domain, userWithSecret);
View Full Code Here


        }
    }

    @Override
    public TokenInfo buildTokenInfo(AuthenticatedUser authentication) {
        TokenScope tokenScope = authentication.getScope();

        Date expiration = TOKEN_VALIDITY.addTo(new Date());

        TokenInfo.Builder token = TokenInfo.newBuilder();
        token.setUserId(authentication.getUserId());
View Full Code Here

    public static String toCredentialKey(ByteString publicKeySha1) {
        return BaseEncoding.base16().encode(publicKeySha1.toByteArray());
    }

    private AuthenticatedUser buildDomainToken(DomainData domain, UserWithSecret userWithSecret) throws CloudException {
        TokenScope scope = null;
        ProjectData project = null;
        ProjectRoles projectRoles = null;

        scope = TokenScope.Domain;
View Full Code Here

            throws CloudException {
        if (project == null) {
            throw new IllegalStateException();
        }

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

        UserData user = userWithSecret.getUserData();

        projectRoles = Users.findProjectRoles(user, project.getId());
View Full Code Here

        if (project == null) {
            log.warn("Cannot find project {}", projectRoles.getProject());
            return null;
        }

        TokenScope scope = TokenScope.Project;
        return new AuthenticatedUser(scope, userWithSecret, project, projectRoles, domain);
    }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.protobuf.CloudCommons.TokenScope

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.