mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
feat: get_policies: Way to obtain policy files and content (#267)
closes #254 Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
ee898e112e
commit
46e28b36f8
@@ -184,10 +184,18 @@ impl Engine {
|
||||
|
||||
/// Get the list of packages defined by loaded policies.
|
||||
///
|
||||
pub fn get_packages(&mut self) -> Result<Vec<String>> {
|
||||
pub fn get_packages(&self) -> Result<Vec<String>> {
|
||||
self.engine.get_packages()
|
||||
}
|
||||
|
||||
/// Get the list of policies.
|
||||
///
|
||||
pub fn get_policies(&self) -> Result<String> {
|
||||
Ok(serde_json::to_string_pretty(
|
||||
&self.engine.get_policies_as_json()?,
|
||||
)?)
|
||||
}
|
||||
|
||||
/// Add policy data.
|
||||
///
|
||||
/// * `data`: Rego value. A Rego value is a number, bool, string, None
|
||||
|
||||
Reference in New Issue
Block a user