-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(jans-cedarling): Policy Store: Parse Schema and Policies #9575
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
97ea92a
feat(jans-cedarling): add PolicyStore and field schema. Also added de…
olehbozhok 7dac32a
test(jans-cedarling): add unit tests to check `parse_cedar_schema` (d…
olehbozhok e01bc54
docs(jans-cedarling): add docs for PolicyStore
olehbozhok 928b2bd
feat(jans-cedarling): add loading policy store based on config
olehbozhok bd0df57
feat(jans-cedarling): add loading policy store to Cedarling
olehbozhok 3449b60
chore(jans-cedarling): rename LogType to LogTypeConfig
olehbozhok 821cc2e
chore(jans-cedarling): fix `log_init` example after updating config
olehbozhok 5cd1c79
chore(jans-cedarling): add allow(dead_code) on schema
olehbozhok d29218e
chore(jans-cedarling): add copyright notice
olehbozhok 6b4ed70
docs(jans-cedarling): add README to init module
olehbozhok a1163bd
docs(jans-cedarling): add README to authz module
olehbozhok 8d8cf8b
chore(jans-cedarling): update message in ErrorLoadPolicyStore::MoreTh…
olehbozhok bf89da3
chore(jans-cedarling): add comments to Cedarling::new
olehbozhok b6dacac
chore(jans-cedarling): remove unnecessary code
olehbozhok 8cd92b3
docs(jans-cedarling): in README removed `Cedarling bindings` section
olehbozhok e724090
chore(jans-cedarling): move position of PolicyStoreMap to be first
olehbozhok cf20191
chore(jans-cedarling): refactor, move errors messages to the enum
olehbozhok df19054
Merge branch 'main' into jans-cedaling-issue-9568
moabu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(jans-cedarling): add loading policy store to Cedarling
Signed-off-by: Oleh Bohzok <olehbozhok@gmail.com>
- Loading branch information
commit bd0df572a0e4766da2b009cd6bf2f32e4105f20b
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than creating different enums for showing error messages, can we just make a single enum for all error messages inside
\jans-cedarling\cedarling\src\models\enum\error
.for Example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea to return the error struct in functions that cover all possible error cases for only the current situation. Because it will be easier to maintain when application grows.
And If we have somethinglike
CedarlingApplicationError
It will have all possible errors for all application.
And when we will be wanted to handle the error cases with match statement, it will be hard to understand what exactly cases current function returns. Because
CedarlingApplicationError
have all possible cases in the application.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what we practise in most of applications. We do not clutter our project with multiple Enums for error messages.
The naming convention of enum items should be sufficient of make its purpose clear. We don't need to make multiple error enums for this.
And I could see
ErrorLoadPolicyStore
in cedar_schem.rs and policy_store.rs. Code duplication does not make sense.