Skip to content

Commit

Permalink
Rename to openstack-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreprinetti committed Sep 6, 2024
1 parent cb9539a commit 83dfc3e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cert.pem
key.pem
osp-mitm
openstack-proxy
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

osp-mitm: cmd/osp-mitm pkg/proxy
go build ./cmd/osp-mitm
openstack-proxy: cmd/openstack-proxy pkg/proxy
go build ./cmd/openstack-proxy

test: test-unit test-integration
.PHONY: test
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
# openstack-mitm
# openstack-proxy

Proxies calls to the OpenStack API, exposing http or https with a provided certificate.
`openstack-proxy` proxies calls to OpenStack, exposing the OpenStack API locally over http or https with a provided certificate.

All URLs in the OpenStack catalog are rewritten to point to the proxy itself, which will properly reverse-proxy them to the original URL.

## Use locally

Build with `go build ./cmd/osp-mitm`.
Build with `go build ./cmd/openstack-proxy`.

`osp-mitm` will parse a `clouds.yaml` file at the known locations, similar to what python-openstackclient does.
`openstack-proxy` will parse a `clouds.yaml` file at the known locations, similar to what python-openstackclient does.

By default the server will listen on localhost on port 13000.

**Configuration:**
* `--url <url>`: URL osp-mitm will be reachable at. Default: `http://locahost:13000`
* `--cert <path>`: path of the local PEM-encoded HTTPS certificate file. Mandatory if the scheme of --url is HTTPS.
* `--key <path>`: path of the local PEM-encoded HTTPS certificate key file. Mandatory if the scheme of --url is HTTPS.
* `-o <path>`: Location where to write a new `clouds.yaml` that points to the osp-mitm instance.
* `--url <url>`: the address this proxy will be reachable at. Default: `http://locahost:13000`
* `--cert <path>`: path of the local PEM-encoded HTTPS certificate file. Mandatory if the scheme of --url is HTTPS
* `--key <path>`: path of the local PEM-encoded HTTPS certificate key file. Mandatory if the scheme of --url is HTTPS
* `-o <path>`: location where to write a new `clouds.yaml` that points to the openstack-proxy instance

## Examples

### Local server

```shell
export OS_CLOUD=openstack
./osp-mitm -o mitm-clouds.yaml
./openstack-proxy -o proxied-clouds.yaml
```
```shell
export OS_CLIENT_CONFIG_FILE=./mitm-clouds.yaml
export OS_CLIENT_CONFIG_FILE=./proxied-clouds.yaml
openstack server list
```

### On the network, with HTTPS

```shell
./osp-mitm \
./openstack-proxy \
--url https://myserver.example.com:13000 \
--cert /var/run/osp-cert.pem \
--key /var/run/osp-key.pem' \
-o mitm-clouds.yaml
-o proxied-clouds.yaml
```
101 changes: 0 additions & 101 deletions cmd/osp-mitm/main.go

This file was deleted.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/pierreprinetti/openstack-mitm
module github.com/pierreprinetti/openstack-proxy

go 1.22

require (
github.com/gofrs/uuid/v5 v5.2.0
github.com/gofrs/uuid/v5 v5.3.0
github.com/gophercloud/gophercloud/v2 v2.1.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM=
github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gofrs/uuid/v5 v5.3.0 h1:m0mUMr+oVYUdxpMLgSYCZiXe7PuVPnI94+OMeVBNedk=
github.com/gofrs/uuid/v5 v5.3.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gophercloud/gophercloud/v2 v2.1.0 h1:91p6c+uMckXyx39nSIYjDirDBnPVFQq0q1njLNPX+NY=
github.com/gophercloud/gophercloud/v2 v2.1.0/go.mod h1:f2hMRC7Kakbv5vM7wSGHrIPZh6JZR60GVHryJlF/K44=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down

0 comments on commit 83dfc3e

Please sign in to comment.