Skip to content
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

PR: Deps upgrade & size trimming #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ results

npm-debug.log
node_modules

.idea
6 changes: 3 additions & 3 deletions lib/saml11.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

var _ = require('lodash');
var _get = require('lodash.get');
var saml11 = module.exports;

saml11.parse = function parse(assertion) {
var claims = {};
var attributes = _.get(assertion, 'AttributeStatement.Attribute');
var attributes = _get(assertion, 'AttributeStatement.Attribute');

if (attributes) {
attributes = (attributes instanceof Array) ? attributes : [attributes];
Expand All @@ -19,7 +19,7 @@ saml11.parse = function parse(assertion) {
});
}

var nameIdentifier = _.get(assertion, 'AttributeStament.Subject.NameIdentifier');
var nameIdentifier = _get(assertion, 'AttributeStament.Subject.NameIdentifier');

if (nameIdentifier) {
claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier'] = nameIdentifier._ || nameIdentifier;
Expand Down
6 changes: 3 additions & 3 deletions lib/saml20.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var nameIdentifierClaimType = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier';
var _ = require('lodash');
var _get = require('lodash.get');
var saml20 = module.exports;

function getClaims(attributes) {
Expand All @@ -28,7 +28,7 @@ function trimWords(phrase) {
}

function getProp(obj, prop) {
var result = prop ? _.get(obj, prop) : obj;
var result = prop ? _get(obj, prop) : obj;

if (result && result._) {
result = result._;
Expand All @@ -53,7 +53,7 @@ function getProp(obj, prop) {

saml20.parse = function parse(assertion) {
var claims = {};
var attributes = _.get(assertion, 'AttributeStatement.Attribute');
var attributes = _get(assertion, 'AttributeStatement.Attribute');

if (attributes) {
attributes = (attributes instanceof Array) ? attributes : [attributes];
Expand Down
Loading