Package io.fathom.cloud.server.auth

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


    SecretService secretsService;

    @GET
    @Path("{id}")
    public Secret findSecret(@PathParam("id") long id) throws CloudException {
        Auth auth = getAuth();
        Project project = getProject();

        SecretService.Secret secret = secretsService.find(auth, project, id);
        notFoundIfNull(secret);
View Full Code Here


    }

    @GET
    @Path("{id}/{key}")
    public Response getSecret(@PathParam("id") long id, @PathParam("key") String key) throws CloudException {
        Auth auth = getAuth();
        Project project = getProject();

        SecretService.Secret secret = secretsService.find(auth, project, id);
        notFoundIfNull(secret);
View Full Code Here

        return Response.ok(data).build();
    }

    @GET
    public SecretList listSecrets() throws CloudException {
        Auth auth = getAuth();
        Project project = getProject();

        SecretList ret = new SecretList();
        ret.secrets = Lists.newArrayList();
View Full Code Here

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

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

        List<DnsZone> zones = dns.listZones(project);
        return DnsZone.toData(zones);
    }
View Full Code Here

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

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

        DnsZone found = dns.findZoneByName(project, zone);
        if (found == null) {
            throw new IllegalArgumentException("Zone not found: " + zone);
        }
View Full Code Here

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

    @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

    @Inject
    SecretService secretService;

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

        secretService.deleteKey(auth, project, id);
        return null;
    }
View Full Code Here

    @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

    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

    @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

TOP

Related Classes of io.fathom.cloud.server.auth.Auth

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.