# Features — unityAWS

Evidence date: 2026-09-30.

Source: `git@bitbucket.org:overdrive/unityaws.git`, `master` at `e9f10da` (2019-10-08).

"Current" means present on that revision and reachable from the root handler or from the pipeline file. A file that is in git but not imported by the root handler is listed separately. There is no issue tracker or roadmap, so nothing is marked planned unless a comment describes behaviour the code does not perform. The only TODO comment is `# TODO implement` in `lambda/lambda_function.py`.

## Current features

### F-01 — Login action

Root `lambda_function.py` calls `login(event['username'], event['password'])` when `json.loads(event["body"])["action"]` equals `login`.

`login()` in `login.py` returns `{"success": "false", "reason": "invalid"}`. The arguments are unused. `success` is a string.

The HTTP wrapper is status 200, `Access-Control-Allow-Origin: *`, and `json.dumps` of that object.

Origin: `login.py` and a call site at `30c1d6c`. That first call site was `import login` followed by `login(...)`, which calls the module and would raise `TypeError`. The call was commented out in `8c03a71` and restored in `9409bbd` as `from login import login`. Action moved into the JSON body in `9ddf51c`. The return dict has been unchanged since `30c1d6c`.

Status: **current** as a stub. Confidence: high.

### F-02 — Non-login response

If `action` is present and is not `login`, the handler returns status 200, the same CORS header, and JSON `""`.

Origin: `e9f10da` ("zero out response") assigns `response = ""` before the branch. At `9ddf51c` this path raised `NameError` because `response` was only set inside the `if`.

Status: **current**. Confidence: high.

### F-03 — RDS connection on import

`login.py` connects with PyMySQL to the endpoint, user, password, and database name in `config.py`, timeout 5 seconds. Failure logs `ERROR: Unexpected error: Could not connect to MySql instance.` and calls `sys.exit()`. Success logs `SUCCESS: Connection to RDS mysql instance succeeded`.

The connection is not used for a query.

`config.py` names database `unityqa` and host `unityqa.csigt2kcstpl.us-east-2.rds.amazonaws.com`. The password is omitted from this document.

Origin: connection block lived in the handler from `437b8c6`, moved into `login.py` at `30c1d6c`. `config.py` added at `661f10a`. The handler imported `config` from `437b8c6`, one commit before the file existed.

Status: **current**. Confidence: high.

### F-04 — Pipeline update of Lambda `qaFunction`

`bitbucket-pipelines.yml` default pipeline, image `python:3.5.7`:

1. Install `zip` and run `zip -r code.zip *`.
2. `atlassian/aws-lambda-deploy:0.2.1` with command `update`, region `us-east-2`, function `qaFunction`, zip `code.zip`.

AWS key variables are referenced and not stored in the file.

Origin: `437b8c6`, zip path corrected in `9a9819c` and `661f10a`.

Status: **current** in YAML. Whether the last pipeline run succeeded is **Unknown**. Confidence: high for the file.

### F-05 — Vendored PyMySQL 0.9.3

`pymysql/` and `PyMySQL-0.9.3.dist-info/` are tracked. Metadata name `PyMySQL`, version `0.9.3`, license MIT. Bytecode under `__pycache__/` is tagged `cpython-37`, including `config.cpython-37.pyc`.

Status: **current**. Confidence: high.

## In the tree, not used by the root handler

### F-06 — `lambda/lambda_function.py`

Second `lambda_handler`. Connects to MySQL at import the same way as `login.py`. Returns status 200 and body `json.dumps('Lambda , Unity')`. No CORS header. Comment `# TODO implement`. Does not import `login.py`.

Origin: `6ac019f`, after the original handler had been moved to the repository root. The root file is not a re-export of this one.

Status: **present, not referenced**. It is inside the pipeline's `*` zip. It runs only if the Lambda handler property names it. That property is **Unknown**. Confidence: high.

### F-07 — `lambda.zip`

Tracked zip added at `661f10a` and not updated. Contains `lambda_function.py`, `config.py`, `pymysql/`, `PyMySQL-0.9.3.dist-info/`, and `__pycache__/`. The handler inside returns `Lambda , Unity` and has no CORS header. `login.py` is absent.

The pipeline artifact name is `code.zip`, not `lambda.zip`.

Status: **present, stale**. Confidence: high.

## Removed or disabled behaviour

| Behaviour | When | Evidence |
|---|---|---|
| Response body was the whole event, login call commented out | `8c03a71` only | Restored at `9409bbd` |
| `action` read from `event['action']` rather than `event["body"]` | `30c1d6c` through `9409bbd` | Replaced at `9ddf51c` |
| Root handler returned `Lambda , Unity` and owned the MySQL connect | `437b8c6` through `6ac019f` | Connect moved to `login.py` at `30c1d6c`. The string return remains only in `lambda/lambda_function.py` and in `lambda.zip` |
| Zip of absolute `/lambda/` | `437b8c6` | Replaced at `9a9819c` |
| `NameError` when `action` was not `login` | `9ddf51c` only | Removed at `e9f10da` |

No feature flag or comment says these should come back.

## Not implemented

The following are absent. They are not planned features. They are gaps a reader might assume from the word "login":

- A SQL query, a user table, or a password comparison.
- A success payload. Every reached `login()` call returns `success` `"false"`.
- Token, session, or role checks.
- An OPTIONS or error status. The root handler's only status is 200.
- Tests, `requirements.txt`, schema, or an infrastructure template.
- `sonar-project.properties` and `sonarqube_scan.bat`. The onboarding scan listed them. They are not in git at `e9f10da`.

## Planned

None found. `# TODO implement` in `lambda/lambda_function.py` does not say what to implement.

## Recently changed

The last change is `e9f10da` on 2019-10-08: initialise `response` so a non-login action does not raise. No commit since that date is in this repository.
