-
Notifications
You must be signed in to change notification settings - Fork 126
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
Allow encrypting access tokens in Prisma dbs #819
Allow encrypting access tokens in Prisma dbs #819
Conversation
a425cfe
to
ebf73ed
Compare
fdcc677
to
1450a59
Compare
ebf73ed
to
5689d31
Compare
1450a59
to
907f5e9
Compare
scope: sessionParams.scope || null, | ||
expires: sessionParams.expires ? new Date(sessionParams.expires) : null, | ||
accessToken: sessionParams.accessToken || '', | ||
userId: (sessionParams.onlineAccessInfo as unknown as bigint) || null, |
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.
We still want just the ID here?
sessionParams.onlineAccessInfo?.associated_user.id
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.
I think I need to rebase this onto your PR that returns the user info?
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.
You shouldn't. The current functionality should have the ID in the sessionParams.onlineAccessInfo?.associated_user.id
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.
That changed slightly because we're using the property array here instead of toObject
.
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.
aaah I missed that!
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.
You shouldn't
I think we should still be setting all of the user fields here though, right? That's why I was thinking about rebasing.
In the end, we decided not to go forward with this as developers are probably better served by using encryption at the infrastructure level for their production databases, rather than making the API more complex at the software level. |
WHY are these changes introduced?
With the ability to encrypt access tokens built into the
Session
class (#818), we should update our storage options to included that for an extra layer of security.WHAT is this pull request doing?
Adding a new parameter to
PrismaSessionStorage
to pass in an encryption key to be used to encrypt data. This doesn't require apps to migrate right away since we can update rows as they rotate, but we should still recommend apps load and store every session (or wipe their table).Type of change
Checklist
yarn changeset
to create a draft changelog entry (do NOT update theCHANGELOG.md
files manually)