Koha/Koha
Tomas Cohen Arazi d7168b02bd
Bug 25327: Do not call authenticate_api_request to render the spec
The original code for Koha::REST::V1::Auth::under called
authenticate_api_request when requesting the API spec. This didn't make
sense, and recent changes on what conditions are tested for public
routes, broke the route.

We could add another condition, but it really doesn't make sense to call
authenticate_api_request if it should be publicly available in any
configuration, as discussed on the bug.

This patch adds a trivial check and the requested route, and lets the
request through in any case in 'under'.

To test:
1. Point your browser to:
   http://kohadev.myDNSname.org:8080/api/v1/
   http://kohadev.myDNSname.org:8080/api/v1/.html
=> FAIL: In both cases you get an authorization error.
2. Apply the regression tests patch
3. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth.t
=> FAIL: The tests reflect the situation, and fail
4. Apply this patch
5. Repeat 1 and 3
=> SUCCESS: All good!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-05-11 10:02:29 +01:00
..
Account Bug 24474: Filter out LOST_FOUND 2020-04-03 14:26:32 +01:00
Acquisition Bug 24161: (follow-up) Fix typo in POD 2020-05-04 12:48:17 +01:00
ArticleRequest Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Authority Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Biblio Bug 24827: Standardise on 'UTF-8' as the encoding name 2020-03-16 14:45:39 +00:00
BiblioUtils Bug 24827: Specify UTF-8 as encoding in new_from_xml() 2020-03-16 14:45:47 +00:00
Cache Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Cash Bug 23185: (follow-up) K:C:Register->make_default should use no_triggers 2020-05-08 13:14:59 +02:00
Charges Bug 21443: Remove the dependency on finesCalendar 2020-03-24 11:09:16 +00:00
Checkouts Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Club Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Config Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Course Bug 23727: Editing course reserve items is broken 2020-04-17 13:45:56 +01:00
Edifact Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Exceptions Bug 25423: Add Koha::Exceptions::Object::NotInstantiated 2020-05-08 15:42:37 +02:00
Exporter
ExternalContent Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Filter/MARC Bug 25019: Make the ViewPolicy filter initialization standard 2020-04-08 11:45:47 +01:00
Illrequest Bug 23173: (follow-up) Fix QA script errors 2020-04-06 11:05:14 +01:00
Indexer Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Item Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Library Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
List
MetadataRecord Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Middleware Bug 24538: Handle Net::Netmask parser errors 2020-02-20 08:40:52 +00:00
Misc
Notice Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Number
OAI/Server Bug 24052: Rename XSLT_Handler 2020-03-24 10:42:23 +00:00
Object Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Objects Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Old Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Patron Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Patrons Bug 23473: Don't allow staff password changes for imports 2020-03-27 12:23:12 +00:00
pdfformat Bug 5016: Fix some translation issues with English PDF order templates 2020-02-19 11:26:41 +00:00
Plugins Bug 25099: Sending a LANG variable to plug-in template 2020-05-11 09:49:07 +01:00
RecordProcessor
REST Bug 25327: Do not call authenticate_api_request to render the spec 2020-05-11 10:02:29 +01:00
Schema Bug 24161: (follow-up) DBIC changes 2020-05-04 12:48:23 +01:00
SearchEngine Bug 25325: ElasticSearch mapping export lacks staff_client/opac fields 2020-05-11 09:43:09 +01:00
Serial Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Sitemapper Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
SMS Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Subscription Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
SuggestionEngine
Tags Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Template/Plugin Bug 20415: Add POD 2020-03-26 11:42:11 +00:00
Util Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
XSLT Bug 23290: (RM follow-up) Correction to copyright statement 2020-02-25 14:35:39 +00:00
Z3950Responder Bug 24545: (follow-up) Fix license statements 2020-02-24 14:35:33 +00:00
Account.pm Bug 24474: (follow-up) Add LOST_FOUND logic to Koha::Account::pay 2020-04-03 14:26:32 +01:00
ActionLog.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ActionLogs.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
AdditionalField.pm
AdditionalFields.pm
AdditionalFieldValue.pm
AdditionalFieldValues.pm
AdvancedEditorMacro.pm Bug 17268: (follow-up) Fix translatability 2020-05-04 08:26:22 +01:00
AdvancedEditorMacros.pm Bug 17268: (follow-up) Fix translatability 2020-05-04 08:26:22 +01:00
ApiKey.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ApiKeys.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ArticleRequest.pm Bug 23384: Fix use statement order for ArticleRequest::Status 2020-03-06 15:00:25 +00:00
ArticleRequests.pm Bug 23384: Fix use statement order for ArticleRequest::Status 2020-03-06 15:00:25 +00:00
AudioAlert.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
AudioAlerts.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
AuthorisedValue.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
AuthorisedValueCategories.pm Bug 17355: (QA follow-up) Fix used package name 2020-05-07 19:10:29 -03:00
AuthorisedValueCategory.pm Bug 17355: (QA follow-up) Fix used package name 2020-05-07 19:10:29 -03:00
AuthorisedValues.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Authorities.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Authority.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
AuthUtils.pm Bug 20370: Misleading comment for bcrypt - #encrypt it; Instead it should be #hash it 2020-04-14 08:35:24 +01:00
Biblio.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
BiblioFramework.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
BiblioFrameworks.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Biblioitem.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Biblioitems.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Biblios.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
BiblioUtils.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Cache.pm Bug 13193: Make Memcached usage fork safe 2020-02-07 09:58:47 +00:00
Caches.pm
Calendar.pm Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Checkout.pm Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Checkouts.pm Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
CirculationRule.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
CirculationRules.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Cities.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
City.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ClassSortRule.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ClassSortRules.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ClassSource.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ClassSources.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ClassSplitRule.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ClassSplitRules.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Club.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Clubs.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Config.pm
Course.pm Bug 23727: Add Koha Object(s) related to course reserves 2020-04-17 13:45:51 +01:00
Courses.pm Bug 23727: Add Koha Object(s) related to course reserves 2020-04-17 13:45:51 +01:00
CsvProfile.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
CsvProfiles.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Database.pm Bug 22001: Set unsafe only if RaiseError is not set 2020-03-31 15:17:23 +01:00
DateUtils.pm Bug 25133: Handle 12hr format for dt_from_string 2020-05-04 08:51:22 +01:00
Desk.pm Bug 13881: Add desk management 2020-03-25 09:19:15 +00:00
Desks.pm Bug 13881: Add desk management 2020-03-25 09:19:15 +00:00
EDI.pm Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
Edifact.pm
Email.pm Bug 24826: Remove warnings from Sendmail 2020-04-08 11:47:19 +01:00
Exceptions.pm Bug 24080: Add 'payout' method to Koha::Account::Line 2020-01-03 16:35:38 +00:00
ExternalContent.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
FrameworkPlugin.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Hold.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Holds.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
I18N.pm
Illcomment.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Illcomments.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Illrequest.pm Bug 24840: (follow-up) Catch some further cases of DateTime->now 2020-04-08 11:54:36 +01:00
Illrequestattribute.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Illrequestattributes.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Illrequests.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Item.pm Bug 8132: Adding a new message 'last_item_for_hold' blocking item deletion 2020-05-11 09:56:09 +01:00
Items.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ItemType.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
ItemTypes.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
KeyboardShortcut.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
KeyboardShortcuts.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Libraries.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Library.pm Bug 22823: return undef if KohaAdminEmailAddress not exist 2020-03-18 15:44:27 +00:00
Linktracker.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Localization.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Localizations.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Logger.pm Bug 25172: Remove _recheck_logfile 2020-04-22 13:43:58 +01:00
Manual.pm Bug 24837: Rename selectbranchprinter.pl to set-library.pl 2020-03-24 11:07:22 +00:00
MarcSubfieldStructure.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
MarcSubfieldStructures.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
MetadataIterator.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
MetadataRecord.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
MetaSearcher.pm Bug 24173: Advanced Editor: Show subtitle & published date on the search page 2020-01-03 16:21:29 +00:00
MoreUtils.pm
News.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
NewsItem.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
OAuth.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
OAuthAccessToken.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
OAuthAccessTokens.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Object.pm Bug 23185: Make Koha::Objects->update loop on the object set if needed 2020-05-05 10:58:10 +01:00
Objects.pm Bug 25423: Force call to update and empty with an instanciated object 2020-05-08 15:42:37 +02:00
Patron.pm Bug 23495: Fix if no sms provider defined 2020-04-29 16:57:06 +01:00
Patrons.pm Bug 20443: Fix POD 2020-03-23 13:49:23 +00:00
Plugins.pm
ProblemReport.pm Bug 4461: Update license statements 2020-04-06 11:18:39 +01:00
ProblemReports.pm Bug 4461: Update license statements 2020-04-06 11:18:39 +01:00
Rating.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Ratings.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
RDF.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
RecordProcessor.pm Bug 25008: Overload Koha::RecordProcessor->options to update filters 2020-04-14 08:31:37 +01:00
RefundLostItemFeeRules.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Report.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Reports.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Review.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Reviews.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Schema.pm
Script.pm Bug 23571: (QA follow-up) Remove perlcritic warning 2020-04-14 17:24:35 +01:00
SearchEngine.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
SearchField.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
SearchFields.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
SearchMarcMap.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
SearchMarcMaps.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Serial.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Serials.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
SharedContent.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
SimpleMARC.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Sitemapper.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Statistic.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Statistics.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
StockRotationItem.pm Bug 24840: (follow-up) Catch some further cases of DateTime->now 2020-04-08 11:54:36 +01:00
StockRotationItems.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
StockRotationRota.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
StockRotationRotas.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
StockRotationStage.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
StockRotationStages.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Subscription.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Subscriptions.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Suggestion.pm Bug 23591: Add some useful methods to Koha::Suggestions 2020-04-14 16:36:13 +01:00
SuggestionEngine.pm
Suggestions.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Tag.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Tags.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Token.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
UploadedFile.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
UploadedFiles.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Uploader.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Virtualshelf.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Virtualshelfcontent.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Virtualshelfcontents.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Virtualshelfshare.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Virtualshelfshares.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Virtualshelves.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Z3950Responder.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Z3950Server.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Z3950Servers.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00