Code Monkey home page Code Monkey logo

saml2js's People

Contributors

billpatrianakos avatar brijeshgajjarfynd avatar dennismphil avatar flesch avatar l1n avatar ryanhefner avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

saml2js's Issues

npm audit warning

Please update the version of lodash. Seeing a npm audit warning

 npm audit    
                                                                                
                       === npm audit security report ===                        
                                                                                
┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.11                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ saml2js                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ saml2js > lodash                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/782                             │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.17.5                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ saml2js                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ saml2js > lodash                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/577                             │
└───────────────┴──────────────────────────────────────────────────────────────┘

What am I doing wrong? I'm getting empty objects.

I'm trying to test the parser out prior to actually having everything wired up so I don't have a real response body to work with. Using the example XML snippet from the usage instructions, I am trying this:

const parser = new Saml2js(`<saml2:Attribute Name="First Name">
  <saml2:AttributeValue>John</saml2:AttributeValue>
</saml2:Attribute>`)

const samlObj = parser.toObject()
const samlJSON = parser.toJSON()
console.log('*** saml route samlObj: ', samlObj)
console.log('*** saml route samlJSON: ', samlJSON)
console.log(`*** saml route parser.get('first name'): `, parser.get('first name'))

My terminal output:

*** saml route samlObj:  {}
*** saml route samlJSON:  {}
*** saml route parser.get('first name'):  undefined

Leakage of result from previous run

Description

Ran into an issue using this library. If we invoke this twice, the result of the second instance is from the first invocation.

code

This is because profile is a global variable

var xmldom    = require('xmldom'),
    xpath     = require('xpath'),
    _         = require('lodash'),
    profile   = {};  // <------------------------ Culprit: Global Variable

// Saml2js
// -------
// Constructor function. Saves a copy
// of the raw SAML you pass to it and 
// a copy that's parsed into a JS object.
//
// `response` [String] - A SAML response string
function Saml2js (response) {
  this.rawSaml    = response;
  this.parsedSaml = this.parse(response);
}

README.md typo

HI there,

Thanks so much for putting this together. Am sure it will save me a load of time on the long run.

But just to let you know, the README.md has a typo, I think, in the section regarding toObject().

The sample code references "asObject()" ... which, of course, isn't a function.

Just spent a good 25 minutes wondering if I was mad or not.

Thanks

Neal

Documentation is wrong.

Your documentation says to execute parser.asObject() when the actual function is parser.toObject()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.