Most of the implementation is available in plainbox.impl.secure.providers.v1
Dummy provider useful for creating isolated test cases
A v1 provider implementation.
A provider is a container of jobs and whitelists. It provides additional meta-data and knows about location of essential directories to both load structured data and provide runtime information for job execution.
Providers are normally loaded with Provider1PlugIn, due to the number of fields involved in basic initialization.
required value of CHECKBOX_SHARE environment variable.
Note
This variable is only required by one script. It would be nice to remove this later on.
absolute path of the bin directory
Note
The programs in that directory may not work without setting PYTHONPATH and CHECKBOX_SHARE.
absolute path of the data directory
description of this provider
additional entry for PYTHONPATH, if needed.
This entry is required for CheckBox scripts to import the correct CheckBox python libraries.
Note
The result may be None
Initialize a provider from Provider1Definition object
Parameters: |
|
---|
This method simplifies initialization of a Provider1 object where the caller already has a Provider1Definition object. Depending on the value of definition.location all of the directories are either None or initialized to a good (typical) value relative to location
The only value that you may want to adjust, for working with source providers, is locale_dir, by default it would be location/locale but manage.py i18n creates location/build/mo
Discover and return all executables offered by this provider
Returns: | list of executable names (without the full path) |
---|---|
Raises IOError, OSError: | |
if there were any problems accessing files or directories. Note that OSError is silently ignored when the bin_dir directory is missing. |
Load and parse all of the job definitions of this provider.
Returns: | A sorted list of JobDefinition objects |
---|---|
Raises: |
|
Load all the whitelists from whitelists_dir and return them
This method looks at the whitelist directory and loads all files ending with .whitelist as a WhiteList object.
Returns: | A list of WhiteList objects sorted by plainbox.impl.secure.qualifiers.WhiteList.name. |
---|---|
Raises IOError, OSError: | |
if there were any problems accessing files or directories. Note that OSError is silently ignored when the whitelists_dir directory is missing. |
Get a localized piece of data
Parameters: | msgid – data to translate |
---|---|
Returns: | translated data obtained from the provider if msgid is not False (empty string and None both are) and this provider has a gettext_domain defined for it, msgid itself otherwise. |
the name of the gettext domain associated with this provider
This value may be empty, in such case provider data cannot be localized for the user environment.
absolute path of the jobs directory
Load and parse all of the job definitions of this provider.
Unlike get_builtin_jobs() this method does not stop after the first problem encountered and instead collects all of the problems into a list which is returned alongside the job list.
Returns: | Pair (job_list, problem_list) where each job_list is a sorted list of JobDefinition objects and each item from problem_list is an exception. |
---|
absolute path of the directory with locale data
The value is applicable as argument bindtextdomain()
name of this provider
namespace component of the provider name
This property defines the namespace in which all provider jobs are defined in. Jobs within one namespace do not need to be fully qualified by prefixing their partial identifier with provider namespace (so all stays ‘as-is’). Jobs that need to interact with other provider namespaces need to use the fully qualified job identifier instead.
The identifier is defined as the part of the provider name, up to the colon. This effectively gives organizations flat namespace within one year-domain pair and allows to create private namespaces by using sub-domains.
flag indicating that this provider was loaded from the secure portion of PROVIDERPATH and thus can be used with the plainbox-trusted-launcher-1.
Get the translated version of description()
version of this provider
absolute path of the whitelist directory
A collection of v1 provider plugins.
This FsPlugInCollection subclass carries proper, built-in defaults, that make loading providers easier.
This particular class loads providers from both the system-wide managed locations and per-user location. In addition the list of locations searched can be changed by setting the PROVIDERPATH, which behaves just like PATH, but is used for looking up providers.
Computes the insecure value of PROVIDERPATH.
This value is not used by plainbox-trusted-launcher-1 executable since it would involve reading files outside of the control by the local administrator. This value is used for handing non-root jobs.
Returns: | A list of three strings: * /usr/local/share/plainbox-providers-1 * /usr/share/plainbox-providers-1 * $XDG_DATA_HOME/plainbox-providers-1 |
---|