This is an archive of the discontinued Mercurial Phabricator instance.

wireproto: declare permissions requirements in @wireprotocommand (API)
ClosedPublic

Authored by indygreg on Mar 7 2018, 7:24 PM.

Details

Summary

With the security patches from 4.5.2 merged into default, we now
have a per-command attribute defining what permissions are needed
to run that command. We now have a richer @wireprotocommand that
can be extended to record additional command metadata. So we
port the permissions mechanism to be based on @wireprotocommand.

.. api::

hgweb_mod.perms and wireproto.permissions have been removed. Wire
protocol commands should declare their required permissions in the
@wireprotocommand decorator.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Mar 7 2018, 7:24 PM
durin42 accepted this revision.Mar 9 2018, 1:51 PM
This revision is now accepted and ready to land.Mar 9 2018, 1:51 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Mar 10 2018, 3:38 AM
yuja added inline comments.
mercurial/wireproto.py
711

Perhaps ProgrammingError is preferred here because it shouldn't
be a user-facing error.

indygreg added inline comments.Mar 10 2018, 11:26 AM
mercurial/wireproto.py
711

I agree. I'll send a follow-up (unless we want to amend hg-committed).