trestle.core.beta_features
trestle.core.beta_features ¤
Beta feature registration and configuration support.
Attributes¤
BETA_FEATURES = {'json-signing': BetaFeature(name='json-signing', description='Sign and verify JSON artifacts with detached DSSE envelopes.', commands=['trestle sign', 'trestle verify'], since_version='4.0.3', stability='beta', documentation_url='https://oscal-compass.github.io/compliance-trestle/tutorials/cli/#trestle-sign', enabled_by_default=False, deprecation_version=None), 'json-manifest-signing': BetaFeature(name='json-manifest-signing', description='Generate, sign, and verify JSON package manifests for JSON artifacts.', commands=['trestle generate-manifest', 'trestle sign-manifest', 'trestle verify-manifest'], since_version='4.0.3', stability='beta', documentation_url='https://oscal-compass.github.io/compliance-trestle/tutorials/cli/#trestle-generate-manifest', enabled_by_default=False, deprecation_version=None)} module-attribute ¤
BETA_FEATURE_ATTR = '_trestle_beta_feature' module-attribute ¤
BETA_FLAG_HELP = 'Run this beta command one time without enabling it in config.' module-attribute ¤
BETA_SECTION = 'beta' module-attribute ¤
BetaCallable = TypeVar('BetaCallable', bound=Callable[..., int]) module-attribute ¤
ENABLED_FEATURES_KEY = 'enabled_features' module-attribute ¤
TRESTLE_BETA_FEATURES_ENV = 'TRESTLE_BETA_FEATURES' module-attribute ¤
Classes¤
BetaFeature dataclass ¤
Definition of a beta feature.
Source code in trestle/core/beta_features.py
37 38 39 40 41 42 43 44 45 46 47 48 | |
Attributes¤
commands instance-attribute ¤
deprecation_version = None class-attribute instance-attribute ¤
description instance-attribute ¤
documentation_url instance-attribute ¤
enabled_by_default = False class-attribute instance-attribute ¤
name instance-attribute ¤
since_version instance-attribute ¤
stability instance-attribute ¤
Methods:¤
__init__(name, description, commands, since_version, stability, documentation_url, enabled_by_default=False, deprecation_version=None) ¤
Functions:¤
beta_feature(feature_name) ¤
Decorate a command run method so it requires an enabled beta feature.
Source code in trestle/core/beta_features.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
disable_all_features(trestle_root) ¤
Disable every config-enabled beta feature and return the number changed.
Source code in trestle/core/beta_features.py
176 177 178 179 180 181 182 183 | |
disable_feature(feature_name, trestle_root) ¤
Disable a beta feature in the selected config file and return True if it changed.
Source code in trestle/core/beta_features.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
enable_all_features(trestle_root) ¤
Enable every registered beta feature and return the number changed.
Source code in trestle/core/beta_features.py
166 167 168 169 170 171 172 173 | |
enable_feature(feature_name, trestle_root) ¤
Enable a beta feature in the selected config file and return True if it changed.
Source code in trestle/core/beta_features.py
130 131 132 133 134 135 136 137 138 139 140 141 | |
get_beta_config_path(trestle_root) ¤
Get the beta config path for a trestle workspace path or the user fallback.
Source code in trestle/core/beta_features.py
91 92 93 94 95 96 | |
get_beta_feature(feature_name) ¤
Get a registered beta feature by name.
Source code in trestle/core/beta_features.py
99 100 101 102 103 104 | |
get_beta_feature_name(command_callable) ¤
Get the beta feature name from a decorated command callable if present.
Source code in trestle/core/beta_features.py
215 216 217 218 219 220 221 | |
get_enabled_features(trestle_root) ¤
Get registered beta features enabled for the given trestle root.
Source code in trestle/core/beta_features.py
112 113 114 115 116 117 118 119 120 121 | |
get_registered_features() ¤
Get all registered beta features.
Source code in trestle/core/beta_features.py
107 108 109 | |
get_user_beta_config_path() ¤
Get the user-level beta feature config path.
Source code in trestle/core/beta_features.py
81 82 83 84 85 86 87 88 | |
is_beta_enabled(feature_name, trestle_root) ¤
Return True if the beta feature is registered and enabled.
Source code in trestle/core/beta_features.py
124 125 126 127 | |
parse_feature_names(feature_names) ¤
Parse comma and whitespace separated beta feature names.
Source code in trestle/core/beta_features.py
75 76 77 78 | |
handler: python