Module: ChefLicensing
- Defined in:
- lib/chef-licensing/license.rb,
lib/chef-licensing.rb,
lib/chef-licensing/config.rb,
lib/chef-licensing/context.rb,
lib/chef-licensing/version.rb,
lib/chef-licensing/api/client.rb,
lib/chef-licensing/api/describe.rb,
lib/chef-licensing/cli_flags/thor.rb,
lib/chef-licensing/exceptions/error.rb,
lib/chef-licensing/api/list_licenses.rb,
lib/chef-licensing/api/parser/client.rb,
lib/chef-licensing/list_license_keys.rb,
lib/chef-licensing/restful_client/v1.rb,
lib/chef-licensing/api/parser/describe.rb,
lib/chef-licensing/license_key_fetcher.rb,
lib/chef-licensing/restful_client/base.rb,
lib/chef-licensing/cli_flags/mixlib_cli.rb,
lib/chef-licensing/license_key_validator.rb,
lib/chef-licensing/tui_engine/tui_engine.rb,
lib/chef-licensing/tui_engine/tui_prompt.rb,
lib/chef-licensing/tui_engine/tui_actions.rb,
lib/chef-licensing/exceptions/client_error.rb,
lib/chef-licensing/licensing_service/local.rb,
lib/chef-licensing/license_key_fetcher/base.rb,
lib/chef-licensing/license_key_fetcher/file.rb,
lib/chef-licensing/exceptions/describe_error.rb,
lib/chef-licensing/tui_engine/tui_exceptions.rb,
lib/chef-licensing/config_fetcher/arg_fetcher.rb,
lib/chef-licensing/config_fetcher/env_fetcher.rb,
lib/chef-licensing/exceptions/invalid_license.rb,
lib/chef-licensing/license_key_fetcher/prompt.rb,
lib/chef-licensing/tui_engine/tui_interaction.rb,
lib/chef-licensing/tui_engine/tui_engine_state.rb,
lib/chef-licensing/exceptions/list_licenses_error.rb,
lib/chef-licensing/api/license_feature_entitlement.rb,
lib/chef-licensing/exceptions/feature_not_entitled.rb,
lib/chef-licensing/exceptions/restful_client_error.rb,
lib/chef-licensing/api/license_software_entitlement.rb,
lib/chef-licensing/exceptions/software_not_entitled.rb,
lib/chef-licensing/exceptions/license_file_corrupted.rb,
lib/chef-licensing/exceptions/unsupported_content_type.rb,
lib/chef-licensing/license_key_fetcher/license_file/v3.rb,
lib/chef-licensing/license_key_fetcher/license_file/v4.rb,
lib/chef-licensing/license_key_fetcher/license_file/base.rb,
lib/chef-licensing/exceptions/invalid_file_format_version.rb,
lib/chef-licensing/exceptions/missing_api_credentials_error.rb,
lib/chef-licensing/exceptions/restful_client_connection_error.rb
Overview
LicenseKeyFetcher allows us to inspect obtain the license Key from the user in a variety of ways.
Defined Under Namespace
Modules: Api, CLIFlags, LicenseFile, RestfulClient
Classes: ArgFetcher, ClientError, Config, Context, DescribeError, EnvFetcher, Error, FeatureNotEntitled, InvalidFileFormatVersion, InvalidLicense, License, LicenseFileCorrupted, LicenseKeyFetcher, LicenseKeyValidator, LicensingService, ListLicenseKeys, ListLicensesError, MissingAPICredentialsError, RestfulClientConnectionError, RestfulClientError, SoftwareNotEntitled, TUIEngine, UnsupportedContentType
Constant Summary
collapse
- VERSION =
"1.0.4".freeze
Class Method Summary
collapse
Class Method Details
.check_feature_entitlement!(feature_name: nil, feature_id: nil) ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/chef-licensing.rb', line 25
def check_feature_entitlement!(feature_name: nil, feature_id: nil)
license = client(license_keys: license_keys)
feature_entitlements = license.feature_entitlements.select { |feature| feature.id == feature_id || feature.name == feature_name }
if feature_entitlements.empty?
raise(ChefLicensing::FeatureNotEntitled)
else
true
end
end
|
.check_software_entitlement! ⇒ Object
.client(opts = {}) ⇒ Object
21
22
23
|
# File 'lib/chef-licensing.rb', line 21
def configure(&block)
yield(ChefLicensing::Config)
end
|
.fetch_and_persist ⇒ Object
Note:
fetch_and_persist is invoked by chef-products to fetch and persist the license keys
.license_context ⇒ Object
.license_keys ⇒ Object
Note:
no in-memory caching of the licenses so that it fetches updated licenses always
.list_license_keys_info(opts = {}) ⇒ Object