jenkins-bot has submitted this change and it was merged.
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(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 69c10b5..b05dd51 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -132,6 +132,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/246996
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id4d9d42ff0c39fb66dd9b55383b48d754af87b4c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits