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

ec.gob.senescyt.sniese.commons.applications.AplicacionSegura Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
package ec.gob.senescyt.sniese.commons.applications;

import ec.gob.senescyt.sniese.commons.bundles.audit.AuditoriaBundle;
import ec.gob.senescyt.sniese.commons.configurations.ConfiguracionSnieseBase;
import ec.gob.senescyt.sniese.commons.exceptions.mappers.ExcepcionAutenticacionMapper;
import ec.gob.senescyt.sniese.commons.security.PrincipalProvider;
import ec.gob.senescyt.sniese.commons.security.shiro.ShiroBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

public class AplicacionSegura extends DecoradorAplicacion {

    private PrincipalProvider principalProvider;

    public AplicacionSegura(DecoradorAplicacion siguiente, PrincipalProvider principalProvider) {
        super(siguiente);
        this.principalProvider = principalProvider;
    }

    @Override
    public void inicializar(Bootstrap bootstrap) {
        bootstrap.addBundle(new ShiroBundle());
        bootstrap.addBundle(new AuditoriaBundle<>(principalProvider));
    }

    @Override
    public void ejecutar(ConfiguracionSnieseBase configuracion, Environment ambiente) {
        ambiente.jersey().register(new ExcepcionAutenticacionMapper());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy