Skip to content

Commit afd095c

Browse files
committed
tidy markdown
1 parent a51614f commit afd095c

File tree

2 files changed

+97
-41
lines changed

2 files changed

+97
-41
lines changed

example/curlz/README.md

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,55 @@
11
# Overview
2-
This example is a zitified cURL (cURLz) example. In part 1 of this example, a call will be made to an endpoint which
2+
3+
This example is a zitified cURL (cURLz) example. In part 1 of this example, a call will be made to an endpoint which
34
is not on the overlay network. In part 2, a call is made to an endpoint that *is* on the overlay network.
45

56
This example demonstrates:
7+
68
* Dialing a service
79

810
## Requirements
11+
912
* an OpenZiti network. If you do not have one, you can use one of the [quickstarts](https://openziti.github.io/ziti/quickstarts/quickstart-overview.html) to set one up.
1013
* OpenZiti CLI to create services and identities on the OpenZiti Network
1114

1215
## Build the examples
16+
1317
Refer to the [example README](../README.md) to build the SDK examples
1418

1519
## Part 1: Set up a cURLz to a non-zitified endpoint
16-
These steps will configure the service using the OpenZiti CLI. In this example, the traffic starts on the overlay zero
17-
trust network and then is offloaded onto the underlay network.
20+
21+
These steps will configure the service using the OpenZiti CLI. In this example, the traffic starts on the overlay zero
22+
trust network and then is offloaded onto the underlay network.
1823

1924
### Part 1 Architecture Overview
25+
2026
![image](unzitified.png)
2127

2228
At the end of these steps you will have created:
29+
2330
* a service called `web.endpoint`
2431
* an identity to connect to (dial) the service
2532
* the service config to connect the service to the overlay
2633
* the service policies required to authorize the identities for bind and dial
2734

2835
Steps:
36+
2937
1. Log into OpenZiti. The host:port and username/password will vary depending on your network.
3038

39+
```bash
3140
ziti edge login localhost:1280 -u admin -p admin
41+
```
42+
3243
1. Determine your edge router's name and populate this environment variable with it.
3344

45+
```bash
3446
ziti edge list edge-routers
3547
export ZITI_EDGE_ROUTER=<name-of-edge-router>
48+
```
49+
3650
1. Run this script to create everything you need.
3751

52+
```bash
3853
echo Changing to build directory
3954
cd $ZITI_SDK_BUILD_DIR
4055

@@ -54,55 +69,76 @@ Steps:
5469
5570
echo Run policy advisor to check
5671
ziti edge policy-advisor services
72+
```
73+
5774
1. Run the cURLz example for `web.endpoint`
5875

76+
```bash
5977
./curlz https://web.endpoint curlz.json
78+
```
6079

6180
### Example Output
81+
6282
The following is the output you'll see from the cURLz request to `web.endpoint`.
63-
```
83+
84+
```bash
6485
$ ./curlz https://web.endpoint curlz.json
6586
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en">
6687
... <a lot of html code>
6788
</body></html>
6889
```
6990

7091
## Part 2: Set up a cURLz to a zitified endpoint
71-
These steps will utilize the service and identities created in simple-server to provide an example of using cURLz with
72-
a zitified endpoint. In this example, the traffic never leaves the zero trust overlay.
92+
93+
These steps will utilize the service and identities created in simple-server to provide an example of using cURLz with
94+
a zitified endpoint. In this example, the traffic never leaves the zero trust overlay.
7395

7496
### Part 2 Architecture Overview
97+
7598
![image](zitified.png)
7699

77100
At the end of these steps you will have created:
101+
78102
* an identity to connect to (dial) the service
79103

80104
Steps:
81-
1. Follow all steps in the simple-service example up to, and including, running the server but **do not** enroll the
105+
106+
1. Follow all steps in the simple-service example up to, and including, running the server but **do not** enroll the
82107
`simple-client` identity with the Ziti Desktop Edge client. We will do that with the CLI for this example
83108
1. Open a new terminal and cd into the example build directory
84109

110+
```bash
85111
echo Changing to build directory
86112
cd $ZITI_SDK_BUILD_DIR
113+
```
114+
87115
1. Run this script to create everything you need.
88116

117+
```bash
89118
echo Enroll the simple-client identity
90119
ziti edge enroll --jwt simple-client.jwt
120+
```
91121

92122
1. Run the cURLz example for `simpleService`
93123

124+
```bash
94125
./curlz http://simpleService simple-client.json
126+
```
95127

96128
### Example Output
129+
97130
The following is the output you'll see from the cURLz request to `simpleService`.
98-
```
131+
132+
```bash
99133
$ ./curlz http://simpleService.ziti simple-client.json
100134
Who are you?
101135
```
102136

103137
## Teardown
138+
104139
Done with the example? This script will remove everything created during setup.
105-
```
140+
141+
```bash
106142
ziti edge login localhost:1280 -u admin -p admin
107143

108144
echo Removing service policies
@@ -118,4 +154,5 @@ ziti edge delete identity curlz
118154
echo Removing service
119155
ziti edge delete service web.endpoint
120156
```
157+
121158
**NOTE:** If you followed **Part 2** of this example, refer to teardown in the `simple-server` [example README](../simple-server/README.md)

example/http-client/README.md

Lines changed: 51 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,90 @@
11
# Overview
2+
23
This example demonstrates a zitified HTTP client.
34

45
This example demonstrates:
6+
57
* Dialing a service by intercept address.
68

79
## Requirements
10+
811
* an OpenZiti network. If you do not have one, you can use one of the [quickstarts](https://openziti.github.io/ziti/quickstarts/quickstart-overview.html) to set one up.
912
* OpenZiti CLI to create services and identities on the OpenZiti Network
1013

1114
## Build the example
15+
1216
Refer to the [example README](../README.md) to build the SDK examples
1317

1418
## Part 1: Set up a cURLz to a non-zitified endpoint
15-
These steps will configure the service using the OpenZiti CLI. In this example, the traffic starts on the overlay zero
16-
trust network and then is offloaded onto the underlay network.
19+
20+
These steps will configure the service using the OpenZiti CLI. In this example, the traffic starts on the overlay zero
21+
trust network and then is offloaded onto the underlay network.
1722

1823
### Part 1 Architecture Overview
24+
1925
![image](unzitified.png)
2026

2127
At the end of these steps you will have created:
28+
2229
* a service called `web.endpoint`
2330
* an identity to connect to (dial) the service
2431
* the service config to connect the service to the overlay
2532
* the service policies required to authorize the identities for bind and dial
2633

2734
Steps:
35+
2836
1. log into Ziti. The host:port and username/password will vary depending on your network.
2937

30-
ziti edge login localhost:1280 -u admin -p admin
38+
```bash
39+
ziti edge login localhost:1280 -u admin -p admin
40+
```
41+
3142
1. Determine your edge router's name and populate this environment variable with it.
3243
33-
ziti edge list edge-routers
34-
export ZITI_EDGE_ROUTER=<name-of-edge-router>
44+
```bash
45+
ziti edge list edge-routers
46+
export ZITI_EDGE_ROUTER=<name-of-edge-router>
47+
```
48+
3549
1. Run this script to create everything you need.
3650
37-
cd <repo-root-dir>/example/build
38-
39-
echo Create the service config
40-
ziti edge create config httpbin.hostv1 host.v1 '{"protocol":"tcp", "address":"httpbin.org","port":80}'
41-
ziti edge create config httpbin.clientv1 intercept.v1 '{"protocols":["tcp"], "addresses":["httpbin.ziti"],"portRanges":[{"low":80,"high":80}]}'
42-
43-
echo Create the service
44-
ziti edge create service ziti.httpbin --configs "httpbin.hostv1,httpbin.clientv1"
45-
46-
echo Create an identity to make the dial request and enroll it
47-
ziti edge create identity user http-client -a clients -o http-client.jwt
48-
ziti edge enroll --jwt http-client.jwt
49-
50-
echo Create service policies
51-
ziti edge create service-policy ziti.httpbin.dial Dial --service-roles "@ziti.httpbin" --identity-roles "#clients"
52-
ziti edge create service-policy ziti.httpbin.bind Bind --service-roles "@ziti.httpbin" --identity-roles "@${ZITI_EDGE_ROUTER}"
53-
54-
echo Create edge router policies
55-
ziti edge create edge-router-policy ziti.httpbin-edge-router-policy --edge-router-roles '#all' --identity-roles '#clients,#servers'
56-
ziti edge create service-edge-router-policy ziti.httpbin-service-edge-router-policy --edge-router-roles '#all' --service-roles '@ziti.httpbin'
57-
58-
echo Run policy advisor to check
59-
ziti edge policy-advisor services
51+
```bash
52+
cd <repo-root-dir>/example/build
53+
54+
echo Create the service config
55+
ziti edge create config httpbin.hostv1 host.v1 '{"protocol":"tcp", "address":"httpbin.org","port":80}'
56+
ziti edge create config httpbin.clientv1 intercept.v1 '{"protocols":["tcp"], "addresses":["httpbin.ziti"],"portRanges":[{"low":80,"high":80}]}'
57+
58+
echo Create the service
59+
ziti edge create service ziti.httpbin --configs "httpbin.hostv1,httpbin.clientv1"
60+
61+
echo Create an identity to make the dial request and enroll it
62+
ziti edge create identity user http-client -a clients -o http-client.jwt
63+
ziti edge enroll --jwt http-client.jwt
64+
65+
echo Create service policies
66+
ziti edge create service-policy ziti.httpbin.dial Dial --service-roles "@ziti.httpbin" --identity-roles "#clients"
67+
ziti edge create service-policy ziti.httpbin.bind Bind --service-roles "@ziti.httpbin" --identity-roles "@${ZITI_EDGE_ROUTER}"
68+
69+
echo Create edge router policies
70+
ziti edge create edge-router-policy ziti.httpbin-edge-router-policy --edge-router-roles '#all' --identity-roles '#clients,#servers'
71+
ziti edge create service-edge-router-policy ziti.httpbin-service-edge-router-policy --edge-router-roles '#all' --service-roles '@ziti.httpbin'
72+
73+
echo Run policy advisor to check
74+
ziti edge policy-advisor services
75+
```
76+
6077
1. Run the `http-client` example for service `ziti.httpbin` using intercept address `tcp:httpbin.ziti:80`
6178

62-
ZITI_IDENTITIES=http-client.json ./http-client http://httpbin.ziti
79+
```bash
80+
ZITI_IDENTITIES=http-client.json ./http-client http://httpbin.ziti
81+
```
6382

6483
### Example Output
84+
6585
The following is the output you'll see.
66-
```
86+
87+
```bash
6788
export ZITI_IDENTITIES=http-client.json
6889
$ ./http-client http://httpbin.ziti/json
6990
{
@@ -88,5 +109,3 @@ $ ./http-client http://httpbin.ziti/json
88109
}
89110
}
90111
```
91-
92-

0 commit comments

Comments
 (0)