Acquire.Service._service_account module

push_is_running_service()[source]

Internal function used to push into the ‘running_service’ state. While we are in this state then we view that all code is running as part of a running service

pop_is_running_service()[source]

Internal function used to pop out from the ‘running_service’ state. While we are in this state then we view that all code is running as part of a running service

is_running_service()[source]

Return whether or not this code is running as part of a service

assert_running_service()[source]

Assert that this code is running as part of a valid service

setup_this_service(canonical_url, service_type)[source]

Call this function to setup a new service that will serve at ‘canonical_url’, will be of the specified service_type.

  1. Delete the object store value “_service” if you want to reset the actual Service. This will assign a new UID for the service which would reset the certificates and keys. This new service will need to be re-introduced to other services that need to trust it
add_admin_user(service, account_uid, authorisation=None)[source]

Function that is called to add a new user account as a service administrator. If this is the first account then authorisation is not needed. If this is the second or subsequent admin account, then you need to provide an authorisation signed by one of the existing admin users. If you need to reset the admin users then delete the user accounts from the service.

get_this_service(need_private_access=False)[source]

Return the service info object for this service. If private access is needed then this will decrypt and access the private keys and signing certificates, which is slow if you just need the public certificates.

get_admin_users()[source]

This function returns all of the admin_users data. This is a dictionary of the UIDs of all of the admin users

get_service_private_key(fingerprint=None)[source]

This function returns the private key for this service

save_service_keys_to_objstore(include_old_keys=False)[source]

Call this function to ensure that the current set of keys used for this service are saved to object store

get_service_private_certificate(fingerprint=None)[source]

This function returns the private signing certificate for this service

get_service_public_key(fingerprint=None)[source]

This function returns the public key for this service

get_service_public_certificate(fingerprint=None)[source]

This function returns the public certificate for this service

clear_serviceinfo_cache()[source]

Clear the caches used to accelerate loading the service info and admin user objects

get_service_user_account_uid(accounting_service_uid)[source]

Return the UID of the financial Acquire.Accounting.Account that is held on the accounting service with UID ‘accounting_service_uid’ for the service user on this service. This is the account to which payment for this service should be sent

create_service_user_account(service, accounting_service_url)[source]

Call this function to create the financial service account for this service on the accounting service at ‘accounting_service_url’

This does nothing if the account already exists