Metadata-Version: 2.1
Name: mse-cli
Version: 0.10.0
Summary: Python CLI for MicroService Encryption
Home-page: https://cosmian.com
Author: Cosmian Tech
Author-email: tech@cosmian.com
License: MIT
Project-URL: Documentation, https://docs.cosmian.com
Project-URL: Source, https://github.com/Cosmian/mse-cli
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
Requires-Dist: cryptography (<40.0.0,>=39.0.0)
Requires-Dist: docker (<7.0.0,>=6.0.1)
Requires-Dist: intel-sgx-ra (<1.1,>=1.0)
Requires-Dist: jinja2 (<3.1,>=3.0)
Requires-Dist: mse-lib-crypto (<1.2,>=1.1)
Requires-Dist: pydantic (<2.0.0,>=1.10.2)
Requires-Dist: pyjwt (<2.7.0,>=2.6.0)
Requires-Dist: requests (<3.0.0,>=2.28.1)
Requires-Dist: toml (<0.11.0,>=0.10.2)
Requires-Dist: urllib3 (<1.27.0,>=1.26.13)

# Microservice Encryption Command-Line (MSE)

## Overview

Python CLI for Microservice Encryption. See [Github repository](https://github.com/Cosmian/mse-cli).

Read the [MSE documentation](https://docs.cosmian.com/microservice_encryption/).

## Install

```console
$ pip install -r requirements.txt
$ pip install -U .
```

## Usage

### Pre-requisites

First of all sign up or sign in using:

```console
$ mse login
```

Download the [mse-app-examples](https://github.com/Cosmian/mse-app-examples) repository. And go to the `helloworld` directory.

You can find an example of `flask` application and a `mse.toml` configuration file.

### Deployment

You can deploy this application as follow:

```console
$ cd helloworld
$ mse deploy --path mse.toml
```

`mse` creates `<uuid>.toml` in `$MSE_CONF_PATH/context` for each new deployment which contains some context data.

If `--path` is not provided, `mse` is expecting a `mse.toml` in the current directory when using `deploy` subcommand.

### More subcommands

```console
$ mse --help
```

### More parameters

You can use these following env variables:

- `MSE_CONF_PATH` to use another directory than `~/.config/mse/`
- `MSE_BASE_URL` to use another backend url than `https://backend.mse.cosmian.com`
- `MSE_AUTH0_DOMAIN_NAME` to specify another auth0 login url
- `MSE_AUTH0_CLIENT_ID` to specify another auth0 tenant client id
- `MSE_AUTH0_AUDIENCE` to specify another tenant audience
- `MSE_CONSOLE_URL` to specify another console URL
- `MSE_PCCS_URL` to specify another PCCS URL 


## Development & Test

To work with the development/test environment, you shall edit the following variables with their proper values:

- `MSE_CONF_PATH`
- `MSE_AUTH0_CLIENT_ID`
- `MSE_AUTH0_DOMAIN_NAME`
- `MSE_BASE_URL`
- `MSE_AUTH0_AUDIENCE`
- `MSE_CONSOLE_URL`
- `MSE_PCCS_URL`

Do the same, if you need to use de staging environment.

Then you first need to login in in order to generate a session. Then run the test.
```console
$ mse login
$ export MSE_TEST_DOMAIN_NAME="EDIT"
$ export MSE_TEST_PRIVATE_KEY="EDIT"
$ export MSE_TEST_PUBLIC_KEY="EDIT"
$ pytest
```

## Documentation

```console
$ cd documentation
$ mkdocs serve
```

then open your browser on: `http://127.0.0.1:8003/`
