Skip to content

FridgeFinder/CFM_Auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CFM_Auth

FridgeFinder Auth Service

GitHub contributors GitHub commit activity (dev)

Service for Authorization and Authentication


Pre-Requisites

  1. AWS CLI - Install the AWS CLI
    • You DO NOT have to create an AWS account to use AWS CLI for this project, skip these steps if you don't want to create an AWS account
    • AWS CLI looks for credentials when using it, but doesn't validate. So will need to set some fake one. But the region name matters, use any valid region name.
      $ aws configure
      $ AWS Access Key ID: [ANYTHING YOU WANT]
      $ AWS Secret Access Key: [ANYTHING YOUR HEART DESIRES]
      $ Default region nam: us-east-1
      $ Default output format [None]: (YOU CAN SKIP)
  2. SAM CLI - Install the SAM CLI
    • You DO NOT need to create an aws account to use SAM CLI for this project, skip these steps if you don't want to create an aws account
    • Note: if you are getting the following error: runtime is not supported when running sam build --use-container make sure your SAM CLI version is up to date
  3. Python 3 - Install Python 3
  4. Docker - Install Docker

Build and Test

Run Locally

Confirm that the following requests work for you

  1. cd AUTH/
  2. sam build --use-container
  3. sam local invoke HelloWorldFunction --event events/event.json
    • response: {"statusCode": 200, "body": "{\"message\": \"hello world - AUTH\"}"}
  4. sam local start-api
  5. curl http://localhost:3000/hello
    • response: {"message": "hello world - AUTH"}

Running Tests

Setup Testing Environment

  1. Create a Python virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
  2. Install test dependencies:

    cd AUTH/
    pip install -r tests/requirements.txt
  3. Install the package in development mode (required for imports and tests):

    pip install -e .

Running Unit Tests

Run all unit tests:

pytest tests/unit/ -v

Run specific test suite:

# Test post-confirmation handler
pytest tests/unit/test_post_confirmation.py -v

# Test specific function
pytest tests/unit/test_post_confirmation.py -k "test_successful_confirmation"

Test Coverage

Generate coverage report:

pytest tests/unit/ --cov=src/ --cov-report=term-missing

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •