A validator that checks that the value is an absolute path
A validator that checks that the value points to an existing directory
A validator for provider name.
Provider names use a RFC3720 IQN-like identifiers composed of the follwing parts:
Each of the fields has an informal definition below:
- year:
- four digit number
- domain name:
- identifiers separated by dots, at least one dot has to be present
- identifier:
- [a-z][a-z0-9-]*
A specialized plainbox.impl.secure.plugins.IPlugIn that loads a list of plainbox.impl.job.JobDefinition instances from a file.
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.
path of the directory with (perhaps) all of jobs_dir, whitelist_dir, data_dir, bin_dir, locale_dir. This may be None
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 build/bin directory
This value may be None. It depends on location/base_dir being set.
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.
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()
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.
absolute path of the src/ directory
This value may be None. It depends on location/base_dir set.
Get the translated version of description()
A Config-like class for parsing plainbox provider definition files
Note
The location attribute is special, if set, it defines the base directory of all the other directory attributes. If location is unset, then all the directory attributes default to None (that is, there is no directory of that type). This is actually a convention that is implemented in Provider1PlugIn. Here, all the attributes can be Unset and their validators only check values other than Unset.
Pathname of the directory with provider executables
Pathname of the directory with provider data
Description of the provider
effective value of bin_dir
The effective value is bin_dir() itself, unless it is Unset. If it is Unset the effective value is the implicit_bin_dir(), if that value would be valid. The effective value may be None.
effective value of data_dir
The effective value is data_dir() itself, unless it is Unset. If it is Unset the effective value is the implicit_data_dir(), if that value would be valid. The effective value may be None.
effective value of gettext_domian
The effective value is gettex_domain() itself, unless it is Unset. If it is Unset the effective value None.
effective value of jobs_dir
The effective value is jobs_dir() itself, unless it is Unset. If it is Unset the effective value is the implicit_jobs_dir(), if that value would be valid. The effective value may be None.
effective value of locale_dir
The effective value is locale_dir() itself, unless it is Unset. If it is Unset the effective value is the implicit_locale_dir(), if that value would be valid. The effective value may be None.
effective value of whitelists_dir
The effective value is whitelists_dir() itself, unless it is Unset. If it is Unset the effective value is the implicit_whitelists_dir(), if that value would be valid. The effective value may be None.
Name of the gettext domain for translations
implicit value of bin_dir (if Unset)
The implicit value is only defined if location is not Unset. It is the ‘bin’ subdirectory of the directory that location points to.
implicit value of locale_dir (if Unset) as laid out in the source tree
This value is only applicable to source layouts, where the built translation catalogs are in the build/mo directory.
implicit value of data_dir (if Unset)
The implicit value is only defined if location is not Unset. It is the ‘data’ subdirectory of the directory that location points to.
implicit value of jobs_dir (if Unset)
The implicit value is only defined if location is not Unset. It is the ‘jobs’ subdirectory of the directory that location points to.
implicit value of locale_dir (if Unset)
The implicit value is only defined if location is not Unset. It is the ‘locale’ subdirectory of the directory that location points to.
implicit value of whitelists_dir (if Unset)
The implicit value is only defined if location is not Unset. It is the ‘whitelists’ subdirectory of the directory that location points to.
Pathname of the directory with job definitions
Pathname of the directory with locale data
Base directory with provider data
Name of the provider
Version of the provider
Pathname of the directory with whitelists definitions
A specialized IPlugIn that loads Provider1 instances from their definition files
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 the system-wide managed locations. This defines the security boundary, as if someone can compromise those locations then they already own the corresponding system. In consequence this plug in collection does not respect PROVIDERPATH, it cannot be customized to load provider definitions from any other location. This feature is supported by the plainbox.impl.providers.v1.InsecureProvider1PlugInCollection
A validator for provider provider version.
Provider version must be a sequence of non-negative numbers separated by dots. At most one version number must be present, which may be followed by any sub-versions.
A specialized plainbox.impl.secure.plugins.IPlugIn that loads plainbox.impl.secure.qualifiers.WhiteList instances from a file.
Computes the secure value of PROVIDERPATH
This value is used by plainbox-trusted-launcher-1 executable to discover all secure providers.
Returns: | A list of two strings: * /usr/local/share/plainbox-providers-1 * /usr/share/plainbox-providers-1 |
---|