Repository navigation
Bug 2099092 - Remove the obsolete api_key_only user preference now that the native REST API only accepts API keys, OAuth2 tokens, or cookie + api token #2849
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -196,12 +196,6 @@ sub SETTINGS { | |
| default => 'on', | ||
| category => 'Reviews and Needinfo' | ||
| }, | ||
| { | ||
| name => 'api_key_only', | ||
| options => ['on', 'off'], | ||
| default => 'off', | ||
| category => 'API' | ||
| }, | ||
| { | ||
| name => 'autosize_comments', | ||
| options => ['on', 'off'], | ||
|
|
@@ -217,6 +211,14 @@ sub SETTINGS { | |
| ]; | ||
| } | ||
|
|
||
| # Settings that used to be defined in SETTINGS and must be deleted, along | ||
| # with any user choices for them, from existing installations. | ||
| use constant OBSOLETE_SETTINGS => ( | ||
|
|
||
| # 2026-11-29 -- Bug 2099092 | ||
| 'api_key_only', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add a test for |
||
| ); | ||
|
|
||
| use constant SYSTEM_GROUPS => ( | ||
| {name => 'admin', description => 'Administrators'}, | ||
| {name => 'tweakparams', description => 'Can change Parameters'}, | ||
|
|
@@ -319,6 +321,10 @@ sub update_settings { | |
| foreach my $params (@settings) { | ||
| add_setting($params); | ||
| } | ||
|
|
||
| foreach my $name (OBSOLETE_SETTINGS) { | ||
| remove_setting($name); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we deploy with old and new pods serving traffic at once? If checksetup deletes the |
||
| } | ||
| } | ||
|
|
||
| sub update_system_groups { | ||
|
|
@@ -590,6 +596,11 @@ issues after the database is completely set up and configured. | |
|
|
||
| Contains information about Settings, used by L</update_settings()>. | ||
|
|
||
| =item C<OBSOLETE_SETTINGS> | ||
|
|
||
| Names of Settings that are no longer used. L</update_settings()> deletes | ||
| them, along with any user choices for them. | ||
|
|
||
| =back | ||
|
|
||
| =head1 SUBROUTINES | ||
|
|
@@ -598,7 +609,8 @@ Contains information about Settings, used by L</update_settings()>. | |
|
|
||
| =item C<update_settings()> | ||
|
|
||
| Description: Adds and updates Settings for users. | ||
| Description: Adds and updates Settings for users, and removes any | ||
| listed in L</OBSOLETE_SETTINGS>. | ||
|
|
||
| Params: none | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -251,10 +251,6 @@ sub members_report { | |
| $rh_user->{groups} = [$rh->{name}]; | ||
| $rh_user->{lastseeon} = $member->last_seen_date; | ||
| $rh_user->{mfa} = $member->mfa; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bug says consumers of the group members JSON output should be told that |
||
| $rh_user->{api_key_only} | ||
| = $member->settings->{api_key_only}->{value} eq 'on' | ||
| ? JSON::true | ||
| : JSON::false; | ||
| } | ||
| $users{$login} = $rh_user; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,7 +257,6 @@ th.title { | |
| cursor: help; | ||
| } | ||
|
|
||
| .mfa-api-blurb, | ||
| .mfa-disable-blurb { | ||
| width: 70%; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no API request reaches
Bugzilla::Auth::Login::Cookieanymore, aren't the rest of thei_am_webservice()branches here (Bugzilla_api_token,login_token, theinvalid_cookies_or_tokenerror) also dead? Should we file a follow-up to remove those too, so the next reader doesn't assume they still guard the API?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted! 👍 And I agree: nothing calls
Bugzilla->login()in a REST usage context anymore, the Mojo login plugin does its own checks, so thei_am_webservice()branches inCookie.pmare dead (and probably most ofBugzilla::Auth::Login::APIKey, which returnsAUTH_NODATAoutside of them).As it fits the REST-to-Mojo cleanup (2057358), I can file the follow-up and work on it, if everyone agrees.