-
Notifications
You must be signed in to change notification settings - Fork 219
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
Policy imports #1555
Merged
thjaeckle
merged 62 commits into
eclipse-ditto:master
from
bosch-io:feature/importing-policies
Dec 16, 2022
Merged
Policy imports #1555
thjaeckle
merged 62 commits into
eclipse-ditto:master
from
bosch-io:feature/importing-policies
Dec 16, 2022
Conversation
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
…ctoring - preserved via former PoCs and contributions on that topic Co-authored-by: Thomas Jaeckle <thomas.jaeckle@bosch.io> Co-authored-by: Dirk Van Haerenborgh <dirk.vanhaerenborgh@aloxy.io> Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
… allow more differentiated options (implicit, explicit, never). Simplify included/excluded notation from policy imports and expect only a list of (included) policy entries. Adapt PolicyImporter accordingly. Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io> Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
…cyImporterTest. Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io> Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
…y (the limits changed a bit after recent modifications) Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io> Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
…t with other methods Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io> Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io> Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io> Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
…licy Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
…ange * This change indicates a semantic change of the policy and should lead to cache invalidation Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
…mports but instead default to an empty PolicyImports instance if no imports are defined and always return a non-null instance Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
* TODO: think about making PolicyEnforcerProvider and PolicyCacheLoader an akka extension in order to make it a singleton Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
* Only exception is the search, where the cache loader is instantiated differently Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
for the search index Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
… policy changes Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
* The query in MongoThingsSearchUpdaterPersistence wasn't correct because the "id" field was extracted from the JSON pointer which appended a leading slash * We need to remember deleted but still imported policies otherwise the search index is not updated when the imported policy is recreated * Imported policies need to be taken into account when checking if a write model is outdated * The Metadata built by the ThingUpdater needs to preserve the thingPolicy aswell as the referenced policy tags Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Yannic Buergmann <yannic.buergmann@bosch.io>
… but return an error instead (default is still implicit, if value is not provided) Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
…or an imported entry allows WRITE on policy root resource" This reverts commit 92f7ac5.
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
- created a custom PolicyImportsTooLargeException in order to facilitate sending of correct error response to user - small typos and fixes as needed - made the policy imports limit configurable in ditto-limits.conf Signed-off-by: Kalin Kostashki <kalin.kostashki@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
Signed-off-by: Kalin Kostashki <kalin.kostashki@bosch.io>
… feature/importing-policies
Signed-off-by: Kalin Kostashki <kalin.kostashki@bosch.io>
- result.accept called explicitly to for ModifyPolicyImports to run and throw the required exception. Signed-off-by: Kalin Kostashki <kalin.kostashki@bosch.io>
# Conflicts: # internal/utils/persistent-actors/src/main/java/org/eclipse/ditto/internal/utils/persistentactors/AbstractPersistenceActor.java # policies/service/src/main/java/org/eclipse/ditto/policies/service/persistence/actors/PolicySupervisorActor.java # policies/service/src/test/java/org/eclipse/ditto/policies/service/persistence/actors/PolicyPersistenceOperationsActorIT.java
- added the PolicyEnforcerProvider Signed-off-by: Kalin Kostashki <kalin.kostashki@bosch.io>
- mocked PolicyEnforcer in order to trigger the RetrievePolicy command. Signed-off-by: Kalin Kostashki <kalin.kostashki@bosch.io>
…-api-2.yml Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
…policies Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
thjaeckle
force-pushed
the
feature/importing-policies
branch
from
December 15, 2022 16:40
c1459f2
to
1fb43f4
Compare
thjaeckle
approved these changes
Dec 15, 2022
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.
Code reviews were done as part of development process by the Ditto team.
Approving on behalf of the Ditto team 👍
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enables the imports of policies.
One policy would now be able to import other policies(this isn't transitive).
The maximum number of imported policies is also configurable. Currently set to 10.
Resolves: #298