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
Copy file name to clipboardExpand all lines: templates/ords-remix-jwt-sample/ords/modules/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ Here is a Diagram of how we will be structuring the API.
102
102
103
103
Before we start modeling our endpoints we first need to understand who is going to use our API endpoints so we can take advantage of the ORDS Module feature to aggregate our API endpoints. For the sample app we have three possible users:
104
104
105
-
-**End User**: An End User should have limited access to our API endpoints and by limited access we mean READ ONLY access.
105
+
-**End User**: An End User should have limited access to our API endpoints and by limited access we mean READ ONLY access. End users can only access publicly available resources within the application. This means that all endpoints within the `euser` (the end user) pattern are public and don't need authentication to be accessed.
106
106
-**Authenticated User**: An Authenticated User should have access to all of the End User Endpoints plus endpoints that allow the user to interact with the ORDS Concert App (like subscribing to an artist a venue a concert, etc). So an Authenticated User should be able to modify resources in the Database.
107
107
-**Admin User**: An Admin User should have full access to API endpoints that allows an Application Administrator to fully mange the Application (like performing CRUD operations over Artists, Venues, Events and more).
Copy file name to clipboardExpand all lines: templates/ords-remix-jwt-sample/ords/security/README.MD
+2-20Lines changed: 2 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ The key part here is the Module Pattern and how it can be used to define an ORDS
34
34
35
35
ORDS allows us to define [Privileges](https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/24.2/orddg/oracle-rest-data-services-administration-pl-sql-package-reference.html#GUID-460E2355-A25A-4BE8-BF1F-3221A91147F7). Privileges are used to control access to specific endpoints. A privilege pattern allows us to define which users or roles can access certain URLs, ensuring that only authorized users can perform specific actions on the ORDS Concert App API Endpoints.
36
36
37
-
Now, we need to define three privileges, one for each kind of user the ORDS Sample App has:
37
+
Now, we need to define two privileges, one for each kind of user the ORDS Sample App has:
38
38
39
39
```sql
40
40
DECLARE
@@ -72,25 +72,11 @@ Now, we need to define three privileges, one for each kind of user the ORDS Samp
72
72
l_modules.DELETE;
73
73
l_patterns.DELETE;
74
74
75
-
l_modules(1) :='concert_app.euser.v1';
76
-
77
-
ORDS.DEFINE_PRIVILEGE(
78
-
p_privilege_name =>'concert_app_euser',
79
-
p_roles => l_roles,
80
-
p_patterns => l_patterns,
81
-
p_modules => l_modules,
82
-
p_label =>'Non authenticated end user privilege',
83
-
p_description =>'Provides limited access to the concert app endpoints',
84
-
p_comments =>NULL);
85
-
86
-
l_roles.DELETE;
87
-
l_modules.DELETE;
88
-
l_patterns.DELETE;
89
75
COMMIT;
90
76
END;
91
77
```
92
78
93
-
Note that by defining a the `/euser/*`, `/adminuser/*``/authuser/*` we are protecting every single one of the handlers that belong to that Module, even modules that are part of specific versions of out API. This is because those patterns will always match the beginning of the API endpoint which coincides with the Module Section of the API Endpoint.
79
+
Note that by defining a the `/adminuser/*``/authuser/*` we are protecting every single one of the handlers that belong to that Module, even modules that are part of specific versions of out API. This is because those patterns will always match the beginning of the API endpoint which coincides with the Module Section of the API Endpoint.
94
80
95
81
At this stage, our API Endpoints are secured and this is great, however, now we need a way to grant users access to such resources and for that we will need to define an application capable of issuing JWT Tokens and tell ORDS to consume and validate tokens coming from that application.
96
82
@@ -154,11 +140,7 @@ Now that we have created our API, go to the `Permissions` tab and grant it the f
154
140
| ---------- | ----------- | ----------- |
155
141
|read:general_user_content| Read all of the general user endpoints | Allows the Sample App to read user information like first name, last name, email and Auth0 ID |
156
142
| concert_app_authuser | Provides access to the user specific endpoints | Allows authenticated users to interact with user specific ORDS Endpoints, like subscribing to a concert and more. |
157
-
| concert_app_euser | Provides limited access to the concert app endpoints | Allows unauthenticated users to interact with limited ORDS Endpoints. |
158
143
| concert_app_admin | Provides access to the concert app admin endpoints | Allows authenticated admin users to interact with user specific ORDS Endpoints, like the create or delete Artist Endpoints. |
159
-
| oracle.dbtools.autorest.privilege.`<SCHEMA_NAME>`.SEARCH_VIEW | Provides access to the AutoREST search view. | Allows every user of the ORDS Concert App to access the search/discover functionality. |
160
-
oracle.dbtools.autorest.privilege.`<SCHEMA_NAME>`.SEARCH_ARTIST_VIEW | Provides access to the AutoREST artists search view. | Allows every user of the ORDS Concert App to access the search/discover functionality. |
161
-
| oracle.dbtools.autorest.privilege.`<SCHEMA_NAME>`.SEARCH_VENUES_VIEW | Provides access to the AutoREST venues search view. | Allows every user of the ORDS Concert App to access the search/discover functionality. |
162
144
163
145
Once you have added all of the permissions described above your list of permissions should look like this.
0 commit comments