-
Notifications
You must be signed in to change notification settings - Fork 19
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(lightspeed): add permission support in lightspeed plugins #66
feat(lightspeed): add permission support in lightspeed plugins #66
Conversation
642b312
to
2159a29
Compare
workspaces/lightspeed/plugins/lightspeed-backend/src/service/permission.test.ts
Show resolved
Hide resolved
workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedPage.tsx
Outdated
Show resolved
Hide resolved
I have tried with the following rbac policy, basically removed the
I can chat with the lightspeed bot with no issue as expected, since I have read & create permission. However, I can also delete the conversation session. Please confirm if this is a bug, or I set it up wrong UPDATE: do I need to set up anything in my frontend/backend other than app-catalog? |
@yangcao77 seems like your setup is incorrect. Here are some troubleshooting steps:
|
Pulled the changes locally and tested. Everything works as expected and looks good to me. |
3b33f63
to
5d12f0c
Compare
@karthikjeeyar thanks for the instruction. confirmed I'm able to verify the rbac permissions. |
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.
looks good to me from backend perspective.
also, do we need a changeset for this PR?
17e2224
to
b41f76a
Compare
added changeset, and release both frontend and backend as 0.2.0. Edit: I made it public now, so it will auto publish to npm. |
788d347
to
61b38d5
Compare
Changed Packages
|
61b38d5
to
74bac50
Compare
Changed Packages
|
IIRC, in janus-idp repo, it requires version > 1.0 to be auto publish to npm. I'm not sure if rhdh-plugins is still the case. |
@yangcao77 That was a limitation of semantic release. I think changesets do support releasing non v1 versions of pckages. |
Changed Packages
|
Signed-off-by: Karthik <[email protected]>
Signed-off-by: Karthik <[email protected]>
Signed-off-by: Karthik <[email protected]>
Signed-off-by: Karthik <[email protected]>
Signed-off-by: Karthik <[email protected]>
9ea750c
to
957d508
Compare
957d508
to
1774b28
Compare
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.
/lgtm
/approve
Tickets:
https://issues.redhat.com/browse/RHDHPAI-33
https://issues.redhat.com/browse/RHDHPAI-34
https://issues.redhat.com/browse/RHDHPAI-35
Lightspeed Permission support
Add permission support for lightspeed plugins.
This PR adds three basic permissions
lightspeed.conversations.read
,lightspeed.conversations.create
andlightspeed.conversations.delete
. These permission are used to secure the UI and API endpoints.Note:
To access lightspeed UI, then logged in user should be granted with below permissions.
lightspeed.conversations.read
lightspeed.conversations.create
API endpoints:
lightspeed.conversations.read
- allGET
requests are gated by this permissionlightspeed.conversations.create
- allPOST
requests are gated by this permissionlightspeed.conversations.delete
- allDELETE
requests are gated by this permissionHow to test this changes?
Install and configure rbac-backend (Prerequiste)
create a
rbac-policy.csv
file with below permission policies.enable rbac and wire the policy file in the
app-config.yam
l fileallow
todeny
to see the permission required alert or Unauthorized error while accessing endpoints.Screenshots
If one of the permissions (
lightspeed.conversations.read
orlightspeed.conversations.create
) is denied for a user, then UI will show the missing permissions error state.Delete button is disabled when
lightspeed.conversations.delete
is denied.API endpoints
Unit test
✔️ Checklist