Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Commit

Permalink
Replace default values. Closes #62
Browse files Browse the repository at this point in the history
  • Loading branch information
hueniverse committed Oct 27, 2017
1 parent acd8141 commit 6524f19
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
10 changes: 7 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const internals = {

// Generate header

exports.header = function (uri, method, ticket, options = {}) {
exports.header = function (uri, method, ticket, options) {

options = options || {};

const settings = Hoek.shallow(options);
settings.credentials = ticket;
Expand All @@ -41,7 +43,9 @@ exports.Connection = internals.Connection = class {
this._appTicket = null;
}

async request(path, ticket, options = {}) {
async request(path, ticket, options) {

options = options || {};

const method = options.method || 'GET';
const { code, result } = await this._request(method, path, options.payload, ticket);
Expand All @@ -63,7 +67,7 @@ exports.Connection = internals.Connection = class {
return { result: rResult, code: rCode, ticket: reissued };
}

async app(path, options = {}) {
async app(path, options) {

if (!this._appTicket) {
await this._requestAppTicket();
Expand Down
4 changes: 3 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ exports.authenticate = function (req, encryptionPassword, options) {
};


exports._authenticate = async function (req, encryptionPassword, checkExpiration, options = {}) {
exports._authenticate = async function (req, encryptionPassword, checkExpiration, options) {

options = options || {};

Hoek.assert(encryptionPassword, 'Invalid encryption password');

Expand Down
20 changes: 15 additions & 5 deletions lib/ticket.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ internals.defaults = {
};
*/

exports.issue = function (app, grant, encryptionPassword, options = {}) {
exports.issue = function (app, grant, encryptionPassword, options) {

options = options || {};

if (!app || !app.id) {
throw Boom.internal('Invalid application object');
Expand Down Expand Up @@ -133,7 +135,9 @@ exports.issue = function (app, grant, encryptionPassword, options = {}) {
};
*/

exports.reissue = function (parentTicket, grant, encryptionPassword, options = {}) {
exports.reissue = function (parentTicket, grant, encryptionPassword, options) {

options = options || {};

if (!parentTicket) {
throw Boom.internal('Invalid parent ticket object');
Expand Down Expand Up @@ -245,7 +249,9 @@ exports.reissue = function (parentTicket, grant, encryptionPassword, options = {
};
*/

exports.rsvp = function (app, grant, encryptionPassword, options = {}) {
exports.rsvp = function (app, grant, encryptionPassword, options) {

options = options || {};

if (!app || !app.id) {
throw Boom.internal('Invalid application object');
Expand Down Expand Up @@ -302,7 +308,9 @@ exports.rsvp = function (app, grant, encryptionPassword, options = {}) {
};
*/

exports.generate = async function (ticket, encryptionPassword, options = {}) {
exports.generate = async function (ticket, encryptionPassword, options) {

options = options || {};

// Generate ticket secret

Expand Down Expand Up @@ -354,7 +362,9 @@ exports.generate = async function (ticket, encryptionPassword, options = {}) {
};
*/

exports.parse = async function (id, encryptionPassword, options = {}) {
exports.parse = async function (id, encryptionPassword, options) {

options = options || {};

if (!encryptionPassword) {
throw Boom.internal('Invalid encryption password');
Expand Down

0 comments on commit 6524f19

Please sign in to comment.