-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds parameter for security classification #451
Changes from 6 commits
c0c5de7
febdf12
0c20f87
670414b
d368e9c
6f57c63
8a9aeaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -323,3 +323,20 @@ | |
USE_STREAMING = env.bool("USE_STREAMING") | ||
FILE_EXPIRY_IN_SECONDS = env.int("FILE_EXPIRY_IN_DAYS") * 24 * 60 * 60 | ||
SUPERUSER_EMAIL = env.str("SUPERUSER_EMAIL", None) | ||
|
||
# Security classifications | ||
# https://www.gov.uk/government/publications/government-security-classifications/ | ||
|
||
MAX_SECURITY_CLASSIFICATION = env.str("MAX_SECURITY_CLASSIFICATION") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could make this an enum: class Classification(enum.StrEnum):
OFFICIAL = "Official"
OFFICIAL_SENSITIVE = "Official Sensitive"
...
MAX_SECURITY_CLASSIFICATION = Classification[env.str("MAX_SECURITY_CLASSIFICATION")] We'd need to use underscores rather than dashes in the names for them, of course. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also - would we want a default value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine withw/without an enum. r.e. default, we want it to fall over if they haven't set it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thought about it and decided to use the enum. |
||
|
||
match MAX_SECURITY_CLASSIFICATION: | ||
case "OFFICIAL": | ||
MAX_SECURITY_REPR = "Official" | ||
case "OFFICIAL-SENSITIVE": | ||
MAX_SECURITY_REPR = "Official Sensitive" | ||
case "SECRET": | ||
MAX_SECURITY_REPR = "Secret" | ||
case "TOP-SECRET": | ||
MAX_SECURITY_REPR = "Top Secret" | ||
case _: | ||
raise Exception(f"Unknown MAX_SECURITY_CLASSIFICATION of {MAX_SECURITY_CLASSIFICATION}") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we were to use an enum, we'd want
MAX_SECURITY_CLASSIFICATION.value
.