Metadata-Version: 2.1
Name: auth-trial
Version: 0.1.3
Summary: Auth Microservice Package. Please refer to README.md for complete guide.
Author: Asti
Author-email: f20190640@goa.bits-pilani.ac.in
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
Requires-Dist: requests-oauthlib (>=1.3.1,<2.0.0)
Description-Content-Type: text/markdown

# Auth Microservice 

## Install the microservice:

```bash
pip install auth-trial==0.1.3
```

## Python CLI usage

### Setup

On your terminal, switch to Python CLI

```bash
python
```

Then, import the **auth** package:

```python
from auth_trial import auth
```

You can now use functions of the Auth microservice.

### Register/Authorize new session

```python
auth.authorization()
```

Follow the guide:

1. Paste the displayed link in a web browser
1. If requested, approve access via Gitlab. 
1. Paste the link you are redirected to, into the terminal.

The **state** and **access_token** for this session
will be displayed.

Copy/Save these for later use. 

### Validating existing session

```python
auth.validation(state, access_token)
```

Provide the **state** and **access_token**
of the session requesting validation, as parameters.

In case of successful validation, your account
information will be displayed. Confirm that this is 
the correct account before proceeding. 

Response codes will be returned by this function:

- 200 : OK, User Validated
- 403 : User validation has expired, Requires re-authorization
- 404 : New user/ User is not validation

### Exit

To exit the Python CLI:

```python
exit()
```


