api.admin.controller package

Submodules

api.admin.controller.admin_auth_services module

class api.admin.controller.admin_auth_services.AdminAuthServicesController(manager)[source]

Bases: SettingsController

process_admin_auth_services()[source]

Fetch, create, or update admin_auth_services

Returns:

dict: if Get request returns a dict of auth services and protocols Response: If POST request updates or creates auth services and protocols.

process_delete(protocol)[source]

Delete an auth service from the database

Args:

protocol (string): Name of protocol to search for the service to be deleted.

Returns:

Response: (‘Deleted’, 200)

process_get()[source]

Return dict of auth services and protocols available to library

Returns:

dict: auth_services and protocols available

process_post()[source]

Create new auth_service if none exists and set service and protocol

form: ‘protocol’ form: ‘id’ form: ‘name’

Returns:

Response: ProblemDetail or string of auth_service.protocol and 200, or 201 if newly created service

validate_form_fields(**fields)[source]

Check that 1) the user has selected a valid protocol, 2) the user has not left the required fields blank, and 3) the user is not attempting to change the protocol of an existing admin auth service.

api.admin.controller.analytics_services module

class api.admin.controller.analytics_services.AnalyticsServicesController(manager)[source]

Bases: SettingsController

process_analytics_services()[source]
process_delete(service_id)[source]
process_get()[source]
process_post()[source]
validate_form_fields(**fields)[source]

The ‘name’ and ‘URL’ fields cannot be blank, the URL must be valid, and the protocol must be selected from the list of recognized protocols.

api.admin.controller.catalog_services module

class api.admin.controller.catalog_services.CatalogServicesController(manager)[source]

Bases: SettingsController

check_libraries(service)[source]

Check that no library ended up with multiple MARC export integrations.

get_name(service)[source]

Check that there isn’t already a service with this name

process_catalog_services()[source]
process_delete(service_id)[source]
process_get()[source]
process_post()[source]
update_protocol_settings()[source]
validate_form_fields(protocol)[source]

Verify that the protocol which the user has selected is in the list of recognized protocol options.

api.admin.controller.cdn_services module

class api.admin.controller.cdn_services.CDNServicesController(manager)[source]

Bases: SettingsController

process_cdn_services()[source]
process_delete(service_id)[source]
process_get()[source]
process_post()[source]
validate_form_fields(**fields)[source]

The ‘name’ and ‘protocol’ fields cannot be blank, and the protocol must be selected from the list of recognized protocols. The URL must be valid.

api.admin.controller.collection_library_registrations module

class api.admin.controller.collection_library_registrations.CollectionLibraryRegistrationsController(manager)[source]

Bases: SettingsController

Use the OPDS Directory Registration Protocol to register a Collection with its remote source of truth.

Parameters:

registration_class – Mock class to use instead of Registration.

get_library_info(library, collection)[source]

Find the relevant information about the library which the user is trying to register

look_up_collection(collection_id)[source]

Find the collection that the user is trying to register the library with, and check that it actually exists.

look_up_library(library_short_name)[source]

Find the library the user is trying to register, and check that it actually exists.

look_up_registry(external_integration)[source]

Find the remote registry that the user is trying to register the collection with, and check that it is in the list of recognized protocols (currently just SharedODLAPI)

process_collection_library_registrations(do_get=<bound method HTTP.debuggable_get of <class 'core.util.http.HTTP'>>, do_post=<bound method HTTP.debuggable_post of <class 'core.util.http.HTTP'>>, key=None, registration_class=<class 'api.registry.Registration'>)[source]
process_get()[source]
process_post(registration_class, do_get, do_post)[source]

api.admin.controller.collection_self_tests module

class api.admin.controller.collection_self_tests.CollectionSelfTestsController(manager)[source]

Bases: SelfTestsController

get_info(collection)[source]

Compile information about this collection, including the results from the last time, if ever, that the self tests were run.

look_up_by_id(identifier)[source]

Find the collection to display self test results or run self tests for; display an error message if a collection with this ID turns out not to exist

process_collection_self_tests(identifier)[source]
run_tests(collection)[source]

api.admin.controller.collection_settings module

class api.admin.controller.collection_settings.CollectionSettingsController(manager)[source]

Bases: SettingsController

collection_to_dict(collection_object)[source]
find_protocol_class(collection_object)[source]

Figure out which class this collection’s protocol belongs to, from the list of possible protocols defined in PROVIDER_APIS (in SettingsController)

load_libraries(collection_object, user, protocol)[source]

Get a list of the libraries that 1) are associated with this collection and 2) the user is affiliated with

load_settings(protocol_settings, collection_object, collection_settings)[source]

Compile the information about the collection that corresponds to the settings externally imposed by the collection’s protocol.

process_collections()[source]
process_delete(collection_id)[source]
process_get()[source]
process_libraries(protocol, collection)[source]

Go through the libraries that the user is trying to associate with this collection; check that each library actually exists, and that the library-related configuration settings that the user has submitted are complete and valid. If the library passes all of the validations, go ahead and associate it with this collection.

process_post()[source]
process_settings(settings, collection)[source]

Go through the settings that the user has just submitted for this collection, and check that each setting is valid and that no required settings are missing. If the setting passes all of the validations, go ahead and set it for this collection.

validate_collection(**fields)[source]

The protocol of an existing collection cannot be changed, and collections must have unique names.

validate_external_account_id_setting(value, setting)[source]

Check that the user has submitted any required values for associating this collection with an external account.

validate_form_fields(is_new, protocols, **fields)[source]

Check that 1) the required fields aren’t blank, 2) the protocol is on the list of recognized protocols, 3) the collection (if there is one) is valid, and 4) the URL is valid

validate_parent(protocol, collection)[source]

Verify that the parent collection is set properly, then determine the type of the settings that need to be validated: are they 1) settings for a regular collection (e.g. client key and client secret for an Overdrive collection), or 2) settings for a child collection (e.g. library ID for an Overdrive Advantage collection)?

api.admin.controller.discovery_service_library_registrations module

class api.admin.controller.discovery_service_library_registrations.DiscoveryServiceLibraryRegistrationsController(manager)[source]

Bases: SettingsController

List the libraries that have been registered with a specific RemoteRegistry, and allow the admin to register a library with a RemoteRegistry.

Parameters:

registration_class – Mock class to use instead of Registration.

get_library_info(registration)[source]

Find the relevant information about the library which the user is trying to register

look_up_library(library_short_name)[source]

Find the library the user is trying to register, and check that it actually exists.

look_up_registry(integration_id)[source]

Find the RemoteRegistry that the user is trying to register the library with, and check that it actually exists.

process_discovery_service_library_registrations(registration_class=None, do_get=<bound method HTTP.debuggable_get of <class 'core.util.http.HTTP'>>, do_post=<bound method HTTP.debuggable_post of <class 'core.util.http.HTTP'>>)[source]
process_get(do_get=<bound method HTTP.debuggable_get of <class 'core.util.http.HTTP'>>)[source]

Make a list of all discovery services, each with the list of libraries registered with that service and the status of the registration.

process_post(registration_class, do_get, do_post)[source]

Attempt to register a library with a RemoteRegistry.

api.admin.controller.discovery_services module

class api.admin.controller.discovery_services.DiscoveryServicesController(manager)[source]

Bases: SettingsController

look_up_service_from_registry(protocol, id)[source]

Find an existing service, and make sure that the user is not trying to edit its protocol.

process_delete(service_id)[source]
process_discovery_services()[source]
process_get()[source]
process_post()[source]
set_up_default_registry()[source]

Set up the default library registry; no other registries exist yet.

validate_form_fields(**fields)[source]

The ‘name’ and ‘protocol’ fields cannot be blank, and the protocol must be selected from the list of recognized protocols. The URL must be valid.

api.admin.controller.individual_admin_settings module

class api.admin.controller.individual_admin_settings.IndividualAdminSettingsController(manager)[source]

Bases: SettingsController

check_permissions(admin, settingUp)[source]

Before going any further, check that the user actually has permission to create/edit this type of admin

handle_password(password, admin, is_new, settingUp)[source]

Check that the user has permission to change this type of admin’s password

handle_roles(admin, roles, settingUp)[source]

Compare the admin’s existing set of roles against the roles submitted in the form, and, unless there’s a problem with the roles or the permissions, modify the admin’s roles accordingly

look_up_library_for_role(role)[source]

If the role is affiliated with a particular library, as opposed to being sitewide, find the library (and check that it actually exists).

process_delete(email)[source]
process_get()[source]
process_individual_admins()[source]
process_post()[source]
response(admin, is_new)[source]
validate_form_fields(email)[source]

Check that 1) the user has entered something into the required email field, and 2) if so, the input is formatted as a valid email address.

validate_role_exists(role)[source]

api.admin.controller.library_settings module

class api.admin.controller.library_settings.LibrarySettingsController(manager)[source]

Bases: SettingsController

check_for_missing_fields(settings)[source]
check_for_missing_settings(settings)[source]

Verify that header links and labels are the same length.

check_short_name_unique(library, short_name)[source]
check_web_color_contrast(settings)[source]

Verify that the web primary and secondary color both contrast well on white, as these colors will serve as button backgrounds with white test, as well as text color on white backgrounds.

create_library(short_name, library_uuid)[source]
current_value(setting, library)[source]

Retrieve the current value of the given setting from the database.

get_extra_geographic_information(value)[source]
get_library_from_uuid(library_uuid)[source]
image_setting(setting)[source]

Retrieve an uploaded image for the given setting from the current HTTP request.

library_configuration_settings(library, validators_by_format, settings=None)[source]

Validate and update a library’s configuration settings based on incoming new values.

Parameters:
  • library – A Library

  • validators_by_format – A dictionary mapping the ‘format’ field from a setting configuration to a corresponding validator object.

  • settings – A list of setting configurations to use in tests instead of Configuration.LIBRARY_SETTINGS

list_setting(setting, json_objects=False)[source]

Retrieve the list of values for the given setting from the current HTTP request.

Parameters:

json_objects – If this is True, the incoming settings are JSON-encoded objects and not regular strings.

Returns:

A JSON-encoded string encoding the list of values set for the given setting in the current request.

process_delete(library_uuid)[source]
process_get()[source]
process_libraries()[source]
process_post(validators_by_type=None)[source]
scalar_setting(setting)[source]

Retrieve the single value of the given setting from the current HTTP request.

validate_form_fields()[source]

api.admin.controller.metadata_service_self_tests module

Self-tests for metadata integrations.

class api.admin.controller.metadata_service_self_tests.MetadataServiceSelfTestsController(manager)[source]

Bases: MetadataServicesController, SelfTestsController

look_up_by_id(id)[source]
process_metadata_service_self_tests(identifier)[source]

api.admin.controller.metadata_services module

class api.admin.controller.metadata_services.MetadataServicesController(manager)[source]

Bases: SitewideRegistrationController

find_protocol_class(integration)[source]
process_delete(service_id)[source]
process_get()[source]
process_metadata_services()[source]
process_post(do_get=<bound method HTTP.debuggable_get of <class 'core.util.http.HTTP'>>, do_post=<bound method HTTP.debuggable_post of <class 'core.util.http.HTTP'>>)[source]
register_with_metadata_wrangler(do_get, do_post, is_new, service)[source]

Register this site with the Metadata Wrangler.

validate_form_fields(**fields)[source]

The ‘name’ and ‘protocol’ fields cannot be blank, and the protocol must be selected from the list of recognized protocols. The URL must be valid.

api.admin.controller.patron_auth_service_self_tests module

class api.admin.controller.patron_auth_service_self_tests.PatronAuthServiceSelfTestsController(manager)[source]

Bases: SelfTestsController, PatronAuthServicesController

get_info(patron_auth_service)[source]
look_up_by_id(identifier)[source]
process_patron_auth_service_self_tests(identifier)[source]
run_tests(patron_auth_service)[source]

api.admin.controller.patron_auth_services module

class api.admin.controller.patron_auth_services.PatronAuthServicesController(manager)[source]

Bases: SettingsController

check_external_type(library, auth_service)[source]

Check that the library’s external type regular expression is valid, if it was set.

check_identifier_restriction(library, auth_service)[source]

Check whether the library’s identifier restriction regular expression is set and is supposed to be a regular expression; if so, check that it’s valid.

check_libraries(auth_service)[source]

Run the three library validation methods on each of the libraries for which the user is trying to configure this patron auth service.

check_library_integrations(library)[source]

Check that the library didn’t end up with multiple basic auth services.

get_name(auth_service)[source]

Check that there isn’t already an auth service with this name

process_delete(service_id)[source]
process_get()[source]
process_patron_auth_services()[source]
process_post()[source]
validate_form_fields(protocol)[source]

Verify that the protocol which the user has selected is in the list of recognized protocol options.

api.admin.controller.search_service_self_tests module

class api.admin.controller.search_service_self_tests.SearchServiceSelfTestsController(manager)[source]

Bases: SelfTestsController, ExternalSearchTest

look_up_by_id(identifier)[source]
process_search_service_self_tests(identifier)[source]

api.admin.controller.self_tests module

class api.admin.controller.self_tests.SelfTestsController(manager)[source]

Bases: SettingsController

find_protocol_class(integration)[source]

Given an ExternalIntegration, find the class on which run_tests() or prior_test_results() should be called, and any extra arguments that should be passed into the call.

get_info(integration)[source]
run_tests(integration)[source]
self_tests_process_get(identifier)[source]
self_tests_process_post(identifier)[source]

api.admin.controller.sitewide_services module

class api.admin.controller.sitewide_services.LoggingServicesController(manager)[source]

Bases: SitewideServicesController

process_delete(service_id)[source]
process_services()[source]
class api.admin.controller.sitewide_services.SearchServicesController(manager)[source]

Bases: SitewideServicesController

process_delete(service_id)[source]
process_services()[source]
class api.admin.controller.sitewide_services.SitewideServicesController(manager)[source]

Bases: SettingsController

process_get(protocols, goal, service_key_name)[source]
process_post(protocols, goal, multiple_sitewide_services_detail)[source]
validate_form_fields(protocols, **fields)[source]

The ‘name’ and ‘protocol’ fields cannot be blank, and the protocol must be selected from the list of recognized protocols.

api.admin.controller.sitewide_settings module

class api.admin.controller.sitewide_settings.SitewideConfigurationSettingsController(manager)[source]

Bases: SettingsController

process_delete(key)[source]
process_get()[source]
process_post()[source]
process_services()[source]
validate_form_fields(setting, fields)[source]

api.admin.controller.storage_services module

class api.admin.controller.storage_services.StorageServicesController(manager)[source]

Bases: SettingsController

process_delete(service_id)[source]
process_get()[source]
process_post()[source]
process_services()[source]

api.admin.controller.work_editor module

class api.admin.controller.work_editor.WorkController(manager)[source]

Bases: AdminCirculationManagerController

BOTTOM = 'bottom'
CENTER = 'center'
MINIMUM_COVER_HEIGHT = 900
MINIMUM_COVER_WIDTH = 600
STAFF_WEIGHT = 1000
TITLE_POSITIONS = ['top', 'center', 'bottom']
TOP = 'top'
change_book_cover(identifier_type, identifier, mirrors=None)[source]

Save a new book cover based on the submitted form.

classifications(identifier_type, identifier)[source]

Return list of this work’s classifications.

Args:

identifier_type (string): Type of identifier e.g ISBN identifier (string): Identifier for a work

Returns:

dict: A dict of work with list of classifications for the work.

complaints(identifier_type, identifier)[source]

Return detailed complaint information for admins.

custom_lists(identifier_type, identifier)[source]
details(identifier_type, identifier)[source]

Return an OPDS entry with detailed information for admins.

This includes relevant links for editing the book.

Returns:

An OPDSEntryResponse

edit(identifier_type, identifier)[source]

Edit a work’s metadata.

edit_classifications(identifier_type, identifier)[source]

Edit a work’s audience, target age, fiction status, and genres.

generate_cover_image(work, identifier_type, identifier, preview=False)[source]
languages()[source]

Return the supported language codes and their English names.

media()[source]

Return the supported media types for a work and their schema.org values.

preview_book_cover(identifier_type, identifier)[source]

Return a preview of the submitted cover image information.

refresh_metadata(identifier_type, identifier, provider=None)[source]

Refresh the metadata for a book from the content server

resolve_complaints(identifier_type, identifier)[source]

Resolve all complaints for a particular license pool and complaint type.

rights_status()[source]

Return the supported rights status values with their names and whether they are open access.

roles()[source]

Return a mapping from MARC codes to contributor roles.

suppress(identifier_type, identifier)[source]

Suppress the license pool associated with a book.

unsuppress(identifier_type, identifier)[source]

Unsuppress all license pools associated with a book.

TODO: This will need to be revisited when we distinguish between complaints about a work and complaints about a LicensePoool.

Module contents

class api.admin.controller.AdminCirculationManagerController(manager)[source]

Bases: CirculationManagerController

Parent class that provides methods for verifying an admin’s roles.

require_higher_than_librarian()[source]
require_librarian(library)[source]
require_library_manager(library)[source]
require_sitewide_library_manager()[source]
require_system_admin()[source]
class api.admin.controller.AdminController(manager)[source]

Bases: object

admin_auth_provider(type)[source]

Return an auth provider with the given type. If no auth provider has this type, return None.

property admin_auth_providers
authenticated_admin(admin_details)[source]

Creates or updates an admin with the given details

authenticated_admin_from_request()[source]

Returns an authenticated admin or a problem detail.

check_csrf_token()[source]

Verifies that the CSRF token in the form data or X-CSRF-Token header matches the one in the session cookie.

generate_csrf_token()[source]

Generate a random CSRF token.

get_csrf_token()[source]

Returns the CSRF token for the current session.

class api.admin.controller.CustomListsController(manager)[source]

Bases: AdminCirculationManagerController

custom_list(list_id)[source]
custom_lists()[source]
url_for_custom_list(library, list)[source]
class api.admin.controller.DashboardController(manager)[source]

Bases: AdminCirculationManagerController

bulk_circulation_events(analytics_exporter=None)[source]
circulation_events()[source]

Return dict of circulation events for a given work.

Optional “num” parameter in request to change number of results.

Returns:

dict: A dictionary of events

stats()[source]

Return an accounting of library statistics

Returns:

dict: Stats total licenses, available licenses, and patrons for each library.

class api.admin.controller.FeedController(manager)[source]

Bases: AdminCirculationManagerController

complaints()[source]
genres()[source]
suppressed()[source]
class api.admin.controller.LanesController(manager)[source]

Bases: AdminCirculationManagerController

change_order()[source]
hide_lane(lane_identifier)[source]
lane(lane_identifier)[source]
lanes()[source]
reset()[source]
show_lane(lane_identifier)[source]
class api.admin.controller.PatronController(manager)[source]

Bases: AdminCirculationManagerController

lookup_patron(authenticator=None)[source]

Look up personal information about a patron via the ILS.

Parameters:

authenticator – A LibraryAuthenticator. This is for mocking during tests; it’s not necessary to provide it normally.

reset_adobe_id(authenticator=None)[source]

Delete all Credentials for a patron that are relevant to the patron’s Adobe Account ID.

Parameters:

authenticator – A LibraryAuthenticator. This is for mocking during tests; it’s not necessary to provide it normal

class api.admin.controller.SettingsController(manager)[source]

Bases: AdminCirculationManagerController

METADATA_SERVICE_URI_TYPE = 'application/opds+json;profile=https://librarysimplified.org/rel/profile/metadata-service'
NO_MIRROR_INTEGRATION = 'NO_MIRROR'
PROVIDER_APIS = [<class 'core.opds_import.OPDSImporter'>, <class 'api.opds_for_distributors.OPDSForDistributorsAPI'>, <class 'core.opds2_import.OPDS2Importer'>, <class 'api.proquest.importer.ProQuestOPDS2Importer'>, <class 'api.overdrive.OverdriveAPI'>, <class 'api.odilo.OdiloAPI'>, <class 'api.bibliotheca.BibliothecaAPI'>, <class 'api.axis.Axis360API'>, <class 'api.rbdigital.RBDigitalAPI'>, <class 'api.enki.EnkiAPI'>, <class 'api.odl.ODLAPI'>, <class 'api.odl.SharedODLAPI'>, <class 'api.feedbooks.FeedbooksOPDSImporter'>, <class 'api.lcp.collection.LCPAPI'>]
check_name_unique(new_service, name)[source]

A service cannot be created with, or edited to have, the same name as a service that already exists. This method is used by analytics_services, cdn_services, discovery_services, metadata_services, and sitewide_services.

check_url_unique(new_service, url, protocol, goal)[source]

Enforce a rule that a given circulation manager can only have one integration that uses a given URL for a certain purpose.

Whether to enforce this rule for a given type of integration is up to you – it’s a good general rule but there are conceivable exceptions.

This method is used by discovery_services.

look_up_service_by_id(id, protocol, goal=None)[source]

Find an existing service, and make sure that the user is not trying to edit its protocol. This method is used by analytics_services, cdn_services, metadata_services, and sitewide_services.

set_protocols(service, protocol, protocols=None)[source]

Validate the protocol that the user has submitted; depending on whether the validations pass, either save it to this metadata service or return an error message. This method is used by analytics_services, cdn_services, discovery_services, metadata_services, and sitewide_services.

classmethod url_variants(url, check_protocol_variant=True)[source]

Generate minor variants of a URL – HTTP vs HTTPS, trailing slash vs not, etc.

Technically these are all distinct URLs, but in real life they generally mean someone typed the same URL slightly differently. Since this isn’t an exact science, this doesn’t need to catch all variant URLs, only the most common ones.

validate_formats(settings=None, validator=None)[source]
validate_protocol(protocols=None)[source]
class api.admin.controller.SignInController(manager)[source]

Bases: AdminController

ERROR_RESPONSE_TEMPLATE = '<!DOCTYPE HTML><html lang="en"><head><meta charset="utf8"></head><body style="\n    margin: 10vh auto;\n    font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;\n    padding: 25px 15px;\n    width: 40vw;\n    color: #403d37;\n    border: 1px solid #DDD;\n    border-radius: 4px;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n\n    border-color: #D0343A;\n"><p><strong>%(status_code)d ERROR:</strong> %(message)s</p><hr style="\n    width: 10vw;\n    margin: 3px 0 0 0;\n    border: none;\n    border-bottom: 1px solid #403d37;\n"><a href="/admin/sign_in" style="\n    background: #1B7FA7;\n    text-align: center;\n    text-decoration: none;\n    border-color: #1B7FA7;\n    border-radius: .25em;\n    color: #fff;\n    padding: 10px;\n    font-size: 1rem;\n    cursor: pointer;\n    display: block;\n    width: 25vw;\n    margin: 2vh auto;\n\n    width: 5vw;\n    margin-bottom: 0;\n">Try again</a></body></html>'
SIGN_IN_TEMPLATE = '<!DOCTYPE HTML><html lang="en"><head><meta charset="utf8"></head><body style="\n    margin: 10vh auto;\n    font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;\n    padding: 25px 15px;\n    width: 40vw;\n    color: #403d37;\n    border: 1px solid #DDD;\n    border-radius: 4px;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n"><h1>Library Simplified</h1>%(auth_provider_html)s</body></html>'
change_password()[source]
error_response(problem_detail)[source]

Returns a problem detail as an HTML response

password_sign_in()[source]
redirect_after_google_sign_in()[source]

Uses the Google OAuth client to determine admin details upon callback. Barring error, redirects to the provided redirect url..

sign_in()[source]

Redirects admin if they’re signed in, or shows the sign in page.

sign_out()[source]
class api.admin.controller.SitewideRegistrationController(manager)[source]

Bases: SettingsController

A controller for managing a circulation manager’s registrations with external services.

Currently the only supported site-wide registration is with a metadata wrangler. The protocol for registration with library registries and ODL collections is similar, but those registrations happen on the level of the individual library, not on the level of the circulation manager.

check_content_type(catalog_response)[source]

Make sure the catalog for the service is in a valid format.

get_catalog(do_get, url)[source]

Get the catalog for this service.

Get the link for registration from the catalog.

get_shared_secret(response)[source]

Find the shared secret which we need to use in order to register this service, or return an error message if there is no shared secret.

process_sitewide_registration(integration, do_get=<bound method HTTP.debuggable_get of <class 'core.util.http.HTTP'>>, do_post=<bound method HTTP.debuggable_post of <class 'core.util.http.HTTP'>>)[source]

Performs a sitewide registration for a particular service.

Returns:

A ProblemDetail or, if successful, None

register(register_url, headers, do_post)[source]

Register this server using the sitewide registration document.

sitewide_registration_document()[source]

Generate the document to be sent as part of a sitewide registration request.

Returns:

A dictionary with keys ‘url’ and ‘jwt’. ‘url’ is the URL to this site’s public key document, and ‘jwt’ is a JSON Web Token proving control over that URL.

update_headers(integration)[source]

If the integration has an existing shared_secret, use it to access the server and update it.

class api.admin.controller.TimestampsController(manager)[source]

Bases: AdminCirculationManagerController

Returns a dict: each key is a type of service (script, monitor, or coverage provider); each value is a nested dict in which timestamps are organized by service name and then by collection ID.

diagnostics()[source]
class api.admin.controller.ViewController(manager)[source]

Bases: AdminController

api.admin.controller.setup_admin_controllers(manager)[source]

Set up all the controllers that will be used by the admin parts of the web app.