/
UnconfirmedEmailAddresses.pm
518 lines (509 loc) · 18.8 KB
/
UnconfirmedEmailAddresses.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
package t::MusicBrainz::Server::Controller::UnconfirmedEmailAddresses;
use Test::Routine;
use Test::Deep qw( cmp_set );
use Test::More;
use HTTP::Status ':constants';
use Hook::LexWrap;
use List::AllUtils 'uniq';
use MusicBrainz::Server::Test qw( html_ok );
use Set::Scalar;
with 't::Context', 't::Mechanize';
my @unconfirmed_email_whitelist;
test 'Paths that allow browsing without a confirmed email address' => sub {
my $test = shift;
my $c = $test->c;
my $mech = $test->mech;
my @actions_without_edit_attribute =
map {
my $fqn = $_->fully_qualified_name;
$fqn =~ s/MusicBrainz::Server:://;
$fqn;
}
grep {
# Find all actions that users can access. These are actions that
# are Local, or have a Path/PathPart
my $attributes = Set::Scalar->new(@{$_->attributes});
$attributes->size > 0 &&
(
(grep /^Path(Part)?/, $attributes->elements) > 0 ||
$attributes->has('Local')
) &&
!$attributes->has('Edit')
}
map { MusicBrainz::Server->controller($_)->get_action_methods }
grep {
# Find all concrete MusicBrainz::Server controllers
my $controller = MusicBrainz::Server->controller($_);
$controller->isa('Catalyst::Controller') &&
$controller->meta->name =~ /^MusicBrainz::Server::Controller::/
} MusicBrainz::Server->controllers;
cmp_set(
\@actions_without_edit_attribute,
\@unconfirmed_email_whitelist
);
};
@unconfirmed_email_whitelist = (
"Controller::Account::Subscriptions::Artist::add",
"Controller::Account::Subscriptions::Artist::remove",
"Controller::Account::Subscriptions::Collection::add",
"Controller::Account::Subscriptions::Collection::remove",
"Controller::Account::Subscriptions::Editor::add",
"Controller::Account::Subscriptions::Editor::remove",
"Controller::Account::Subscriptions::Label::add",
"Controller::Account::Subscriptions::Label::remove",
"Controller::Account::Subscriptions::Series::add",
"Controller::Account::Subscriptions::Series::remove",
"Controller::Account::applications",
"Controller::Account::change_password",
"Controller::Account::donation",
"Controller::Account::edit",
"Controller::Account::edit_application",
"Controller::Account::index",
"Controller::Account::lost_password",
"Controller::Account::lost_username",
"Controller::Account::preferences",
"Controller::Account::register",
"Controller::Account::register_application",
"Controller::Account::remove_application",
"Controller::Account::resend_verification",
"Controller::Account::reset_password",
"Controller::Account::revoke_application_access",
"Controller::Account::verify_email",
"Controller::Admin::Attributes::attribute_base",
"Controller::Admin::Attributes::attribute_index",
"Controller::Admin::Attributes::index",
"Controller::Admin::WikiDoc::history",
"Controller::Admin::WikiDoc::index",
"Controller::Admin::delete_user",
"Controller::Admin::edit_banner",
"Controller::Admin::edit_user",
"Controller::Admin::index",
"Controller::Ajax::filter_artist_recordings_form",
"Controller::Ajax::filter_artist_release_groups_form",
"Controller::Ajax::filter_artist_releases_form",
"Controller::Area::alias",
"Controller::Area::aliases",
"Controller::Area::annotation_diff",
"Controller::Area::annotation_history",
"Controller::Area::annotation_revision",
"Controller::Area::base",
"Controller::Area::details",
"Controller::Area::edits",
"Controller::Area::latest_annotation",
"Controller::Area::open_edits",
"Controller::Area::show",
"Controller::Area::downvote_tags",
"Controller::Area::upvote_tags",
"Controller::Area::withdraw_tags",
"Controller::Area::tags",
"Controller::Area::wikipedia_extract",
"Controller::Artist::alias",
"Controller::Artist::aliases",
"Controller::Artist::annotation_diff",
"Controller::Artist::annotation_history",
"Controller::Artist::annotation_revision",
"Controller::Artist::base",
"Controller::Artist::commons_image",
"Controller::Artist::credit",
"Controller::Artist::details",
"Controller::Artist::edits",
"Controller::Artist::import",
"Controller::Artist::latest_annotation",
"Controller::Artist::open_edits",
"Controller::Artist::ratings",
"Controller::Artist::relationships",
"Controller::Artist::show",
"Controller::Artist::downvote_tags",
"Controller::Artist::upvote_tags",
"Controller::Artist::withdraw_tags",
"Controller::Artist::tags",
"Controller::Artist::wikipedia_extract",
"Controller::AutoEditorElections::base",
"Controller::AutoEditorElections::index",
"Controller::AutoEditorElections::nominate",
"Controller::AutoEditorElections::show",
"Controller::CDStub::add",
"Controller::CDStub::base",
"Controller::CDStub::browse",
"Controller::CDStub::show",
"Controller::CDTOC::attach",
"Controller::CDTOC::base",
"Controller::CDTOC::show",
"Controller::Collection::base",
"Controller::Collection::create",
"Controller::Collection::edits",
"Controller::Collection::open_edits",
"Controller::Collection::show",
"Controller::Doc::relationship_type",
"Controller::Doc::show",
"Controller::Edit::base",
"Controller::Edit::edit_type",
"Controller::Edit::edit_types",
"Controller::Edit::enter_votes",
"Controller::Edit::notes_received",
"Controller::Edit::open",
"Controller::Edit::search",
"Controller::Edit::show",
"Controller::Edit::subscribed",
"Controller::Edit::subscribed_editors",
"Controller::FreeDB::base",
"Controller::FreeDB::show",
"Controller::Event::alias",
"Controller::Event::aliases",
"Controller::Event::annotation_diff",
"Controller::Event::annotation_history",
"Controller::Event::annotation_revision",
"Controller::Event::base",
"Controller::Event::details",
"Controller::Event::edits",
"Controller::Event::latest_annotation",
"Controller::Event::open_edits",
"Controller::Event::ratings",
"Controller::Event::show",
"Controller::Event::downvote_tags",
"Controller::Event::upvote_tags",
"Controller::Event::withdraw_tags",
"Controller::Event::tags",
"Controller::Event::wikipedia_extract",
"Controller::Instrument::alias",
"Controller::Instrument::aliases",
"Controller::Instrument::annotation_diff",
"Controller::Instrument::annotation_history",
"Controller::Instrument::annotation_revision",
"Controller::Instrument::base",
"Controller::Instrument::commons_image",
"Controller::Instrument::details",
"Controller::Instrument::edits",
"Controller::Instrument::latest_annotation",
"Controller::Instrument::list",
"Controller::Instrument::open_edits",
"Controller::Instrument::show",
"Controller::Instrument::downvote_tags",
"Controller::Instrument::upvote_tags",
"Controller::Instrument::withdraw_tags",
"Controller::Instrument::tags",
"Controller::Instrument::wikipedia_extract",
"Controller::ISRC::_load",
"Controller::ISRC::base",
"Controller::ISRC::show",
"Controller::ISWC::_load",
"Controller::ISWC::base",
"Controller::ISWC::show",
"Controller::JS::js_text_setup",
"Controller::JS::statistics_js_text_strings",
"Controller::Label::alias",
"Controller::Label::aliases",
"Controller::Label::annotation_diff",
"Controller::Label::annotation_history",
"Controller::Label::annotation_revision",
"Controller::Label::base",
"Controller::Label::details",
"Controller::Label::edits",
"Controller::Label::latest_annotation",
"Controller::Label::open_edits",
"Controller::Label::ratings",
"Controller::Label::relationships",
"Controller::Label::show",
"Controller::Label::downvote_tags",
"Controller::Label::upvote_tags",
"Controller::Label::withdraw_tags",
"Controller::Label::tags",
"Controller::Label::wikipedia_extract",
"Controller::Medium::base",
"Controller::Medium::fragments",
"Controller::OAuth2::authorize",
"Controller::OAuth2::oob",
"Controller::OAuth2::token",
"Controller::OAuth2::tokeninfo",
"Controller::OAuth2::userinfo",
"Controller::OtherLookup::artist-ipi",
"Controller::OtherLookup::artist-isni",
"Controller::OtherLookup::barcode",
"Controller::OtherLookup::catno",
"Controller::OtherLookup::discid",
"Controller::OtherLookup::freedbid",
"Controller::OtherLookup::index",
"Controller::OtherLookup::isrc",
"Controller::OtherLookup::iswc",
"Controller::OtherLookup::label-ipi",
"Controller::OtherLookup::label-isni",
"Controller::OtherLookup::mbid",
"Controller::OtherLookup::url",
"Controller::Partners::amazon",
"Controller::Place::alias",
"Controller::Place::aliases",
"Controller::Place::annotation_diff",
"Controller::Place::annotation_history",
"Controller::Place::annotation_revision",
"Controller::Place::base",
"Controller::Place::commons_image",
"Controller::Place::details",
"Controller::Place::edits",
"Controller::Place::latest_annotation",
"Controller::Place::open_edits",
"Controller::Place::show",
"Controller::Place::downvote_tags",
"Controller::Place::upvote_tags",
"Controller::Place::withdraw_tags",
"Controller::Place::tags",
"Controller::Place::wikipedia_extract",
"Controller::Rating::rate",
"Controller::Recording::alias",
"Controller::Recording::aliases",
"Controller::Recording::annotation_diff",
"Controller::Recording::annotation_history",
"Controller::Recording::annotation_revision",
"Controller::Recording::base",
"Controller::Recording::details",
"Controller::Recording::edits",
"Controller::Recording::fingerprints",
"Controller::Recording::latest_annotation",
"Controller::Recording::open_edits",
"Controller::Recording::ratings",
"Controller::Recording::show",
"Controller::Recording::downvote_tags",
"Controller::Recording::upvote_tags",
"Controller::Recording::withdraw_tags",
"Controller::Recording::tags",
"Controller::Relationship::LinkAttributeType::base",
"Controller::Relationship::LinkAttributeType::create",
"Controller::Relationship::LinkAttributeType::index",
"Controller::Relationship::LinkType::base",
"Controller::Relationship::LinkType::create",
"Controller::Relationship::LinkType::index",
"Controller::Relationship::LinkType::tree",
"Controller::Relationship::LinkType::type_specific",
"Controller::Release::alias",
"Controller::Release::aliases",
"Controller::Release::annotation_diff",
"Controller::Release::annotation_history",
"Controller::Release::annotation_revision",
"Controller::Release::base",
"Controller::Release::cover_art",
"Controller::Release::cover_art_uploaded",
"Controller::Release::details",
"Controller::Release::edits",
"Controller::Release::latest_annotation",
"Controller::Release::lookup",
"Controller::Release::open_edits",
"Controller::Release::show",
"Controller::Release::downvote_tags",
"Controller::Release::upvote_tags",
"Controller::Release::withdraw_tags",
"Controller::Release::tags",
"Controller::ReleaseGroup::alias",
"Controller::ReleaseGroup::aliases",
"Controller::ReleaseGroup::annotation_diff",
"Controller::ReleaseGroup::annotation_history",
"Controller::ReleaseGroup::annotation_revision",
"Controller::ReleaseGroup::base",
"Controller::ReleaseGroup::details",
"Controller::ReleaseGroup::edits",
"Controller::ReleaseGroup::latest_annotation",
"Controller::ReleaseGroup::open_edits",
"Controller::ReleaseGroup::ratings",
"Controller::ReleaseGroup::show",
"Controller::ReleaseGroup::downvote_tags",
"Controller::ReleaseGroup::upvote_tags",
"Controller::ReleaseGroup::withdraw_tags",
"Controller::ReleaseGroup::tags",
"Controller::ReleaseGroup::wikipedia_extract",
"Controller::Report::index",
"Controller::Report::show",
"Controller::Root::default",
"Controller::Root::index",
"Controller::Root::set_beta_preference",
"Controller::Root::set_language",
"Controller::Search::search",
"Controller::Series::alias",
"Controller::Series::aliases",
"Controller::Series::annotation_diff",
"Controller::Series::annotation_history",
"Controller::Series::annotation_revision",
"Controller::Series::base",
"Controller::Series::details",
"Controller::Series::edits",
"Controller::Series::latest_annotation",
"Controller::Series::open_edits",
"Controller::Series::show",
"Controller::Series::downvote_tags",
"Controller::Series::upvote_tags",
"Controller::Series::withdraw_tags",
"Controller::Series::tags",
"Controller::Series::wikipedia_extract",
"Controller::Statistics::countries",
"Controller::Statistics::coverart",
"Controller::Statistics::dataset",
"Controller::Statistics::editors",
"Controller::Statistics::edits",
"Controller::Statistics::formats",
"Controller::Statistics::individual_timeline",
"Controller::Statistics::languages_scripts",
"Controller::Statistics::relationships",
"Controller::Statistics::statistics",
"Controller::Statistics::timeline",
"Controller::Statistics::timeline_redirect",
"Controller::Tag::base",
"Controller::Tag::cloud",
"Controller::Tag::area",
"Controller::Tag::artist",
"Controller::Tag::event",
"Controller::Tag::instrument",
"Controller::Tag::label",
"Controller::Tag::place",
"Controller::Tag::recording",
"Controller::Tag::release",
"Controller::Tag::release_group",
"Controller::Tag::series",
"Controller::Tag::show",
"Controller::Tag::work",
"Controller::TagLookup::index",
"Controller::Test::accept_edit",
"Controller::Test::reject_edit",
"Controller::Track::base",
"Controller::Track::show",
"Controller::URL::base",
"Controller::URL::edits",
"Controller::URL::open_edits",
"Controller::URL::show",
"Controller::User::Edits::accepted",
"Controller::User::Edits::all",
"Controller::User::Edits::autoedits",
"Controller::User::Edits::cancelled",
"Controller::User::Edits::failed",
"Controller::User::Edits::open",
"Controller::User::Edits::rejected",
"Controller::User::Edits::votes",
"Controller::User::base",
"Controller::User::collections",
"Controller::User::login",
"Controller::User::logout",
"Controller::User::privileged",
"Controller::User::profile",
"Controller::User::rating_summary",
"Controller::User::ratings",
"Controller::User::tag",
"Controller::User::tags",
"Controller::WS::1::Artist::lookup",
"Controller::WS::1::Artist::root",
"Controller::WS::1::Collection::collection",
"Controller::WS::1::Label::lookup",
"Controller::WS::1::Label::root",
"Controller::WS::1::Rating::rating",
"Controller::WS::1::Release::lookup",
"Controller::WS::1::Release::root",
"Controller::WS::1::Release::search",
"Controller::WS::1::ReleaseGroup::lookup",
"Controller::WS::1::ReleaseGroup::root",
"Controller::WS::1::Tag::tag",
"Controller::WS::1::Track::lookup",
"Controller::WS::1::Track::root",
"Controller::WS::1::Track::search",
"Controller::WS::1::User::user_repository",
"Controller::WS::2::Annotation::annotation_search",
"Controller::WS::2::Annotation::base",
"Controller::WS::2::Area::area",
"Controller::WS::2::Area::area_search",
"Controller::WS::2::Area::base",
"Controller::WS::2::Artist::artist",
"Controller::WS::2::Artist::artist_search",
"Controller::WS::2::Artist::base",
"Controller::WS::2::CDStub::cdstub_search",
"Controller::WS::2::Collection::artists_get",
"Controller::WS::2::Collection::base",
"Controller::WS::2::Collection::list_list",
"Controller::WS::2::Collection::places_get",
"Controller::WS::2::Collection::recordings_get",
"Controller::WS::2::Collection::releases",
"Controller::WS::2::Collection::releases_get",
"Controller::WS::2::Collection::events_get",
"Controller::WS::2::Collection::works_get",
"Controller::WS::2::DiscID::discid",
"Controller::WS::2::FreeDB::freedb_search",
"Controller::WS::2::Event::base",
"Controller::WS::2::Event::event",
"Controller::WS::2::Event::event_search",
"Controller::WS::2::Instrument::base",
"Controller::WS::2::Instrument::instrument",
"Controller::WS::2::Instrument::instrument_search",
"Controller::WS::2::ISRC::isrc",
"Controller::WS::2::ISWC::iswc",
"Controller::WS::2::Label::base",
"Controller::WS::2::Label::label",
"Controller::WS::2::Label::label_search",
"Controller::WS::2::Place::base",
"Controller::WS::2::Place::place",
"Controller::WS::2::Place::place_search",
"Controller::WS::2::Rating::rating_lookup",
"Controller::WS::2::Recording::base",
"Controller::WS::2::Recording::recording",
"Controller::WS::2::Recording::recording_search",
"Controller::WS::2::Release::base",
"Controller::WS::2::Release::release",
"Controller::WS::2::Release::release_search",
"Controller::WS::2::ReleaseGroup::base",
"Controller::WS::2::ReleaseGroup::release_group",
"Controller::WS::2::ReleaseGroup::release_group_search",
"Controller::WS::2::Series::base",
"Controller::WS::2::Series::series",
"Controller::WS::2::Series::series_search",
"Controller::WS::2::Tag::tag_search",
"Controller::WS::2::URL::base",
"Controller::WS::2::URL::url",
"Controller::WS::2::URL::url_search",
"Controller::WS::2::Work::base",
"Controller::WS::2::Work::work",
"Controller::WS::2::Work::work_search",
"Controller::WS::js::Area::search",
"Controller::WS::js::Artist::search",
"Controller::WS::js::CheckDuplicates::check_duplicates",
"Controller::WS::js::Editor::search",
"Controller::WS::js::Event::search",
"Controller::WS::js::Instrument::search",
"Controller::WS::js::Label::search",
"Controller::WS::js::Place::search",
"Controller::WS::js::Recording::search",
"Controller::WS::js::Release::release",
"Controller::WS::js::Release::search",
"Controller::WS::js::ReleaseGroup::search",
"Controller::WS::js::Series::search",
"Controller::WS::js::Work::search",
"Controller::WS::js::cdstub",
"Controller::WS::js::cdstub_search",
"Controller::WS::js::cover_art_upload",
"Controller::WS::js::default",
"Controller::WS::js::entity",
"Controller::WS::js::error",
"Controller::WS::js::events",
"Controller::WS::js::freedb",
"Controller::WS::js::freedb_search",
"Controller::WS::js::medium",
"Controller::WS::js::medium_search",
"Controller::WS::js::LastUpdatedRecordings::recent",
"Controller::WS::js::ParseCoordinates::parse_coordinates",
"Controller::Watch::list",
"Controller::Work::alias",
"Controller::Work::aliases",
"Controller::Work::annotation_diff",
"Controller::Work::annotation_history",
"Controller::Work::annotation_revision",
"Controller::Work::base",
"Controller::Work::details",
"Controller::Work::edits",
"Controller::Work::latest_annotation",
"Controller::Work::open_edits",
"Controller::Work::ratings",
"Controller::Work::show",
"Controller::Work::downvote_tags",
"Controller::Work::upvote_tags",
"Controller::Work::withdraw_tags",
"Controller::Work::tags",
"Controller::Work::wikipedia_extract",
"ControllerBase::WS::1::load",
"ControllerBase::WS::1::root",
"ControllerBase::WS::1::search",
"ControllerBase::WS::2::root",
"ControllerBase::WS::js::root",
"ControllerBase::WS::js::root",
);
1;