Skip to content
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

Revision suppression / deletion detection #172

Merged
merged 6 commits into from
Feb 13, 2015
Merged

Revision suppression / deletion detection #172

merged 6 commits into from
Feb 13, 2015

Conversation

d00rman
Copy link
Contributor

@d00rman d00rman commented Feb 11, 2015

This PR build on #169 and provides the mechanism needed to deny access to revisions with restrictions. It is enforced both when requesting info about a specific revision (with or without providing a title), as well as its contents.

If a specific revision is passed in, a second, parallel request is made to the page_revisions module to determine whether the sought revision is accessible. In case it is restricted, access in denied to the user. Note that the content itself is fetched and stored regardless of access restrictions.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.01%) to 85.01% when pulling 64917c9 on phab/T76165 into 9bc8050 on master.

Whenever information about a revision is being retrieved (either from
storage or by querying MW's API), its restrictions are now checked. If
any of the *hidden fields are set, access is automatically denied to the
caller.
@gwicke
Copy link
Member

gwicke commented Feb 12, 2015

Rebased onto master

@d00rman d00rman mentioned this pull request Feb 12, 2015
@coveralls
Copy link

Coverage Status

Coverage increased (+0.35%) to 85.01% when pulling 5eda59a on phab/T76165 into bec5db2 on master.

If a specific revision is passed in, a second, parallel request is made
to the page_revisions module to determine whether the sought revision is
accessible. In case it is restricted, access in denied to the user. Note
that the content itself is fetched and stored regardless of access
restrictions.
@d00rman d00rman changed the title [WIP] Revision suppression / deletion detection Revision suppression / deletion detection Feb 12, 2015
@coveralls
Copy link

Coverage Status

Coverage increased (+1.23%) to 85.89% when pulling ed297ec on phab/T76165 into bec5db2 on master.

* @throws rbUtil.httpError if access to the revision should be denied
*/
PRS.prototype._checkRevReturn = function(res) {
var item = res && res.body && Array.isArray(res.body.items) && res.body.items[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the table storage API guarantees that a successful reply includes an items array, so we should be able to only check for its length.

gwicke added a commit that referenced this pull request Feb 13, 2015
Revision suppression / deletion detection
@gwicke gwicke merged commit 4d87db7 into master Feb 13, 2015
d00rman added a commit that referenced this pull request Feb 13, 2015
@d00rman d00rman mentioned this pull request Feb 13, 2015
gwicke added a commit that referenced this pull request Feb 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants