Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit 09cf9b9

Browse files
committed
Security updates
1 parent 5c095a7 commit 09cf9b9

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@ A CWWKT0016I: Web application available (default_host): http://mvs.example.ibm.c
5656
A CWWKT0016I: Web application available (default_host): http://mvs.example.ibm.com:9080/stock/
5757
```
5858

59-
If you use CICS bundle deployment, you will also need to define a RACF profile for users to access the stock REST API.
59+
If you use CICS bundle deployment, you will also need to define a RACF profile for users to access the stock REST API, where WEBUSER is the authenticated user ID.
6060

6161
```
6262
RDEFINE EJBROLE BBGZDFLT.com.ibm.cicsdev.ejb.Administrator UACC(NONE)
6363
PERMIT BBGZDFLT.com.ibm.cicsdev.ejb.Administrator CLASS(EJBROLE) ACCESS(READ) ID(WEBUSER)
6464
```
6565

66-
If you don't have RACF access, you could alter the `Administrator` role in the code to be the `cicsAllAuthenticated` role instead, which is always configured for CICS bundles, in the [CatalogueBean](projects/com.ibm.cicsdev.ejb/ejbModule/com/ibm/cicsdev/ejb/CatalogueBean.java) class.
66+
If you don't have RACF access, you could alter the `Administrator` role in the [CatalogueBean](projects/com.ibm.cicsdev.ejb/ejbModule/com/ibm/cicsdev/ejb/CatalogueBean.java) to be the `cicsAllAuthenticated` role instead, which is always configured for CICS bundles,
6767

6868
## Running the Sample
69-
To create new items in the store send a HTTP request to the stock API:
69+
To create new items in the store send an authenticated HTTP request to the stock API. The authenticated user must have access to the role named in the CatalogueBean.
7070

7171
```http
7272
POST /stock/api/items HTTP/1.1
73-
Host: mvs.example.ibm.com:9080
73+
Host: <hostname:port>
7474
Content-Type: application/json
7575
Authentication: BASIC <base64 encoded username,password>
7676
@@ -85,21 +85,23 @@ Content-Type: application/json
8585
{"id":1,"name":"CICS TS for z/OS","stock":2}
8686
```
8787

88-
**Note:** We use BASIC authentication here, but any form of HTTP or HTTPS authentication would work.
89-
90-
You can use this request using the command line tool cURL:
88+
You can use this request using the command line tool cURL, replacing <hostname>, <port> and <WEBUSER> with your own values.
9189

9290
```shell
93-
curl mvs.example.ibm.com:9080/stock/api/items/ -X POST -d '{ "name": "CICS TS for z/OS", "stock": 2 }' -H 'Content-Type: application/json' --user MVSUSER1
91+
curl <hostname>:<port>/stock/api/items/ -X POST -d '{ "name": "CICS TS for z/OS", "stock": 2 }' -H 'Content-Type: application/json' --user <WEBUSER>
9492
```
9593

96-
Once one or more items have been created, you can then use a browser to navigate to http://mvs.example.ibm.com:9080/shop/ and use the shop.
94+
**Note:** We use HTTP BASIC authentication in this example but other forms of authentiation could be used.
95+
96+
97+
Once one or more items have been created, you can then use a browser to navigate to http://<hostname>:<port>/shop/ and use the shop via the CartBean. There is no role protecting
98+
the CartBean so these HTTP requests do not need to be authenticated.
9799

98-
More stock can be added to an item through the following request (in this case we update item with the ID `1`):
100+
More stock can be added to an item through the following HTTP request (in this case we update item with the ID `1`):
99101

100102
```http
101103
PUT /stock/api/items/1
102-
Host: mvs.example.ibm.com:9080
104+
Host: <hostname:port>
103105
Content-Type: application/json
104106
Authentication: BASIC <base64 encoded username,password>
105107
@@ -117,7 +119,7 @@ You can view the current state of an item by sending a GET request (in this case
117119

118120
```http
119121
GET /stock/api/items/1
120-
Host: mvs.example.ibm.com:9080
122+
Host: <hostname:port>
121123
Accept: application/json
122124
Authentication: BASIC <base64 encoded username,password>
123125
```
@@ -130,7 +132,7 @@ Content-Type: application/json
130132
```
131133

132134
### Further Configuration
133-
Because TSQs are not recoverable by default, to get the benefit of EJB transactions in the project, you would need to define a TS Model similar to this:
135+
Because CICS TSQs are not recoverable by default, to get the benefit of EJB transactions in the project, you would need to define a TS model definition similar to this:
134136

135137
```
136138
DEFINE TSMODEL(JAVAEJB) GROUP(SAMPEJB) PREFIX(CATALOGUE) RECOVERABLE(YES)
@@ -144,7 +146,6 @@ All the projects with code are Eclipse projects. To import these projects:
144146
3. Ensure all 5 projects are checked
145147
4. *Finish* to import the source projects.
146148

147-
Optionally, you can import the CICS bundle project by following the same steps, but with the `etc` directory.
148149

149150
## Notes
150151
[Twitter Bootstrap](http://getbootstrap.com/) is linked to for styling of the JSF web pages. This is pulled from a content delivery network (CDN) online. If external links are blocked, these web pages will continue to work without Bootstrap, but the Bootstrap CSS can also be downloaded and added by changing the `link` element:

0 commit comments

Comments
 (0)