class UserPlugin implements IAuthorizationPlugin {

    private static final Logger LOGGER = Logger.getLogger(UserPlugin.class.getName());

    static final String DECODER_CLASS_PARAM = "decoder";

    public static final String REQUEST_ATTR = "opengrok-user-plugin-user";

    private IUserDecoder decoder;

    public UserPlugin() {
    }

    // for testing
    protected UserPlugin(IUserDecoder decoder) {
        this.decoder = decoder;
    }

    private IUserDecoder getDecoder(String name) throws ClassNotFoundException, NoSuchMethodException,
            IllegalAccessException, InvocationTargetException, InstantiationException {
        Class<?> clazz = Class.forName(name);
        Constructor<?> constructor = clazz.getConstructor();
        Object instance = constructor.newInstance();
        return (IUserDecoder) instance;
    }

    @Override
    public void load(Map<String, Object> parameters) {<FILL_FUNCTION_BODY>}

    @Override
    public void unload() {
        // no state to free
    }

    private User getUser(HttpServletRequest request) {
        User user;

        if ((user = (User) request.getAttribute(REQUEST_ATTR)) == null) {
            user = decoder.fromRequest(request);
            request.setAttribute(REQUEST_ATTR, user);
        }

        return user;
    }

    @Override
    public boolean isAllowed(HttpServletRequest request, Project project) {
        return getUser(request) != null;
    }

    @Override
    public boolean isAllowed(HttpServletRequest request, Group group) {
        return getUser(request) != null;
    }
}

        String decoderName;
        if ((decoderName = (String) parameters.get(DECODER_CLASS_PARAM)) == null) {
            throw new NullPointerException(String.format("missing " +
                    "parameter '%s' in %s configuration",
                    DECODER_CLASS_PARAM, UserPlugin.class.getName()));
        }

        LOGGER.log(Level.INFO, "loading decoder: {0}", decoderName);
        try {
            decoder = getDecoder(decoderName);
        } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException |
                InvocationTargetException | InstantiationException e) {
            throw new UserDecoderException(decoderName, e);
        }
    
<no_super_class>