Examples of Auth


Examples of io.fathom.cloud.server.auth.Auth

    @Inject
    protected AuthService authService;

    protected Auth getAuth(String project) throws CloudException {
        Auth unscoped = getUnscopedAuth();
        List<Long> projectIds = authService.resolveProjectName(unscoped, project);

        if (projectIds.size() == 0) {
            throw new IllegalArgumentException("Cannot find project");
        }
        if (projectIds.size() != 1) {
            throw new IllegalArgumentException("The project name is ambiguous");
        }
        Long projectId = projectIds.get(0);

        Auth auth = authService.authenticate(projectId, username, password);
        if (auth == null) {
            throw new IllegalArgumentException("Cannot authenticate to project");
        }
        return auth;
    }
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

    Auth unscopedAuth;

    protected Auth getUnscopedAuth() throws CloudException {
        if (unscopedAuth == null) {
            Auth unscoped = authService.authenticate(null, username, password);
            if (unscoped == null) {
                throw new IllegalArgumentException("Cannot authenticate");
            }
            this.unscopedAuth = unscoped;
        }
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

    @Inject
    SecretService secretService;

    @Override
    protected Message run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        SelfSigned helper = new SelfSigned();

        int keySize = 2048;
        String algorithm = "rsa";
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

        super("dns-zone-create");
    }

    @Override
    protected DnsZoneData run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        DnsZoneSpec zoneSpec = new DnsZoneSpec();
        zoneSpec.name = zone;
        zoneSpec.backend = backend;
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

    @Inject
    EncryptionStore encryptionStore;

    @Override
    protected Message run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        List<Secret> secrets = secretService.list(auth, project);

        Secret found = null;
        for (Secret secret : secrets) {
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

        super("dns-record-list");
    }

    @Override
    protected List<DnsRecordsetData> run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        DnsZone zone = dns.findZoneByName(project, zoneName);
        if (zone == null) {
            throw new WebApplicationException(Status.NOT_FOUND);
        }
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

    @Inject
    SecretService secretService;

    @Override
    protected Message run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        List<Secret> secrets = secretService.list(auth, project);

        for (Secret secret : secrets) {
            SecretInfo secretInfo = secret.getSecretInfo();
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

    @Inject
    Attachments attachments;

    @Override
    protected Message run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        ClientApp clientApp = attachments.createClientApp(auth, project, appName, appSecret);

        // TODO: Return something useful
        return null;
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

        super("dns-record-delete");
    }

    @Override
    protected DnsRecordsetData run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        DnsZone zone = dns.findMaximalZone(project, fqdn);
        if (zone == null) {
            throw new IllegalArgumentException("Cannot find matching zone");
        }
View Full Code Here

Examples of io.fathom.cloud.server.auth.Auth

    }

    @Deprecated
    // This is a dark corner of the OpenStack API
    protected void checkDomainAdmin() {
        Auth auth = getAuth();

        Domain domainAdmin = auth.findDomainWithAdminRole();
        if (domainAdmin == null) {
            log.debug("Expected domain admin: {}", auth);
            throw new WebApplicationException(Status.FORBIDDEN);
        }
    }
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.