|
NAMEOpenXPKI::Config - Connector based configuration layerSYNOPSISuse OpenXPKI::Config; my $cfg = OpenXPKI::Config->new(); # defaults to /usr/local/etc/openxpki/config.d print "Param1=", $cfg->get('subsystem1.group1.param1'), "\n"; You can also specify a different directory holding the configuration: my $cfg = OpenXPKI::Config->new(config_dir => "/tmp/openxpki"); DESCRIPTIONThe new config layer can be seen as a three dimensional system, where the axes are path, version and realm. The path is passed in as parameter to the get_* methods inherited from the parent class Connector::Multi.Version and realm are automagically set from the session context. The version equals to the commit hash of the Config::Versioned base repository. The realm is prepended to the path. Therefore,a call to subsystem1.group1.param1 is resolved to the node I18N_OPENXPKI_DEPLOYMENT_MY_REALM_ID.subsystem1.group1.param1. Exception: The namespace system is a reserved word and is not affected by version/realm mangling. A call to a value below system is always executed on the current head version and the root context. Methodsupdate_head, get_version, get_head_versionNo longer supportedchecksumPrint out the checksum of the current backend, might not be available with all backends.walkQueryPointsRemoved - use Connector::Tee insteadparameters
output Returns a hash structure holding the result of the first non-empty call and the of the resolver which returned the result return { 'VALUE' => $result, 'SOURCE' => $resolver } To query the same path again, put the resolver name into the path: my $value = $conn->get( "$prefix.$resolver.$query" ) configuration You need to provide the list of resolvers as an ordered list along with the data. mydata: resolvers: - testing - repo1 - repo2 testing: foo: 1234 bar: 5678 repo1@: connector:connectors.primary-repo repo2@: connector:connectors.fallback-repo get_inheritFetch a single value from a block using inheritance (like the crypto config).The query $conn->get_inherit('token.ca-signer.backend') will lookup the "inherit" key and use the value to replace the next-to-last path component with it to look up the value again. It will finally return the value found at token.default.backend. The method walks upwards untill it either finds the expected key or it does not find another "inherit". Note: As we can not distinguish an undef value from an unexisiting key, you need to set the empty string to blank an entry. configuration token: default: backend: OpenXPKI::Crypto::Backend::OpenSSL key: /usr/local/etc/openxpki/ca/default.pem ca-signer: inherit: default key: key: /usr/local/etc/openxpki/ca/mykey.pem
Visit the GSP FreeBSD Man Page Interface. |