Skip to content

Add a background job encryptor#6211

Merged
jmhooper merged 3 commits intomainfrom
jmhooper-add-bg-job-encryptor
Apr 15, 2022
Merged

Add a background job encryptor#6211
jmhooper merged 3 commits intomainfrom
jmhooper-add-bg-job-encryptor

Conversation

@jmhooper
Copy link
Contributor

Why: Currently we use the session encryptor to encrypt args for async proofing activities and sessions. This adds a complication to modifying the way sessions are encrypted because it is coupled to the way background job arguments are encrypted. Adding this new encryptor (which is a clone of the session encryptor) decouples them and enables us to make changes to the session encryptor.

**Why**: Currently we use the session encryptor to encrypt args for async proofing activities and sessions. This adds a complication to modifying the way sessions are encrypted because it is coupled to the way background job arguments are encrypted. Adding this new encryptor (which is a clone of the session encryptor) decouples them and enables us to make changes to the session encryptor.
# encrypt the session. When this code is changed to integrate a new mail
# vendor we should create a purpose built encryptor for that vendor
Encryption::Encryptors::SessionEncryptor.new
Encryption::Encryptors::BackgroundProofingArgEncryptor.new
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a 3rd encryptor here? since this is for proofing but isn't backgrounded yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it and didn't feel great about the copy/paste part here. Especially since this does run in a background job when the GPO upload occurs. Maybe a subclass or something like that could work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right this is in a daily background job ... nvm let's leave it

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmhooper jmhooper merged commit 7e8d36d into main Apr 15, 2022
@jmhooper jmhooper deleted the jmhooper-add-bg-job-encryptor branch April 15, 2022 19:45
jmhooper added a commit that referenced this pull request Dec 14, 2023
In the past the IDP used the `Encryption::Encryptors::SessionEncryptor` to encrypt sessions as a whole. This tool was used by the unfortunately named `SessionEncryptor` which acts as a serializer for the session store. The `Encryption::Encryptors::SessionEncryptor` was also used for encrypting PII temporarily while it was queued for letter sending.

Two changes led to `Encryption::Encryptors::SessionEncryptor` being unused:

- #6315 enabled partial session encryption which made the session encryptor sophisticated enough that it justified its own logic for encrypting elements instead of depending on `Encryption::Encryptors::SessionEncryptor`
- #6211 replaced the `Encryption::Encryptors::SessionEncryptor` that was used for encrypting letter PII with a new encryptor built specifically for encrypting background arguments

With these changes the `Encryption::Encryptors::SessionEncryptor` no longer has a caller. This commit removes it.

[skip changelog]
jmhooper added a commit that referenced this pull request Dec 14, 2023
In the past the IDP used the `Encryption::Encryptors::SessionEncryptor` to encrypt sessions as a whole. This tool was used by the unfortunately named `SessionEncryptor` which acts as a serializer for the session store. The `Encryption::Encryptors::SessionEncryptor` was also used for encrypting PII temporarily while it was queued for letter sending.

Two changes led to `Encryption::Encryptors::SessionEncryptor` being unused:

- #6315 enabled partial session encryption which made the session encryptor sophisticated enough that it justified its own logic for encrypting elements instead of depending on `Encryption::Encryptors::SessionEncryptor`
- #6211 replaced the `Encryption::Encryptors::SessionEncryptor` that was used for encrypting letter PII with a new encryptor built specifically for encrypting background arguments

With these changes the `Encryption::Encryptors::SessionEncryptor` no longer has a caller. This commit removes it.

[skip changelog]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants