cedar-agent icon indicating copy to clipboard operation
cedar-agent copied to clipboard

Add SchemaStore and policy validation

Open Akamatsu21 opened this issue 2 years ago • 15 comments

Created the SchemaMemoryStore with get, update and delete operations Implemented creating schema from file Added API endpoints for the three operations Added validation to policy create/update endpoints

Akamatsu21 avatar Dec 05 '23 22:12 Akamatsu21

Hey @Akamatsu21 - We're taking a look at the PR - but maybe it'll be worth to add some tests here :) Thanks for the contribution !

RazcoDev avatar Dec 11 '23 12:12 RazcoDev

Hey, @Akamatsu21, do you have an estimate of when you can add tests?

obsd avatar Dec 17 '23 14:12 obsd

Hey, @Akamatsu21, do you have an estimate of when you can add tests?

Hello and big apologies, I have been away for the past two weeks on a long holiday. I will have a look at adding some tests, you can expect them by the end of this week. Appreciate your patience on this!

Akamatsu21 avatar Jan 02 '24 12:01 Akamatsu21

Hello @obsd @RazcoDev, I just pushed some unit tests, looking forward to your feedback.

Akamatsu21 avatar Jan 05 '24 20:01 Akamatsu21

Thanks @Akamatsu21, I will ask someone to review :)

obsd avatar Jan 09 '24 18:01 obsd

We currently don't have CI to run the test so we run them manually, please attach a screenshot of the successfully running tests after your changes :)

omer9564 avatar Jan 15 '24 16:01 omer9564

Correct me if I'm wrong but the PR is missing the DataStore changes - validations

omer9564 avatar Jan 15 '24 16:01 omer9564

Correct me if I'm wrong but the PR is missing the DataStore changes - validations

Hi @omer9564 thank you so much for the review, I will address your comments today. As mentioned in the discussion the data store validation is the next item on the list, but I wanted to check that the logic thus far has been correct before I attempt it. I am not expecting the PR to be merged before that's finished.

Akamatsu21 avatar Jan 29 '24 13:01 Akamatsu21

Hey @Akamatsu21 , Overall logic looks very good, besides what I wrote in the comments everything seems ok. Please tag me once you finish with the data store validation and I will re-review everything :)

omer9564 avatar Feb 05 '24 08:02 omer9564

Hi @omer9564 apologies you had to wait quite long for this fairly small update. I completed all the remaining tasks on my original list, please let me know if this is good to be merged. I am attaching a screenshot of passing tests, this was run on the RustRover IDE with the cargo version 1.76.0 (c84b36747 2024-01-18).

By the way, I merged the main branch into this one in order to make sure any tests added by other people still pass. I appreciate in hindsight that maybe a rebase would have made for a cleaner commit history, hope it's not a big issue. cedar-agent-tests

Akamatsu21 avatar Mar 11 '24 18:03 Akamatsu21

Hi @omer9564 apologies you had to wait quite long for this fairly small update. I completed all the remaining tasks on my original list, please let me know if this is good to be merged. I am attaching a screenshot of passing tests, this was run on the RustRover IDE with the cargo version 1.76.0 (c84b36747 2024-01-18).

By the way, I merged the main branch into this one in order to make sure any tests added by other people still pass. I appreciate in hindsight that maybe a rebase would have made for a cleaner commit history, hope it's not a big issue.

cedar-agent-tests

Thanks for the update, will take a look in the following days :)

omer9564 avatar Mar 11 '24 18:03 omer9564

Sorry for the delay, had busy couple of weeks. Will hopefully check this in the first week of April.

omer9564 avatar Mar 24 '24 14:03 omer9564

Looks very good in general,

  • left a single comment on how the error handling of the policy store can be simplified with a reference to rust docs
  • left a single comment on a missing validation on schema mutation @Akamatsu21 Sorry for taking so long to re-review 😅

No worries, and also sorry for taking a while. I should be able to respond faster now. I added the missing validation, but still think the unpacking of that error type is as good as it's going to be, unless we agree to just overhaul the return types

Akamatsu21 avatar May 06 '24 15:05 Akamatsu21

@Akamatsu21 I will try to push it next week :)

omer9564 avatar May 06 '24 16:05 omer9564

@Akamatsu21 Will merge & release a new version later this week

omer9564 avatar May 19 '24 09:05 omer9564

Fixes the discussion #23

omer9564 avatar May 27 '24 08:05 omer9564