GithubHelp home page GithubHelp logo

yesod-auth-hashdb's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yesod-auth-hashdb's Issues

Deprecation of getAuthIdHashDB

I am pushing a commit which marks the getAuthIdHashDB function as deprecated. However, I would be happy to reconsider this if anyone wants to make a case for keeping it (or an equivalent - see below).

There are two problems with the function as it stands.

First, from a practical point of view, it provides very little benefit. It is intended for the case where HashDB is the only authentication plugin, which certainly rules it out for my own applications. The scaffolding already contains an implementation of getAuthId in any case, which is fine apart from perhaps wanting to delete the part which automatically adds an unrecognised user to the database. Also, the error reporting of getAuthIdHashDB may not be what is desired, further reducing its utility.

Secondly, it makes an untidy assumption about types: it uses the id in the user table to set a value of type AuthID site. The scaffolding does set type AuthId App = UserId, so this will work in simple cases, and of course the application will fail to compile if the definition of AuthID is changed so as to break this assumption. However, it seems more correct to keep this out of the library and define both AuthId and getAuthId together in the YesodAuth instance.

This has come up now because yesod-auth-1.4.4 has deprecated getAuthId in favour of a new authenticate, and if we did want to keep a drop-in version for HashDB, we should probably make it this new function.

Test suite compilation failure

I believe this is due to the latest basic-prelude release, but I'm not certain:

[2 of 4] Compiling TestTools        ( test/TestTools.hs, dist/build/integration/integration-tmp/TestTools.o )

test/TestTools.hs:84:68: error:
    • Couldn't match type ‘[Char]’ with ‘Text’
      Expected type: Text
        Actual type: String
    • In the first argument of ‘unpack’, namely ‘(show code)’
      In the second argument of ‘(++)’, namely ‘unpack (show code)’
      In the second argument of ‘(++)’, namely
        ‘"but received " ++ unpack (show code)’

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.