New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 787208 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Tricium and Buildbucket plugins should use plugin.restApi.getLoggedIn

Project Member Reported by qyears...@chromium.org, Nov 21 2017

Issue description

Currently in the buildbucket and tricium plugins, we check for the existence of the XSRF_TOKEN cookie in order to check if the user is logged on.

This approach is relatively fragile and the more correct way is to call plugin.restApi().getLoggedIn() where plugin is the Gerrit Plugin API object.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/+/7b439dd75db95dd4a8387836ad969bf4ce725017

commit 7b439dd75db95dd4a8387836ad969bf4ce725017
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Tue Nov 21 21:29:54 2017

Buildbucket plugin: Use plugin.restApi().getLoggedIn.

This changes the plugin from checking for a XSRF_TOKEN cookie
to check if the user is logged in to using the recommended API.

Whatever changes are made here should also be made in the Tricium
plugin, has similar client code.

Bug:  787208 
Change-Id: Id7ddf02b57b11c4dbfdd54596da5ddb98464441e
Reviewed-on: https://chromium-review.googlesource.com/780460
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Viktar Donich <viktard@google.com>

[modify] https://crrev.com/7b439dd75db95dd4a8387836ad969bf4ce725017/src/main/resources/static/buildbucket.js
[modify] https://crrev.com/7b439dd75db95dd4a8387836ad969bf4ce725017/src/main/resources/static/cr-buildbucket-client.js
[modify] https://crrev.com/7b439dd75db95dd4a8387836ad969bf4ce725017/src/main/resources/static/cr-buildbucket-view.html
[modify] https://crrev.com/7b439dd75db95dd4a8387836ad969bf4ce725017/src/main/resources/static/cr-buildbucket-view.js
[modify] https://crrev.com/7b439dd75db95dd4a8387836ad969bf4ce725017/test/buildbucket_test.html
[modify] https://crrev.com/7b439dd75db95dd4a8387836ad969bf4ce725017/test/cr-buildbucket-client_test.html

Status: Fixed (was: Started)

Comment 4 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Comment 5 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment