Skip to content

Commit 9fc5091

Browse files
authored
Merge pull request #63 from openziti/mention-s3z
mention s3z in more places
2 parents 7770f55 + 51fe6e1 commit 9fc5091

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
![Ziggy loves python](https://raw.githubusercontent.com/openziti/branding/main/images/banners/Python.jpg)
22

33
# Python SDK for OpenZiti
4+
45
<p align="center">
56
<a href="https://openziti.discourse.group/">
67
<img src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fopenziti.discourse.group" alt="Discourse">
@@ -34,11 +35,13 @@ OpenZiti is an open-source project that provides secure, zero-trust networking f
3435
More specifically, the SDK allows you to integrate zero trust at the application level. This means your data is never
3536
exposed outside the application environment providing you with end-to-end encryption for ultimate security. See other
3637
zero trust models [here](https://docs.openziti.io/docs/learn/core-concepts/zero-trust-models/overview).
38+
3739
<p align="center">
3840
<img src="./images/ztaa-model-overview.png" alt="Zero-trust-application-access">
3941
</p>
4042

4143
## Getting Started
44+
4245
If you don't already have an OpenZiti network running, you can follow our [express install guides](https://docs.openziti.io/docs/learn/quickstarts/network/)
4346
to set up the network that fits your needs. Or, you can try [CloudZiti](https://netfoundry.io/pricing/) for free, check out more [here](https://docs.openziti.io/).
4447

@@ -52,6 +55,7 @@ pip install openziti
5255
```
5356

5457
### Using Ziti Python SDK
58+
5559
With just two lines of code, you can turn your plain old web server into a secure, zero-trust embedded application.
5660
Below is an example of just how simple it is to get started.
5761

@@ -87,43 +91,56 @@ know what a monkey patch is! However, if you're interested in what a monkey patc
8791
cfg = dict(ztx=openziti.load('/path/to/identity.json'), service="name-of-ziti-service")
8892
openziti.monkeypatch(bindings={('127.0.0.1', 8000): cfg})
8993
```
94+
9095
Or try our decorator pattern with a function annotation
96+
9197
```python
9298
@openziti.zitify(bindings={('127.0.0.1', 18080): {'ztx': '/path/to/identity.json', 'service': 'name-of-ziti-service'}})
9399
def yourFunction():
94100
```
95101

96102
The `binding` dictionary configures what happens when the code tries to open a server socket. Standard network addresses
97103
are mapped to ziti service configurations. For example, with his configuration
104+
98105
```python
99106
bindings = {
100107
('0.0.0.0', 8080): { 'ztx': 'my-identity.json', 'service':'my-service' }
101108
}
102109
```
110+
103111
when application opens a server socket and binds to address `0.0.0.0:8080` it will actually bind to the ziti service named `my-service`.
104112

105113
Binding addresses can be specified with tuples, strings, or ints(ports). `('0.0.0.0', 8080)`, `'0.0.0.0:8080'`, `':8080'`, `8080`
106114
are all considered and treated the same.
107115

108116
## Examples
117+
109118
Try it out yourself with one of our [examples](sample%2FREADME.md)
119+
110120
* [Flazk](sample/flask-of-ziti)
111121
* [Echo Server](sample/ziti-echo-server)
112122
* [HTTP Server](sample/ziti-http-server)
113123
* [Ziti Requests](sample/ziti-requests)
114124
* [Ziti Socket](sample/ziti-socket)
115125
* [Ziti urllib3](sample/ziti-urllib3)
126+
* [S3 Log Uploader (boto3)](sample/s3z)
116127

117128
## Support
129+
118130
### Looking for Help?
131+
119132
Please use these community resources for getting help. We use GitHub [issues](https://github.com/openziti/ziti-sdk-py/issues)
120133
for tracking bugs and feature requests and have limited bandwidth to address them.
121134

122135
- Read the [offical docs](https://docs.openziti.io/docs/learn/introduction/)
123136
- Join our [Developer Community](https://openziti.org)
124137
- Participate in discussion on [Discourse](https://openziti.discourse.group/)
138+
125139
## Contributing
140+
126141
Do you want to get your hands dirty and help make OpenZiti better? Contribute to the OpenZiti open-source project
127142
through bug reports, bug fixes, documentation, etc. Check out our guide on contributing to our projects [here](https://docs.openziti.io/policies/CONTRIBUTING.html).
143+
128144
## License
145+
129146
[Apache 2.0](./LICENSE)

sample/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,44 @@
22

33
## Setup
44

5-
In order to begin using the examples, you'll need an OpenZiti network. If you don't already have one running, you can follow our [express install guides](https://docs.openziti.io/docs/learn/quickstarts/network/)
5+
You will need an OpenZiti network to use the examples. If you don't already have one running, you can follow our [express install guides](https://docs.openziti.io/docs/learn/quickstarts/network/)
66
to set up the network that fits your needs. You could also use [ZEDS](https://zeds.openziti.org) (Ziti Edge Developer Sandbox) or, you can try cloud Ziti for free, check out more [here](https://docs.openziti.io/).
77

88
### Installing the SDK
99

10-
The Python SDK for OpenZiti is distributed via the Python Package Index (PyPI) and can be installed using
10+
The Python SDK for OpenZiti is distributed via the Python Package Index (PyPI) and can be installed using
1111
[`pip`](https://pypi.org/project/openziti/) package manager.
1212

1313
```shell
1414
pip install openziti
1515
```
1616

1717
### Install Python Requirements
18+
1819
First, you'll need the dependent libraries used in the examples.
20+
1921
```bash
2022
cd ./sample
2123
pip install -r requirements
2224
```
2325

2426
### Get and Enroll an Identity
27+
2528
You need an [identity](https://docs.openziti.io/docs/learn/core-concepts/identities/overview) to be used by the example
2629
application. If using [ZEDS](https://zeds.openziti.org) you can grab one from there, otherwise you can find all the
2730
information you need for creating and enrolling an identity in the [doc here](https://docs.openziti.io/docs/learn/core-concepts/identities/overview#creating-an-identity).
2831

2932
Alternatively, if you have an identity enrollment token (JWT file), you can perform the enrollment with the Python SDK.
33+
3034
```bash
3135
python -m openziti enroll --jwt=</path/to/enrollment-token-file.jwt> --identity=</path/to/id.json>
3236
```
3337

3438
### Environment
39+
3540
The `ZITI_IDENTITIES` environment variable can be used to store the paths to any identity files you have. If you have
3641
more than one identity file, you can use the `;` operator as a delimiter to provide additional identities.
42+
3743
```bash
3844
export ZITI_IDENTITIES=</path/to/id.json>
3945
```
@@ -42,6 +48,7 @@ There is an optional environment variable `ZITI_LOG` which, by default is set to
4248
output more or less log information. A `ZITI_LOG` level of `6` will output `TRACE` level logs.
4349

4450
### Network
51+
4552
Your network overlay needs to have a [Service](https://docs.openziti.io/docs/learn/core-concepts/services/overview),
4653
and the proper [Service Configurations](https://docs.openziti.io/docs/learn/core-concepts/config-store/overview), the
4754
documentation for which is linked.
@@ -50,28 +57,39 @@ If you happen to be using [ZEDS](https://zeds.openziti.org) you are in luck, the
5057
that are already implemented in the developer sandbox.
5158

5259
## Examples
60+
5361
> **Note**
5462
> All but the Flazk example scripts use predefined services in [ZEDS](https://zeds.openziti.org) by default.
5563
5664
### [Flazk](flask-of-ziti) <img src="../images/python-flask.jpg" width="2%">
65+
5766
An example showing the simplicity in integrating zero trust into a web server or API using Flask. This example also
5867
shows how to use the decorator to apply the monkeypatch.
5968
`flask-of-ziti/helloFlazk.py`
6069

6170
### [Ziti Echo Server](ziti-echo-server)
71+
6272
An example showing how to open a socket to listen on the network overlay for a particular service and send all bytes
6373
received back to the sender.
6474

6575
### [Ziti HTTP Server](ziti-http-server)
76+
6677
An example showing how to monkeypatch `http.server` to listen for HTTP requests on the network overlay. When a request
6778
is captured, a response with a simple JSON document is sent to clients.
6879

6980
### [Ziti Requests](ziti-requests)
81+
7082
An example showing the use of Ziti monkey patching a standard socket, via the requests module, to intercept network
7183
connections using Ziti overlay.
7284

7385
### [Ziti Socket](ziti-socket)
86+
7487
An example showing the use of a _raw_ Ziti socket.
7588

7689
### [Ziti urllib3](ziti-urllib3)
90+
7791
An example showing how to monkeypatch `urllib3` to fetch a Ziti service using HTTP.
92+
93+
### [S3 Log Uploader](sample/s3z)
94+
95+
Upload some log files to a private S3 bucket via the Ziti with the boto3 SDK.

0 commit comments

Comments
 (0)