Chad has uploaded a new change for review.
https://gerrit.wikimedia.org/r/246997
Change subject: Check IP when communicating with Consumer
......................................................................
Check IP when communicating with Consumer
Check IP restriction whenever validating an OAuth request.
Bug: T103022
Change-Id: Id4d9d42ff0c39fb66dd9b55383b48d754af87b4c
---
M backend/MWOAuthServer.php
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth
refs/changes/97/246997/1
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 3cec553..843737f 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -131,6 +131,17 @@
}
/**
+ * Wrap the call to the parent function and check that the source IP of
+ * the request is allowed by this consumer's restrictions.
+ * @return array
+ */
+ public function verify_request( &$request ) {
+ list( $consumer, $token ) = parent::verify_request( $request );
+ $this->checkSourceIP( $consumer, $request );
+ return array( $consumer, $token );
+ }
+
+ /**
* Ensure the request comes from an approved IP address, if IP
restriction has been
* setup by the Consumer. It throws an exception if IP address is
invalid.
*
--
To view, visit https://gerrit.wikimedia.org/r/246997
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4d9d42ff0c39fb66dd9b55383b48d754af87b4c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: REL1_26
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits