paul-rouse / yesod-auth-hashdb Goto Github PK
View Code? Open in Web Editor NEWYesod.Auth.HashDB plugin, now moved out of main yesod-auth package
License: MIT License
Yesod.Auth.HashDB plugin, now moved out of main yesod-auth package
License: MIT License
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.
'sokay if you don't want to bother, but "passphrase" is a better term, and I'd like to see it adopted more widely.
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)’
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.