summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth/Login
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2015-08-11 19:31:49 +0200
committerDylan William Hardison <dylan@hardison.net>2015-08-11 19:31:49 +0200
commitfa7ae98d1b2e83e88b2861f0826dc89e5b3bbd63 (patch)
tree85d583e196cce1c85a9c985e3f6ce7f39269819b /Bugzilla/Auth/Login
parent589ec37a32d8687d612eedd107748b7afadd07fd (diff)
downloadbugzilla-fa7ae98d1b2e83e88b2861f0826dc89e5b3bbd63.tar.gz
bugzilla-fa7ae98d1b2e83e88b2861f0826dc89e5b3bbd63.tar.xz
Bug 1184332 - Add Restricted API calls for MozReview
Diffstat (limited to 'Bugzilla/Auth/Login')
-rw-r--r--Bugzilla/Auth/Login/APIKey.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/Bugzilla/Auth/Login/APIKey.pm b/Bugzilla/Auth/Login/APIKey.pm
index 902ce4da7..4038cc8b9 100644
--- a/Bugzilla/Auth/Login/APIKey.pm
+++ b/Bugzilla/Auth/Login/APIKey.pm
@@ -22,6 +22,18 @@ use constant requires_verification => 0;
use constant can_login => 0;
use constant can_logout => 0;
+use fields qw(app_id);
+
+sub set_app_id {
+ my ($self, $app_id) = @_;
+ $self->{app_id} = $app_id;
+}
+
+sub app_id {
+ my ($self) = @_;
+ return $self->{app_id};
+}
+
# This method is only available to web services. An API key can never
# be used to authenticate a Web request.
sub get_login_info {
@@ -45,6 +57,7 @@ sub get_login_info {
}
$api_key->update_last_used();
+ $self->set_app_id($api_key->app_id);
return { user_id => $api_key->user_id };
}