Skip to content

Commit

Permalink
test: add test for check the option comparisonType
Browse files Browse the repository at this point in the history
  • Loading branch information
osan15 committed Mar 19, 2019
1 parent cd80c99 commit d141ba8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/passport-saml/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ SAML.prototype.initialize = function (options) {
options.signatureAlgorithm = 'sha1';
}

// better, exact, minimum, maximum
if (!options.comparisonType){
/**
* List of possible values:
* - exact : Assertion context must exactly match a context in the list
* - minimum: Assertion context must be at least as strong as a context in the list
* - maximum: Assertion context must be no stronger than a context in the list
* - better: Assertion context must be stronger than all contexts in the list
*/
if (!options.comparisonType || ['exact','minimum','maximum','better'].indexOf(options.comparisonType) === -1){
options.comparisonType = 'exact';
}

Expand Down
13 changes: 13 additions & 0 deletions test/tests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d141ba8

Please sign in to comment.