-
-
Notifications
You must be signed in to change notification settings - Fork 67
Expose signer #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose signer #193
Changes from 4 commits
b3793c1
3ed5658
b2e5e95
dfd7995
4c690ab
03ec13c
1b238df
57fc480
0771c79
b443c8d
abb82bc
f6eed68
c2a16be
9fa9ac9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ | |
|
||
'use strict' | ||
|
||
const { sign, unsign } = require('cookie-signature') | ||
const { signerFactory } = require('./signer') | ||
|
||
/** | ||
* Module exports. | ||
* @public | ||
|
@@ -36,6 +39,10 @@ | |
exports.parse = parse | ||
exports.serialize = serialize | ||
|
||
exports.signerFactory = signerFactory | ||
exports.sign = sign | ||
exports.unsign = unsign | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I landed #194 and now this conflicts. Coul you move these exports to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ок There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How then should the import of utilities look like? const cookie = require('@fastify/cookie');
const { signerFactory , sign, unsign } = cookie; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that works There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I understand correctly that exporting to plugin.js should it look like this? /**
* These export configurations enable JS and TS developers
* to consume fastify-cookie in whatever way best suits their needs.
* Some examples of supported import syntax includes:
* - `const fastifyCookie = require('fastify-cookie')`
* - `const { fastifyCookie } = require('fastify-cookie')`
* - `import * as fastifyCookie from 'fastify-cookie'`
* - `import { fastifyCookie } from 'fastify-cookie'`
* - `import fastifyCookie from 'fastify-cookie'`
*/
fastifyCookie.fastifyCookie = fastifyCookie
fastifyCookie.default = fastifyCookie
module.exports = fastifyCookie
fastifyCookie.fastifyCookie.signerFactory = signerFactory;
fastifyCookie.fastifyCookie.sign = sign;
fastifyCookie.fastifyCookie.unsign = unsign;
module.exports.signerFactory = signerFactory;
module.exports.sign = sign;
module.exports.unsign = unsign; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either fastifyCookie.signerFactory = signerFactory;
fastifyCookie.sign = sign;
fastifyCookie.unsign = unsign; or plugin.signerFactory = signerFactory;
plugin.sign = sign;
plugin.unsign = unsign; |
||
|
||
/** | ||
* Module variables. | ||
* @private | ||
|
Uh oh!
There was an error while loading. Please reload this page.