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

fix(rbac): simplify db logic #1842

Merged
merged 21 commits into from
Jul 17, 2024

Conversation

AndrienkoAleksandr
Copy link
Collaborator

What does this pull request do:

Drop policy source.

What does this pull request fix:

https://issues.redhat.com/browse/RHIDP-1528

Copy link
Member

@PatAKnight PatAKnight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far, I have testing this with making changes with the UI and CSV file and can confirm

From UI -> unable to create / edit / delete policies and roles that originate from config file and csv file

From CSV -> unable to create / edit / delete policies and roles that originate from rest api and config file

Still need to finish testing legacy policies and roles and when using rest api. But wanted to at least start a review.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Copy link
Member

@PatAKnight PatAKnight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through and tested some of the legacy options:

Legacy updates to config if there is a match
Legacy updates to CSV if there is a match on start up
Legacy updates to REST if there is a match during PUT request

The only thing that does not happen is if I add a role to the CSV file that matches a legacy role in the database. In this scenario, the source stays as legacy.

Also, yarn tsc is failing because CSV_PERMISSION_FILE_AUTHOR is declared in the csv-file-watcher.test.ts but never used.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
@AndrienkoAleksandr
Copy link
Collaborator Author

The only thing that does not happen is if I add a role to the CSV file that matches a legacy role in the database. In this scenario, the source stays as legacy.
Also, yarn tsc is failing because CSV_PERMISSION_FILE_AUTHOR is declared in the csv-file-watcher.test.ts but never used.

Fixed.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Copy link
Member

@PatAKnight PatAKnight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

Copy link

openshift-ci bot commented Jul 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: PatAKnight

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit cbe263b into janus-idp:main Jul 17, 2024
11 checks passed
janus-idp bot pushed a commit that referenced this pull request Jul 17, 2024
janus-idp bot pushed a commit that referenced this pull request Jul 17, 2024
## [1.8.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-quay@1.8.1...@janus-idp/backstage-plugin-quay@1.8.2) (2024-07-17)

### Features

* **bulk-import:** add repo row actions ([#1572](#1572)) ([66051e3](66051e3))
* **bulk-import:** preview catalog-info.yaml on a side-panel ([#1541](#1541)) ([9c87dad](9c87dad))
* **bulk-import:** update bulk import icon ([#1826](#1826)) ([32c5553](32c5553))
* **keycloak:** expose keycloak user/group transformer extension point ([#1825](#1825)) ([3f85578](3f85578))
* **kiali:** add banner to warn for tech preview windows ([#1829](#1829)) ([b0cb796](b0cb796))
* **kiali:** add tests for the overview page ([#1790](#1790)) ([582cf36](582cf36))
* **kiali:** changes to Kiali 1.86 ([#1839](#1839)) ([ab1f6bc](ab1f6bc))
* **kiali:** improve styles ([#1861](#1861)) ([158800f](158800f))
* **kiali:** include Kiali external URL as a parameter ([#1835](#1835)) ([6dbe9eb](6dbe9eb))
* **kiali:** resources card test coverage ([#1821](#1821)) ([4090fc2](4090fc2))
* **kiali:** revert changes to Kiali 1.86 ([#1839](#1839)) ([#1876](#1876)) ([c512b29](c512b29))
* **kiali:** sticky headers for tables ([#1877](#1877)) ([64578d9](64578d9))
* **orchestrator:** add auditLog and reorganize endpoints declaration ([#1820](#1820)) ([00d9216](00d9216))
* **orchestrator:** change openapi client generator ([#1864](#1864)) ([d6a4f4c](d6a4f4c))
* **orchestrator:** disable buttons based on permissions ([#1818](#1818)) ([36504b0](36504b0))
* **orchestrator:** fix build failure from [#1833](#1833) ([#1850](#1850)) ([c0c73e6](c0c73e6))
* **orchestrator:** fix version ([#1886](#1886)) ([65c5917](65c5917))
* **orchestrator:** remove unneeded orchestrator jira integration and endpoint ([#1833](#1833)) ([d2a76fd](d2a76fd))
* **rbac:** show rules count in overview page ([#1845](#1845)) ([a10dc36](a10dc36))
* **rbac:** show total no. of rules in review and create step ([#1827](#1827)) ([e54c470](e54c470))

### Bug Fixes

* **argocd:** fix argocd commit message visibility ([#1874](#1874)) ([e558d75](e558d75))
* **argocd:** hide commit section for helm based applications ([#1834](#1834)) ([a86ce1e](a86ce1e))
* **feedback:** fixed feedback creation ([#1863](#1863)) ([eb2f3ac](eb2f3ac))
* **kiali:** add bearer token ([#1870](#1870)) ([8875276](8875276))
* **kiali:** allow unauthenticated kiali due is read-only mod ([#1872](#1872)) ([1990d97](1990d97))
* **orchestrator:** returned scrolling bars to instance page cards ([#1880](#1880)) ([08545da](08545da))
* **quay:** add mock data to quay dev mode tests ([#1860](#1860)) ([cbfcc49](cbfcc49))
* **rbac:** background color of sidebar in dark theme ([#1859](#1859)) ([ec6a2d8](ec6a2d8))
* **rbac:** casbinDBAdapterFactory supporting postgres schema configuration ([#1841](#1841)) ([c0e63f9](c0e63f9))
* **rbac:** catch errors whenever a plugin token is not generated ([#1866](#1866)) ([c9abf44](c9abf44))
* **rbac:** correct plugin ID matching to permission policy ([#1795](#1795)) ([6dc4b1c](6dc4b1c))
* **rbac:** edit role page loads error page ([#1849](#1849)) ([6782b4b](6782b4b))
* **rbac:** simplify db logic ([#1842](#1842)) ([cbe263b](cbe263b))
* **rbac:** update rbac common to fix compilation ([#1858](#1858)) ([48f142b](48f142b))

### Documentation

* **keycloak-backend:** update keycloak documentation ([#1832](#1832)) ([e7c59f5](e7c59f5))

### Other changes

* **rbac:** reduce cognitive stress for create, update and delete role functions ([#1878](#1878)) ([38c3144](38c3144))
janus-idp bot pushed a commit that referenced this pull request Jul 17, 2024
## [1.12.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/cli@1.11.1...@janus-idp/cli@1.12.0) (2024-07-17)

### Features

* **bulk-import:** add repo row actions ([#1572](#1572)) ([66051e3](66051e3))
* **bulk-import:** preview catalog-info.yaml on a side-panel ([#1541](#1541)) ([9c87dad](9c87dad))
* **bulk-import:** update bulk import icon ([#1826](#1826)) ([32c5553](32c5553))
* **deps:** update to backstage 1.28 ([#1891](#1891)) ([1ba1108](1ba1108))
* **keycloak:** expose keycloak user/group transformer extension point ([#1825](#1825)) ([3f85578](3f85578))
* **kiali:** add banner to warn for tech preview windows ([#1829](#1829)) ([b0cb796](b0cb796))
* **kiali:** add tests for the overview page ([#1790](#1790)) ([582cf36](582cf36))
* **kiali:** changes to Kiali 1.86 ([#1839](#1839)) ([ab1f6bc](ab1f6bc))
* **kiali:** improve styles ([#1861](#1861)) ([158800f](158800f))
* **kiali:** include Kiali external URL as a parameter ([#1835](#1835)) ([6dbe9eb](6dbe9eb))
* **kiali:** resources card test coverage ([#1821](#1821)) ([4090fc2](4090fc2))
* **kiali:** revert changes to Kiali 1.86 ([#1839](#1839)) ([#1876](#1876)) ([c512b29](c512b29))
* **kiali:** sticky headers for tables ([#1877](#1877)) ([64578d9](64578d9))
* **orchestrator:** add auditLog and reorganize endpoints declaration ([#1820](#1820)) ([00d9216](00d9216))
* **orchestrator:** change openapi client generator ([#1864](#1864)) ([d6a4f4c](d6a4f4c))
* **orchestrator:** disable buttons based on permissions ([#1818](#1818)) ([36504b0](36504b0))
* **orchestrator:** fix build failure from [#1833](#1833) ([#1850](#1850)) ([c0c73e6](c0c73e6))
* **orchestrator:** fix version ([#1886](#1886)) ([65c5917](65c5917))
* **orchestrator:** remove unneeded orchestrator jira integration and endpoint ([#1833](#1833)) ([d2a76fd](d2a76fd))
* **rbac:** show rules count in overview page ([#1845](#1845)) ([a10dc36](a10dc36))
* **rbac:** show total no. of rules in review and create step ([#1827](#1827)) ([e54c470](e54c470))

### Bug Fixes

* **argocd:** fix argocd commit message visibility ([#1874](#1874)) ([e558d75](e558d75))
* **argocd:** hide commit section for helm based applications ([#1834](#1834)) ([a86ce1e](a86ce1e))
* **feedback:** fixed feedback creation ([#1863](#1863)) ([eb2f3ac](eb2f3ac))
* **kiali:** add bearer token ([#1870](#1870)) ([8875276](8875276))
* **kiali:** allow unauthenticated kiali due is read-only mod ([#1872](#1872)) ([1990d97](1990d97))
* **orchestrator:** returned scrolling bars to instance page cards ([#1880](#1880)) ([08545da](08545da))
* **quay:** add mock data to quay dev mode tests ([#1860](#1860)) ([cbfcc49](cbfcc49))
* **rbac:** background color of sidebar in dark theme ([#1859](#1859)) ([ec6a2d8](ec6a2d8))
* **rbac:** casbinDBAdapterFactory supporting postgres schema configuration ([#1841](#1841)) ([c0e63f9](c0e63f9))
* **rbac:** catch errors whenever a plugin token is not generated ([#1866](#1866)) ([c9abf44](c9abf44))
* **rbac:** correct plugin ID matching to permission policy ([#1795](#1795)) ([6dc4b1c](6dc4b1c))
* **rbac:** edit role page loads error page ([#1849](#1849)) ([6782b4b](6782b4b))
* **rbac:** simplify db logic ([#1842](#1842)) ([cbe263b](cbe263b))
* **rbac:** update rbac common to fix compilation ([#1858](#1858)) ([48f142b](48f142b))

### Documentation

* **keycloak-backend:** update keycloak documentation ([#1832](#1832)) ([e7c59f5](e7c59f5))

### Other changes

* **rbac:** reduce cognitive stress for create, update and delete role functions ([#1878](#1878)) ([38c3144](38c3144))
janus-idp bot pushed a commit that referenced this pull request Jul 17, 2024
## [1.7.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-3scale-backend@1.6.1...@janus-idp/backstage-plugin-3scale-backend@1.7.0) (2024-07-17)

### Features

* **bulk-import:** add repo row actions ([#1572](#1572)) ([66051e3](66051e3))
* **bulk-import:** preview catalog-info.yaml on a side-panel ([#1541](#1541)) ([9c87dad](9c87dad))
* **bulk-import:** update bulk import icon ([#1826](#1826)) ([32c5553](32c5553))
* **deps:** update to backstage 1.28 ([#1891](#1891)) ([1ba1108](1ba1108))
* **keycloak:** expose keycloak user/group transformer extension point ([#1825](#1825)) ([3f85578](3f85578))
* **kiali:** add banner to warn for tech preview windows ([#1829](#1829)) ([b0cb796](b0cb796))
* **kiali:** add tests for the overview page ([#1790](#1790)) ([582cf36](582cf36))
* **kiali:** changes to Kiali 1.86 ([#1839](#1839)) ([ab1f6bc](ab1f6bc))
* **kiali:** improve styles ([#1861](#1861)) ([158800f](158800f))
* **kiali:** include Kiali external URL as a parameter ([#1835](#1835)) ([6dbe9eb](6dbe9eb))
* **kiali:** resources card test coverage ([#1821](#1821)) ([4090fc2](4090fc2))
* **kiali:** revert changes to Kiali 1.86 ([#1839](#1839)) ([#1876](#1876)) ([c512b29](c512b29))
* **kiali:** sticky headers for tables ([#1877](#1877)) ([64578d9](64578d9))
* **orchestrator:** add auditLog and reorganize endpoints declaration ([#1820](#1820)) ([00d9216](00d9216))
* **orchestrator:** change openapi client generator ([#1864](#1864)) ([d6a4f4c](d6a4f4c))
* **orchestrator:** disable buttons based on permissions ([#1818](#1818)) ([36504b0](36504b0))
* **orchestrator:** fix build failure from [#1833](#1833) ([#1850](#1850)) ([c0c73e6](c0c73e6))
* **orchestrator:** fix version ([#1886](#1886)) ([65c5917](65c5917))
* **orchestrator:** remove unneeded orchestrator jira integration and endpoint ([#1833](#1833)) ([d2a76fd](d2a76fd))
* **rbac:** show rules count in overview page ([#1845](#1845)) ([a10dc36](a10dc36))
* **rbac:** show total no. of rules in review and create step ([#1827](#1827)) ([e54c470](e54c470))

### Bug Fixes

* **argocd:** fix argocd commit message visibility ([#1874](#1874)) ([e558d75](e558d75))
* **argocd:** hide commit section for helm based applications ([#1834](#1834)) ([a86ce1e](a86ce1e))
* **feedback:** fixed feedback creation ([#1863](#1863)) ([eb2f3ac](eb2f3ac))
* **kiali:** add bearer token ([#1870](#1870)) ([8875276](8875276))
* **kiali:** allow unauthenticated kiali due is read-only mod ([#1872](#1872)) ([1990d97](1990d97))
* **orchestrator:** returned scrolling bars to instance page cards ([#1880](#1880)) ([08545da](08545da))
* **quay:** add mock data to quay dev mode tests ([#1860](#1860)) ([cbfcc49](cbfcc49))
* **rbac:** background color of sidebar in dark theme ([#1859](#1859)) ([ec6a2d8](ec6a2d8))
* **rbac:** casbinDBAdapterFactory supporting postgres schema configuration ([#1841](#1841)) ([c0e63f9](c0e63f9))
* **rbac:** catch errors whenever a plugin token is not generated ([#1866](#1866)) ([c9abf44](c9abf44))
* **rbac:** correct plugin ID matching to permission policy ([#1795](#1795)) ([6dc4b1c](6dc4b1c))
* **rbac:** edit role page loads error page ([#1849](#1849)) ([6782b4b](6782b4b))
* **rbac:** simplify db logic ([#1842](#1842)) ([cbe263b](cbe263b))
* **rbac:** update rbac common to fix compilation ([#1858](#1858)) ([48f142b](48f142b))

### Documentation

* **keycloak-backend:** update keycloak documentation ([#1832](#1832)) ([e7c59f5](e7c59f5))

### Other changes

* **rbac:** reduce cognitive stress for create, update and delete role functions ([#1878](#1878)) ([38c3144](38c3144))
janus-idp bot pushed a commit that referenced this pull request Jul 18, 2024
## [1.8.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-aap-backend@1.7.1...@janus-idp/backstage-plugin-aap-backend@1.8.0) (2024-07-18)

### Features

* **bulk-import:** add repo row actions ([#1572](#1572)) ([66051e3](66051e3))
* **bulk-import:** preview catalog-info.yaml on a side-panel ([#1541](#1541)) ([9c87dad](9c87dad))
* **bulk-import:** update bulk import icon ([#1826](#1826)) ([32c5553](32c5553))
* **deps:** update to backstage 1.28 ([#1891](#1891)) ([1ba1108](1ba1108))
* **keycloak:** expose keycloak user/group transformer extension point ([#1825](#1825)) ([3f85578](3f85578))
* **kiali:** add banner to warn for tech preview windows ([#1829](#1829)) ([b0cb796](b0cb796))
* **kiali:** add tests for the overview page ([#1790](#1790)) ([582cf36](582cf36))
* **kiali:** changes to Kiali 1.86 ([#1839](#1839)) ([ab1f6bc](ab1f6bc))
* **kiali:** improve styles ([#1861](#1861)) ([158800f](158800f))
* **kiali:** include Kiali external URL as a parameter ([#1835](#1835)) ([6dbe9eb](6dbe9eb))
* **kiali:** resources card test coverage ([#1821](#1821)) ([4090fc2](4090fc2))
* **kiali:** revert changes to Kiali 1.86 ([#1839](#1839)) ([#1876](#1876)) ([c512b29](c512b29))
* **kiali:** sticky headers for tables ([#1877](#1877)) ([64578d9](64578d9))
* **orchestrator:** add auditLog and reorganize endpoints declaration ([#1820](#1820)) ([00d9216](00d9216))
* **orchestrator:** change openapi client generator ([#1864](#1864)) ([d6a4f4c](d6a4f4c))
* **orchestrator:** disable buttons based on permissions ([#1818](#1818)) ([36504b0](36504b0))
* **orchestrator:** fix build failure from [#1833](#1833) ([#1850](#1850)) ([c0c73e6](c0c73e6))
* **orchestrator:** fix version ([#1886](#1886)) ([65c5917](65c5917))
* **orchestrator:** remove unneeded orchestrator jira integration and endpoint ([#1833](#1833)) ([d2a76fd](d2a76fd))
* **rbac:** show rules count in overview page ([#1845](#1845)) ([a10dc36](a10dc36))
* **rbac:** show total no. of rules in review and create step ([#1827](#1827)) ([e54c470](e54c470))

### Bug Fixes

* **argocd:** fix argocd commit message visibility ([#1874](#1874)) ([e558d75](e558d75))
* **argocd:** hide commit section for helm based applications ([#1834](#1834)) ([a86ce1e](a86ce1e))
* **feedback:** fixed feedback creation ([#1863](#1863)) ([eb2f3ac](eb2f3ac))
* **kiali:** add bearer token ([#1870](#1870)) ([8875276](8875276))
* **kiali:** allow unauthenticated kiali due is read-only mod ([#1872](#1872)) ([1990d97](1990d97))
* **orchestrator:** resolve broken dynamic plugin publish ([#1906](#1906)) ([5f99043](5f99043))
* **orchestrator:** returned scrolling bars to instance page cards ([#1880](#1880)) ([08545da](08545da))
* **quay:** add mock data to quay dev mode tests ([#1860](#1860)) ([cbfcc49](cbfcc49))
* **rbac:** background color of sidebar in dark theme ([#1859](#1859)) ([ec6a2d8](ec6a2d8))
* **rbac:** casbinDBAdapterFactory supporting postgres schema configuration ([#1841](#1841)) ([c0e63f9](c0e63f9))
* **rbac:** catch errors whenever a plugin token is not generated ([#1866](#1866)) ([c9abf44](c9abf44))
* **rbac:** correct plugin ID matching to permission policy ([#1795](#1795)) ([6dc4b1c](6dc4b1c))
* **rbac:** edit role page loads error page ([#1849](#1849)) ([6782b4b](6782b4b))
* **rbac:** simplify db logic ([#1842](#1842)) ([cbe263b](cbe263b))
* **rbac:** update rbac common to fix compilation ([#1858](#1858)) ([48f142b](48f142b))

### Documentation

* **keycloak-backend:** update keycloak documentation ([#1832](#1832)) ([e7c59f5](e7c59f5))

### Other changes

* **rbac:** reduce cognitive stress for create, update and delete role functions ([#1878](#1878)) ([38c3144](38c3144))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants