hypothesis / hypothesis/lms

Remove "lms_secret" setting and rename LMS_SECRET environment variable

Open
#155 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
53
Forks
16
Avg merge
14d 5h
Merged PRs (30d)
14

Description

The `LMS_SECRET` envvar is used for two things:

1. [It's the value of the `"lms_secret"` setting](https://github.com/hypothesis/lms/blob/df063702e2e9851e97b1a5ce94d1bd8c8de8debf/lms/config/__init__.py#L34)

2. [The first 16 chars of the `LMS_SECRET` envvar also double as the value of the `"aes_secret"` setting](https://github.com/hypothesis/lms/blob/df063702e2e9851e97b1a5ce94d1bd8c8de8debf/lms/config/__init__.py#L38-L40)

The `"lms_secret"` setting doesn't seem to be used, so it should be removed:

```
$ ag -s lms_secret lms
lms/config/__init__.py
34: 'lms_secret': env_setting('LMS_SECRET'),
39: # For now we will use the first 16 bytes of the lms_secret
57: settings['lms_secret'], callback=groupfinder,
```

That will leave `LMS_SECRET` being used only as the value of the `"aes_secret"` setting, so the envvar so it can be renamed to `AES_SECRET` or perhaps to something more sensible (a name that actually describes what the value is used for).

We might also want to:

* Remove the 16 character truncation. Why not allow an encryption secret to be longer than 16 chars?
* Enforce a _minimum_ length for security?
* Make the variable required, instead of optional?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.