You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This task is the second iteration of issue #212 to integrate a database back-up (for keeping the updated scopes) with the first iteration. In the first Iteration of that task we have been able to update the scope of all the registered routes on the UI by updating a permission config file from which the scope of the routes are being read when we are defining them.
Other than serving as a backup storage for routes scopes, another reason for storing the updated scopes in the table is to be able to handle and address a corner case where the developer is updating the scope on the the UI but has forgotten to assign the scope of the routes from permission config file and has some hard coded values for the scope in the route definition, in this case updating the scopes on UI and even updating the config file wouldn't update the actual scope of the routes and won't have any effects.
Context
Before starting the implementation of the second iteration, it might be helpful to think about 2 questions leading to a couple of corner cases:
1- What happens if the developer forgets to assign the scope of routes from the permission config file?
2- What happens if on updating the UI, updating the permission config file fails but updating the corresponding document in database succeeds and vice versa?
Steps
Create a data base model named as RouteScope with a schema of {id:objectId, method:string, path:string, scopes:array, date:Date()}
In the route that you have created for in your first iteration where you are updating the config file, update the RouteScope table with the corresponding changes.
first you have to look up the table by method and path of routes to see if it already exists in the
table, if so you should update the already existing document by calling the right mongo method.
if it doesn't exist you should create a new document in the collection by calling insert method.
To handle the corner case mentioned above, in the web route that's replying with the html page (for updating scope created in first iteration), for every documents in RouteScope collection you have to compare the scope with the scope of corresponding route in routing table (server.table()), if the scope arrays are not identical it means that the developer has forgotten to assign the route scope from the config file in the definition so updating the scope on the UI won't have any effects.
you need to pass these set of routes (which have different scopes in the data base collection and routing table of the server) to the UI template.
On the UI template create a separate section for displaying the set of routes described in number 3 above. (you can show them in a table format).
The text was updated successfully, but these errors were encountered:
Description
This task is the second iteration of issue #212 to integrate a database back-up (for keeping the updated scopes) with the first iteration. In the first Iteration of that task we have been able to update the scope of all the registered routes on the UI by updating a permission config file from which the scope of the routes are being read when we are defining them.
Other than serving as a backup storage for routes scopes, another reason for storing the updated scopes in the table is to be able to handle and address a corner case where the developer is updating the scope on the the UI but has forgotten to assign the scope of the routes from permission config file and has some hard coded values for the scope in the route definition, in this case updating the scopes on UI and even updating the config file wouldn't update the actual scope of the routes and won't have any effects.
Context
Before starting the implementation of the second iteration, it might be helpful to think about 2 questions leading to a couple of corner cases:
1- What happens if the developer forgets to assign the scope of routes from the permission config file?
2- What happens if on updating the UI, updating the permission config file fails but updating the corresponding document in database succeeds and vice versa?
Steps
Create a data base model named as
RouteScope
with a schema of {id:objectId, method:string, path:string, scopes:array, date:Date()}In the route that you have created for in your first iteration where you are updating the config file, update the RouteScope table with the corresponding changes.
table, if so you should update the already existing document by calling the right mongo method.
To handle the corner case mentioned above, in the web route that's replying with the html page (for updating scope created in first iteration), for every documents in
RouteScope
collection you have to compare the scope with the scope of corresponding route in routing table (server.table()), if the scope arrays are not identical it means that the developer has forgotten to assign the route scope from the config file in the definition so updating the scope on the UI won't have any effects.you need to pass these set of routes (which have different scopes in the data base collection and routing table of the server) to the UI template.
On the UI template create a separate section for displaying the set of routes described in number 3 above. (you can show them in a table format).
The text was updated successfully, but these errors were encountered: