Skip to content

Commit

Permalink
attestation-service: implement *_policy() methods for EAR token broker
Browse files Browse the repository at this point in the history
without the changes, kbs-client "set-attestation-policy" gets
"not supported" errors.

the changes are taken from 'simple' token broker. Both token
brokers have a policy_engine instance created.

Signed-off-by: Mikko Ylinen <[email protected]>
  • Loading branch information
mythi authored and fitzthum committed Dec 16, 2024
1 parent 5eb7a0d commit 0722e4c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions attestation-service/src/token/ear_broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,27 @@ impl AttestationTokenBroker for EarAttestationTokenBroker {

Ok(signed_ear)
}

async fn set_policy(&self, policy_id: String, policy: String) -> Result<()> {
self.policy_engine
.set_policy(policy_id, policy)
.await
.map_err(Error::from)
}

async fn list_policies(&self) -> Result<HashMap<String, String>> {
self.policy_engine
.list_policies()
.await
.map_err(Error::from)
}

async fn get_policy(&self, policy_id: String) -> Result<String> {
self.policy_engine
.get_policy(policy_id)
.await
.map_err(Error::from)
}
}

impl EarAttestationTokenBroker {
Expand Down

0 comments on commit 0722e4c

Please sign in to comment.