-
Notifications
You must be signed in to change notification settings - Fork 193
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
ARC-964 create githubapps table #1185
Conversation
}, | ||
secrets: { | ||
allowNull: false, | ||
type: Sequelize.BLOB |
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.
githubClientSecret, webhookSecret and privateKey will be stored in secrets vault.
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.
What do you mean with "secrets vault"? Does that mean they will be stored in this secrets
blob, but encrypted?
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.
Blob is non-encrypted. DB is encrypted at rest. We need to be careful how we name things since we have Github Client Secret and Github Webhook Secret. We also need to go over how we'll be listening to webhooks for each github enterprise instance as we need listening code for each one or have a way to decipher every event by iterating through all github instances to see which webhook secret will work with the event, which I'm not sure if actually scalable.
We need to brainstorm some solutions for this.
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 need to store githubClientSecret, webhookSecret and privateKey as encrypted values. The idea here is to put all these values in a secure vault. The vault will be stored as blob in secrets column. The same pattern is being used in installations table with sequelize-encrypted library.
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.
ah right, didn't know that was the idea without he model being set
Don't we want to include the model as part of this? Also, how are we adding the current staging/prod apps to this DB? |
githubApiBaseUrl: { | ||
allowNull: false, | ||
type: Sequelize.STRING | ||
}, |
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 don't think we need this as we can figure out the API url based on if it's a ghe instance or not
githubServerType: { | ||
allowNull: false, | ||
type: Sequelize.ENUM("cloud", "ghe") | ||
|
||
}, |
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 only have 2 choices, we could just make this a boolean
src/models/git-hub-server-app.ts
Outdated
uuid: { | ||
type: DataTypes.STRING, | ||
unique: true | ||
}, |
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 believe that sequelize has a UUID datatype and can create a default value on model creation. Also, you need to set the allowNull: false
here.
uuid: {
type: DataTypes.UUID,
defaultValue: Sequelize.UUIDV4,
unique: true,
allowNull: false
}
…an/github-for-jira into ARC-964-githubapps-table
No description provided.