All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codelibs.elasticsearch.auth.AuthPlugin Maven / Gradle / Ivy

package org.codelibs.elasticsearch.auth;

import java.util.Collection;

import org.codelibs.elasticsearch.auth.module.AuthModule;
import org.codelibs.elasticsearch.auth.rest.AccountRestAction;
import org.codelibs.elasticsearch.auth.rest.ReloadRestAction;
import org.codelibs.elasticsearch.auth.security.IndexAuthenticator;
import org.codelibs.elasticsearch.auth.service.AuthService;
import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.rest.RestModule;

public class AuthPlugin extends AbstractPlugin {
    @Override
    public String name() {
        return "AuthPlugin";
    }

    @Override
    public String description() {
        return "This is a elasticsearch-auth plugin.";
    }

    // for Rest API
    public void onModule(final RestModule module) {
        module.addRestAction(AccountRestAction.class);
        module.addRestAction(ReloadRestAction.class);
    }

    // for Service
    @Override
    public Collection> modules() {
        final Collection> modules = Lists
                .newArrayList();
        modules.add(AuthModule.class);
        return modules;
    }

    // for Service
    @SuppressWarnings("rawtypes")
    @Override
    public Collection> services() {
        final Collection> services = Lists
                .newArrayList();
        services.add(AuthService.class);
        services.add(IndexAuthenticator.class);
        return services;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy