-
Notifications
You must be signed in to change notification settings - Fork 5
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
Sensitive Key Storage Tables #779
Comments
If our first use case is just authenticating to the google drive API, I'm not sure we even need encrypted storage. We can pretty easily authenticate requests to that API with oauth (and request offline access) to get a refresh token, which we can safely store in postgres because it has timed expiration, can be revoked by the user, and is worthless without our client secrets which we can store in an env var. I think that would be quicker to implement than encrypted storage since the google guides are easy to follow. |
where would we store the auth token in postgres? the way the drive action will currently work is that there won't be any user configurable tokens at all, we will just use a "pubpub-bot" account that users will add to documents they want to import. they give us an explicit link to a specific document (or we read it from the pub), and will only be able to access it if our bot is added to that doc. in this case, we can just read an env var no? maybe we need to temporarily write a refresh token to the file system as suggested here (https://developers.google.com/drive/api/quickstart/nodejs) but that wouldn't be that big of a problem right? |
Yes, we can use env vars for gdrive for now. But we do need some way to store the datacite credentials on a community-by-community basis. |
Any usecase you see where we would want global sensitive keys rather than always scoping them to the community? i feel for those cases we would almost always set them through env vars, although being able to change them through the ui would be convenient. |
ill suggest that the table look something like this model SensitiveData {
id String
name String
type SensitiveDataType
communityId String // maybe optional if we really need globals
encryptedCredential String // the encrypted credential
otherInfo JSON? // other info (username, datacite info) stored as a json object.
// we can then parse that based on the `type` in `core`
// eg we would know that it would contain the doi prefix if `type === DataCite`.
}
enum SensitiveDataType {
genericPassword
genericAPIToken
datacite
crossref
// other specific credentials, eg GDriveOauth
}
i think having that enum in the db makes it easy to figure out in our app what how to handle the data, similar to how we do the actions. |
Motivation
So developers can store and query sensitive keys in the production database without risk of leakage
So developers can build the datacite and google drive actions
Requirements
Acceptance Criteria
The text was updated successfully, but these errors were encountered: