Skip to content
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

Prevent modification/deletion of rules belonging to a subscription #2680

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

dmjb
Copy link
Contributor

@dmjb dmjb commented Mar 15, 2024

Summary

Relates to #2543

These methods ensure that it's not possible to create/update/delete
bundle/namespaced profiles or rule types through the API.

Dedicated methods are supplied for creating these entities with a
subscription ID. These methods will be called by the bundle
management code which will be implemented in a follow up PR.

Patch and delete methods which have not yet been migrated to the
respective service interfaces have been modified to prevent modification
of bundle rule types/profiles.

Rules

  1. Rules and profiles belonging to bundles must have namespaced names.
  2. A namespaced name consists of two DNS-like IDs separated by a slash
  3. Rules and profiles which were created from a bundle have a foreign key reference back to the subscription they were created from.
  4. It is not possible to create a rule/profile with a namespaced name through the API.
  5. It is not possible to update or delete a profile/rule with a reference to a subscription through the API.

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@dmjb dmjb force-pushed the bundle-namespace-intf branch 2 times, most recently from 3e92c91 to 39104c4 Compare March 15, 2024 18:20
@dmjb dmjb changed the title Bundle namespace intf Add bundle methods to profiles and rule types Mar 15, 2024
@dmjb dmjb force-pushed the bundle-namespace-intf branch from 002963a to 4342ae8 Compare March 19, 2024 11:25
@dmjb dmjb marked this pull request as ready for review March 19, 2024 11:26
@dmjb dmjb requested a review from a team as a code owner March 19, 2024 11:26
@dmjb dmjb force-pushed the bundle-namespace-intf branch from fb47f3f to b36c067 Compare March 19, 2024 11:30
@coveralls
Copy link

coveralls commented Mar 19, 2024

Coverage Status

coverage: 46.534% (+0.08%) from 46.455%
when pulling ad1338f on bundle-namespace-intf
into 7b9a05a on main.

@dmjb dmjb changed the title Add bundle methods to profiles and rule types Prevent modification/deletion of rules belonging to a subscription Mar 19, 2024
Relates to #2543

These methods ensure that it's not possible to create/update/delete
profiles or rule types through the API. Dedicated methods are supplied
for creating these entities with a subscription ID. These methods will
be called by the bundle management code.

Patch and delete methods which have not yet been migrated to the
respective service interfaces have been modified to prevent modification
of bundle rule types/profiles.
@dmjb dmjb force-pushed the bundle-namespace-intf branch from b36c067 to ad1338f Compare March 19, 2024 11:46
@dmjb dmjb merged commit f1a4d07 into main Mar 19, 2024
24 checks passed
@dmjb dmjb deleted the bundle-namespace-intf branch March 19, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants