Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

add basic readme to repo #1

Merged
merged 1 commit into from
Jan 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# RHMI SMTP Tooling and Service

This repo is intended to store the services and tooling related to the setup of
SMTP in an Integreatly/RHMI cluster.

## CLI

This repo contains a CLI which can be used to create SendGrid sub users and API
keys for those sub users, that can be used with RHMI clusters.

The intended pattern is that each RHMI cluster would have it's own sub user
which would then contain an API key for the RHMI cluster. The reasoning behind
this approach is that *SendGrid clusters only allow 100 API keys per user*.

### Building

To build the CLI, run from the root of this repo:

```
make build/cli
```

A binary will be created in the root directory of the repo, which can be run:

```
./cli
```


### How to use

To use the CLI, you must create the env var `SENDGRID_API_KEY`, with a SendGrid master account API key with at least
permissions to:

- Create and read sub users
- Create and read API keys
- Read IP addresses

To export the env var, run:

```
export SENDGRID_API_KEY=<mySendGridAPIKey>
```

#### Create a new API key for a cluster

To create a new API key for a cluster, run:

```
./cli create my_cluster_id
```

an OpenShift Secret will be output to stdout.

Note that the cluster name must also be a unique username is SendGrid.

#### Delete an API key for a cluster

To delete an API key for a cluster, run:

```
./cli delete my_cluster_id
```

This will simply delete the sub user associated with the SendGrid cluster.

#### Get an API key for a cluster

To get the name of the API key for a cluster, not the cluster itself, run:

```
./cli get my_cluster_id
```

This command is mainly useful to check if an API key exists for the cluster.

## Testing

To run unit tests, run:

```
make test/unit
```