This repository was archived by the owner on Oct 11, 2024. It is now read-only.
[TT-5089] Add new field in security policy status#547
Merged
Conversation
buraksekili
reviewed
Dec 16, 2022
buraksekili
reviewed
Dec 16, 2022
buraksekili
reviewed
Dec 19, 2022
buraksekili
reviewed
Dec 19, 2022
buraksekili
reviewed
Dec 19, 2022
buraksekili
approved these changes
Dec 20, 2022
|
Kudos, SonarCloud Quality Gate passed! |
buger
pushed a commit
that referenced
this pull request
May 22, 2024
* Add a `linkedAPIs` field in status of security policy * Store list of linked APIs in the status of policy * Set back MID * Remove tests for updateStatusOfLinkedApis * Add tests for security policy * Remove redundant checks * Fix lint issues * Fix tests * Fix lint issues * Change arguement sequence * Do not run security policy tests for ce mode * Increase timeout period * Fix tests * Fix lint issues * Fix client mtls test * Update changelog * Make an entry of the bug in the changelog * Update log messages * Rename var * Fix lint issue * Fix tests * Update policy MID
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.








Description
APIs store link to security policies in their status field. It is used to prevent deletion of API if it is linked to policy.
When we remove an API from access rights of policy, link stored in API is not deleted. This happens because there is no way for the security policy controller to know which API was removed. It knows only about the current state.
To fix this issue, I have added
LinkedAPIsfield in the status of the policy. As the name says, it stores list of APIs it is linked to.Now, security policy controller has information about the APIs that were linked before.
Related Issue
TT-5089
Fixes #431
Motivation and Context
We should be able to delete API which is not linked to the policy.
Test Coverage For This Change
Added integration and unit tests
Screenshots (if appropriate)
Types of changes
Checklist
master!masterbranch (left side). Also, it would be best if you started your change off our latestmaster.make manifestsmake helmgofmt -s -w .go vet ./...golangci-lint run