コード例 #1
0
ファイル: index.js プロジェクト: hapijs/bell
     profileMethod: Joi.string().valid('get', 'post').default('get'),
     scope: Joi.alternatives().try(
         Joi.array().items(Joi.string()),
         Joi.func()
     ).when('protocol', { is: 'oauth2', otherwise: Joi.forbidden() }),
     scopeSeparator: Joi.string().when('protocol', { is: 'oauth2', otherwise: Joi.forbidden() })
 }).required(),
 password: Joi.string().required(),
 clientId: Joi.string().required(),
 clientSecret: Joi.alternatives().when('protocol', {
     is: 'oauth',
     then: Joi.string().required().allow(''),
     otherwise: Joi.alternatives().try(Joi.string().allow(''), Joi.object())
 }).required(),
 cookie: Joi.string(),
 isSameSite: Joi.valid('Strict', 'Lax').allow(false).default('Strict'),
 isSecure: internals.flexBoolean,
 isHttpOnly: internals.flexBoolean,
 ttl: Joi.number(),
 domain: Joi.string().allow(null),
 providerParams: Joi.alternatives().try(Joi.object(), Joi.func()),
 allowRuntimeProviderParams: internals.flexBoolean.default(false),
 scope: Joi.alternatives().try(
     Joi.array().items(Joi.string()),
     Joi.func()
 ).when('provider.protocol', { is: 'oauth2', otherwise: Joi.forbidden() }),
 name: Joi.string().required(),
 config: Joi.object(),
 profileParams: Joi.object(),
 skipProfile: internals.flexBoolean.optional().default(false),
 forceHttps: internals.flexBoolean.optional().default(false),
コード例 #2
0
ファイル: index.js プロジェクト: hapijs/statehood
const Bourne = require('@hapi/bourne');
const Cryptiles = require('@hapi/cryptiles');
const Hoek = require('@hapi/hoek');
const Iron = require('@hapi/iron');
const Joi = require('@hapi/joi');


const internals = {};


internals.schema = Joi.object({
    strictHeader: Joi.boolean(),
    ignoreErrors: Joi.boolean(),
    isSecure: Joi.boolean(),
    isHttpOnly: Joi.boolean(),
    isSameSite: Joi.valid('Strict', 'Lax').allow(false),
    path: Joi.string().allow(null),
    domain: Joi.string().allow(null),
    ttl: Joi.number().allow(null),
    encoding: Joi.string().valid('base64json', 'base64', 'form', 'iron', 'none'),
    sign: Joi.object({
        password: [Joi.string(), Joi.binary(), Joi.object()],
        integrity: Joi.object()
    }),
    iron: Joi.object(),
    password: [Joi.string(), Joi.binary(), Joi.object()],

    // Used by hapi

    clearInvalid: Joi.boolean(),
    autoValue: Joi.any(),