Giter Club home page Giter Club logo

wai-saml2's Introduction

I am a Software Engineer at GitHub, working on CodeQL. Previously I worked at Tweag where I consulted for Hachi Security and Juspay. I like open-source, teaching, and all things to do with programming languages!

I maintain a number of Haskell libraries, which you can find on Hackage. Some that you might be interested in are:

  • wai-rate-limit, which allows you to add rate limiting to your web applications; also available specifically for Servant.
  • wai-saml2 if you are building a SAML2 Service Provider.
  • logstash implements various logger backends that can write to Logstash.
  • network-wait lets you wait for networked services to become available.
  • moss, a client for Moss, which is a code similarity checking tool.
  • c14n provides Haskell bindings for the C14N implementation (XML normalisation) in libxml2.
  • time-units-types, a small library for representing time units at the type-level.
  • hindley-milner is a template for when you are building a Hindley Milner derived language and want a starting point.
  • hoop is an experimental library I built while studying for a PhD, which implements an object system in Haskell.

For all of my functional programming teaching materials, head over to the fpclass organisation.

You can also find my website at michael-gale.co.uk.

wai-saml2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wai-saml2's Issues

Validating SAML responses without encrypted assertions

It seems from this line that this package only supports SAML responses with encrypted assertions:

encAssertion <- oneOrFail "EncryptedAssertion is required"

This is further indicated by the fact that saml2PrivateKey is required in SAML2Config:

-- | The service provider's private key, used to decrypt data from
-- the identity provider.
saml2PrivateKey :: !PrivateKey,

We have SAML responses with assertions that aren't encrypted, is it possible to support this use-case?

zlib-0.7 compatibility

Stackage Nightly is using zlib-0.7, so wai-saml2 can't be used with the other packages. It would be nice if wai-saml2 accepted zlib-0.7.

Rename NameId to NameID?

I find it slightly confusing because it's called NameID in specification. Probably now is the best opportunity given that the subjectNameId field is inaccessible in the latest Hackage release.

Release for version 0.4

There have been quite a few changes since the last release (thanks @fumieval and @Philonous!) and it would be good to get a new version published to Hackage. There are a good number of breaking changes, so it will be a major version release (0.4). There are three open PRs currently which would be nice to include in this release:

Once they are finished and merged, I will prepare a new release.

containers-0.7 not accepted

As you can see on version history, GHC 9.10 has containers-0.7. However , this version is excluded by wai-saml2.cabal. It would nice to accept this version. That might unblock using wai-saml2 on GHC 9.10.

Incomplete handling of `Conditions`

To check the validity of an Assertion, we should also check AudienceRestrictions. (This doesn't seem to happen at the moment)

To quote [1] (lines 922 - 925)

Note that multiple elements MAY be included in a single assertion, and each
MUST be evaluated independently. The effect of this requirement and the preceding definition is that
within a given condition, the audiences form a disjunction (an "OR") while multiple conditions form a
conjunction (an "AND").

As I understand it, this means:

  • The Conditions can contain multiple (zero or more) <AudienceRestriction> elements
  • Each AudienceRestriction can include multiple (one or more) Audience elements
  • To validate an AudienceRestriction, we have to accept one of the Audiences in it (OR), but all of the AudienceRestrictions have be validated (AND)

I'll work on a PR

References:

wai-saml2-tests: test-data/sp.pem: openBinaryFile: does not exist

This broke Stackage Nightly, so allow the testsuite to fail for now.

Test suite failure for package wai-saml2-0.2.1.1
    wai-saml2-tests:  exited with: ExitFailure 1
Full log available at /var/stackage/work/unpack-dir/.stack-work/logs/wai-saml2-0.2.1.1-test.log

    wai-saml2-tests: test-data/sp.pem: openBinaryFile: does not exist (No such file or directory)

edit: I see the testsuite was just added

wai-saml2-0.3.0.0 test suite failure (from hackage tarball)

Stackage runs your package's tests from the hackage tarball, not from github source. We encountered the following error running the wai-saml2-0.3.0.0 test suite:

      keycloak: FAIL
        Error parsing XML file tests/data/keycloak.xml: tests/data/keycloak.xml: openBinaryFile: does not exist (No such file or directory)
        Use -p '/keycloak/' to rerun this test only.
      okta:     FAIL
        Error parsing XML file tests/data/okta.xml: tests/data/okta.xml: openBinaryFile: does not exist (No such file or directory)
        Use -p '/okta/' to rerun this test only.

I believe this can be resolved by adding the test xml files to extra-source-files

No-op status code check

validateResponse checks that the response status is Success, however, there is only one status code defined: Success, so the check is a no-op.

Presence of any other status code is handled as a parse failure instead of a validation failure.

While this isn't directly a problem, I think it would be more consistent to parse status codes and let the validation check for success.

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.