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

FOGL-6613: Fledge GUI: Add support for ACL configuration item type #194

Merged
merged 5 commits into from
Aug 3, 2022

Conversation

mshariq-nerd
Copy link
Member

@mshariq-nerd mshariq-nerd commented Aug 1, 2022

Test against fledge-iot/fledge#738

Signed-off-by: Mohd. Shariq <mohd.shariq@nerdapplabs.com>
Signed-off-by: Mohd. Shariq <mohd.shariq@nerdapplabs.com>
Signed-off-by: Mohd. Shariq <mohd.shariq@nerdapplabs.com>
@praveen-garg praveen-garg changed the title FOGL-6613: Fledge GUI: Add support for ACL configuration category type FOGL-6613: Fledge GUI: Add support for ACL configuration item type Aug 1, 2022
Signed-off-by: Mohd. Shariq <mohd.shariq@nerdapplabs.com>
@pintomax
Copy link

pintomax commented Aug 2, 2022

@mshariq-nerd @praveen-garg As per specs in "Control Dispatcher Service" document

we need to call

ATTACH

PUT /fledge/service/$serviceName/ACL -d '{"acl_name" : "ACL1"}'

DETACH

DELETE 127.0.0.1:8081/fledge/service/$serviceName/ACL

The GUI calls instead, ACL item update for /fledge/$serviceNameSecurity
example
PUT http://192.168.56.10:8081/fledge/category/SIN2Security -d '{"ACL":"ACL1"}'

c/c @MarkRiddoch

deepanshu-yadav
deepanshu-yadav previously approved these changes Aug 2, 2022
@mshariq-nerd
Copy link
Member Author

@MarkRiddoch Current implementation is as per the JIRA requirement. We are getting ACL as a config item in the security category of the service. In GUI I have added a new configuration type ACL, that is rendered on the configuration page dynamically with other configuration item if any. When we change the config value, updating that using the API endpoint PUT fledge/category/Security, that is true for any configuration item to update its value.

Now, If we want to use API of attach/detach ACL with service we have to take it out from the configuration category and put it as a separate item of the service because in the current GUI design calling different api on the category configuration item update, we need to identify the ACL item in the config and separate it out then update it and resync the updated config.

Please advise.

@MarkRiddoch
Copy link
Contributor

Now, If we want to use API of attach/detach ACL with service we have to take it out from the configuration category and put it as a separate item of the service because in the current GUI design calling different api on the category configuration item update, we need to identify the ACL item in the config and separate it out then update it and resync the updated config.

Please advise.

You don't need to take it out. You can very easily identify the ACL's, that is why they are a different type. We will use the ACL mechanism in other places than a configuration category, we must make sure we deal with ACL's in a consistent way, hence the attach and detach calls that need to be made in addition to the update of the configuration category. If you are telling me the GUI code is not up to the job of making two API calls then we will have to move the intelligence into the API rather than have the GUI do it.

@mshariq-nerd
Copy link
Member Author

@MarkRiddoch I think Deepanshu doing the stuff that when config item is changed then notify to service? And we are getting ACL type in Security child category for this purpose?
if we need to make two calls based on ACL, I can chain that. let me know. Security category config item update call will be there anyway?

This is how we are doing it in GUI right now.
https://user-images.githubusercontent.com/16384273/182409925-072bbcc8-bcf4-42c8-9093-3dad34765cde.mov

@pintomax
Copy link

pintomax commented Aug 2, 2022

@mshariq-nerd when we select an ACL in the GUI, say ACL1 then
the GUI should do:

ATTACH

PUT /fledge/service/$serviceName/ACL -d '{"acl_name" : "ACL1"}'

Wen we select "none"

DETACH

DELETE 127.0.0.1:8081/fledge/service/$serviceName/ACL

Those are the only two APIs for adding/removing an ACL to a service

If an ACL is already set, we can only remove it.

Then a new one should be attached

@mshariq-nerd mshariq-nerd marked this pull request as ready for review August 3, 2022 09:31
Signed-off-by: Mohd. Shariq <mohd.shariq@nerdapplabs.com>
@praveen-garg
Copy link
Member

This looks good to move forward.

@mshariq-nerd
Copy link
Member Author

As this base work is required and we are able to display and save ACL type config item; I’m merging this.
@MarkRiddoch, please add a Jira for any change/extension required to this, with a clarification note to my earlier comment for my overall understanding.

@mshariq-nerd mshariq-nerd merged commit 78d8ae8 into develop Aug 3, 2022
@mshariq-nerd mshariq-nerd deleted the FOGL-6613 branch August 3, 2022 12:02
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.

5 participants