# HG changeset patch # User Manuel Jacob # Date 1555113686 -7200 # Node ID 3b199593feddc86ccbce0ff8a9f9ce8a3c5f76cb # Parent 4cafe20b79b64135e02797585e6ddaf300024875 hidden: add support to explicitly access hidden changesets via HTTP We now detect hidden access request and validate them while handling HTTP wireprotocol command. This changeset only introduces server support. Client support is added in a subsequent changeset. The mechanism we use for the HTTP wireprotocol is the same as the one used to lift filtering for hgweb. The use of the global `access-hidden` parameter in the http url is a simple and effective approach that * works around the lack of global parameters in wire protocol v1, * reuses the mechanism used for hgweb (that does not use the wireproto), and * can be safely ignored by older client (fitting the best effort contract). The feature is still experimental, so we can easily update the implementation details in the future. However, landing a first implementation now will help test the feature in the wild and iterate on alternative implementations if deemed necessary. diff -r 4cafe20b79b6 -r 3b199593fedd mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py Sat Apr 13 02:00:20 2019 +0200 +++ b/mercurial/wireprotoserver.py Sat Apr 13 02:01:26 2019 +0200 @@ -317,7 +317,8 @@ proto.checkperm(wireprotov1server.commands[cmd].permission) - rsp = wireprotov1server.dispatch(repo, proto, cmd) + accesshidden = hgwebcommon.hashiddenaccess(repo, req) + rsp = wireprotov1server.dispatch(repo, proto, cmd, accesshidden) if isinstance(rsp, bytes): setresponse(HTTP_OK, HGTYPE, bodybytes=rsp)