<commit_before>// Load modules

var Fs = require('fs');
var Hoek = require('hoek');
var Boom = require('boom');
var Login = require('./login');
var Session = require('./session');
var Routes = require('./routes');
var Api = require('./api');


// Declare internals

var internals = {};


exports.register = function (plugin, options, next) {

    var api = new Api(options);

    plugin.bind({
        config: options.config,
        vault: options.vault,
        api: api
    });

    plugin.loader(require);
    plugin.require({
        yar: {
            name: 'yar',
            cookieOptions: {
                isSecure: !!options.config.server.web.tls,
                password: <PASSWORD>.vault.yar.password
            }
        },
        crumb: null,
        scooter: null,
        'hapi-auth-cookie': null
    }, function (err) {

        Hoek.assert(!err, 'Failed loading plugin: ' + err);
        plugin.ext('onPreResponse', internals.onPreResponse);

        // Authentication

        plugin.auth.strategy('session', 'cookie', 'try', {
            password: <PASSWORD>,
            validateFunc: Session.validate(api),
            isSecure: !!options.config.server.web.tls,
            clearInvalid: true,
            redirectTo: options.config.server.web.uri + '/login',
            appendNext: true,
            ttl: 365 * 24 * 60 * 60 * 1000                          // 1 Year
        });

        // Views

        plugin.views({
            path: __dirname + '/views',
            engines: {
                jade: 'jade'
            },
            compileOptions: {
                colons: true,
                pretty: true
            }
        });<commit_msg>New config layout<commit_after>// Load modules

var Fs = require('fs');
var Hoek = require('hoek');
var Boom = require('boom');
var Login = require('./login');
var Session = require('./session');
var Routes = require('./routes');
var Api = require('./api');


// Declare internals

var internals = {};


exports.register = function (plugin, options, next) {

    var api = new Api(options);

    plugin.bind({
        config: options.config,
        vault: options.vault,
        api: api
    });

    plugin.loader(require);
    plugin.require({
        yar: {
            name: 'yar',
            cookieOptions: {
                isSecure: !!options.config.server.web.tls,
                password: <PASSWORD>
            }
        },
        crumb: null,
        scooter: null,
        'hapi-auth-cookie': null
    }, function (err) {

        Hoek.assert(!err, 'Failed loading plugin: ' + err);
        plugin.ext('onPreResponse', internals.onPreResponse);

        // Authentication

        plugin.auth.strategy('session', 'cookie', 'try', {
            password: <PASSWORD>,
            validateFunc: Session.validate(api),
            isSecure: !!options.config.server.web.tls,
            clearInvalid: true,
            redirectTo: options.config.server.web.uri + '/login',
            appendNext: true,
            ttl: 365 * 24 * 60 * 60 * 1000                          // 1 Year
        });

        // Views

        plugin.views({
            path: __dirname + '/views',
            engines: {
                jade: 'jade'
            },
            compileOptions: {
                colons: true,
                pretty: true
            }
        });
{'fraction_non_alphanumeric': 0.13765303075544938, 'fraction_numerical': 0.008360704687966557, 'mean_word_length': 1.5968992248062015, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5163191', 'n_tokens_mistral': 971, 'n_tokens_neox': 921, 'n_words': 216}