diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-26 15:30:41 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-26 15:30:41 -0600 |
| commit | 187c02e9bf32f152cbca9fd5790f4a6070dbb37d (patch) | |
| tree | 77a8cefe9c95d4f67522d02f0247194c3b39f173 /src/authorization | |
| parent | 91a989b761f97a70e76031988cf570ad5d209f47 (diff) | |
refactor: try to move policy files to /etc/authzd/
Diffstat (limited to 'src/authorization')
| -rw-r--r-- | src/authorization/cedar_authorizer.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs index fb85012e..568bafbc 100644 --- a/src/authorization/cedar_authorizer.rs +++ b/src/authorization/cedar_authorizer.rs @@ -14,21 +14,16 @@ pub struct CedarAuthorizer { } impl CedarAuthorizer { - pub fn new() -> CedarAuthorizer { - let policy_src = include_str!("../../policies/auth_policy.cedar"); - let policies = policy_src.parse().expect("Failed to parse Cedar policies"); - let authorizer = CedarAuth::new(); - + pub fn new(policies: cedar_policy::PolicySet) -> CedarAuthorizer { CedarAuthorizer { policies, - authorizer, + authorizer: CedarAuth::new(), } } } - impl Default for CedarAuthorizer { fn default() -> Self { - Self::new() + Self::new(PolicySet::default()) } } |
