-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vouching #1257
Add vouching #1257
Conversation
Vouching allows new users to get added to the uploaders group by way of other people "vouching" for then. This should alleviate privileged Hackage users, since they were previously the only people that could add people to the uploaders group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't hackage do tests either? LIke I'd expect at least all happy paths to have some integration test
vouchee <- lookupUserName =<< userNameInPath dpath | ||
vouchersForVoucher <- queryState vouchState $ GetVouchesFor voucher | ||
existingVouchers <- queryState vouchState $ GetVouchesFor vouchee | ||
case join $ judge ugroup now vouchee vouchersForVoucher existingVouchers voucher of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pawn off all checks to a judge function to immediatly unwrap them again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is primarily such that the logic can be tested. I added tests in the commit 3c82d01.
newUTCTime = timestamp {utctDayTime = secondsToDiffTime truncated} | ||
pure . toUTF8LBS . prettyHtmlFragment . li . stringToHtml $ name <> " vouched on " <> formatShow iso8601Format newUTCTime | ||
|
||
initVouchFeature :: ServerEnv -> IO (UserFeature -> UploadFeature -> IO VouchFeature) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this callback setup required? can't you immediatly chug in UserFeatue and UploadFeature?
eg
initVouchFeature :: ServerEnv -> UserFeature -> UploadFeature -> IO VouchFeature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the pattern used across the codebase, look in Server/Features.hs
(the use site) so see how it's used all over. I don't object to your observation but I think we should change it consistently in a different PR if it needs to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine, it's a minor style nitpick :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've my approval although I know little about hackage
I'll give this a real look soon and edit the text a bit as well, but just as a note i think the right name for the text is endorsement, following arxiv https://info.arxiv.org/help/endorsement.html Of course in the code itself we can keep vouch to not cause a bunch of renames :-P |
@gbaz I added commits to add an e-mail notification when the endorsements have been received and to rename to user-facing pages to refer to 'endorsements'. |
Fixes #1093.
Vouching allows new users to get added to the uploaders group by way of other people "vouching" for then. This should alleviate privileged Hackage users, since they were previously the only people that could add people to the uploaders group.
Tagging @david-christiansen since we discussed this.