Added settings keys to store OAuth related data (#12879)

refs https://github.com/TryGhost/Team/issues/618

- The `oauth_client_id` and `oauth_client_secret` are placeholders to store OAuths related data.
- The flag for `oauth_enabled` or anything along those lines was not added intentionally in favour of checking if the `oauth_client_id` & `oauth_client_secret` are null.
This commit is contained in:
naz 2021-04-16 20:02:21 +12:00 committed by GitHub
parent 8fbcf26d08
commit d964224312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 29 additions and 8 deletions

View File

@ -12,7 +12,8 @@ const groupTypeMapping = {
portal: 'portal',
email: 'bulk_email',
newsletter: 'newsletter',
firstpromoter: 'firstpromoter'
firstpromoter: 'firstpromoter',
oauth: 'oauth'
};
const mapGroupToType = (group) => {

View File

@ -12,7 +12,8 @@ const groupTypeMapping = {
portal: 'portal',
email: 'bulk_email',
newsletter: 'newsletter',
firstpromoter: 'firstpromoter'
firstpromoter: 'firstpromoter',
oauth: 'oauth'
};
const mapGroupToType = (group) => {

View File

@ -12,7 +12,8 @@ const groupTypeMapping = {
portal: 'portal',
email: 'bulk_email',
newsletter: 'newsletter',
firstpromoter: 'firstpromoter'
firstpromoter: 'firstpromoter',
oauth: 'oauth'
};
const mapGroupToType = (group) => {

View File

@ -69,7 +69,9 @@ const SETTING_KEYS_BLOCKLIST = [
'stripe_secret_key',
'stripe_publishable_key',
'members_stripe_webhook_id',
'members_stripe_webhook_secret'
'members_stripe_webhook_secret',
'oauth_client_id',
'oauth_client_secret'
];
const modelOptions = {context: {internal: true}};

View File

@ -467,5 +467,15 @@
"defaultValue": "",
"type": "string"
}
},
"oauth": {
"oauth_client_id" : {
"defaultValue": null,
"type": "string"
},
"oauth_client_secret" : {
"defaultValue": null,
"type": "string"
}
}
}

View File

@ -77,7 +77,9 @@ const defaultSettingsKeyTypes = [
{key: 'newsletter_body_font_category', type: 'newsletter'},
{key: 'newsletter_footer_content', type: 'newsletter'},
{key: 'firstpromoter', type: 'firstpromoter'},
{key: 'firstpromoter_id', type: 'firstpromoter'}
{key: 'firstpromoter_id', type: 'firstpromoter'},
{key: 'oauth_client_id', type: 'oauth'},
{key: 'oauth_client_secret', type: 'oauth'}
];
describe('Settings API (canary)', function () {

View File

@ -71,7 +71,9 @@ const defaultSettingsKeyTypes = [
{key: 'newsletter_footer_content', type: 'newsletter'},
{key: 'newsletter_body_font_category', type: 'newsletter'},
{key: 'firstpromoter', type: 'firstpromoter'},
{key: 'firstpromoter_id', type: 'firstpromoter'}
{key: 'firstpromoter_id', type: 'firstpromoter'},
{key: 'oauth_client_id', type: 'oauth'},
{key: 'oauth_client_secret', type: 'oauth'}
];
describe('Settings API (v2)', function () {

View File

@ -75,7 +75,9 @@ const defaultSettingsKeyTypes = [
{key: 'newsletter_body_font_category', type: 'newsletter'},
{key: 'newsletter_footer_content', type: 'newsletter'},
{key: 'firstpromoter', type: 'firstpromoter'},
{key: 'firstpromoter_id', type: 'firstpromoter'}
{key: 'firstpromoter_id', type: 'firstpromoter'},
{key: 'oauth_client_id', type: 'oauth'},
{key: 'oauth_client_secret', type: 'oauth'}
];
describe('Settings API (v3)', function () {

View File

@ -34,7 +34,7 @@ describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '19f3f2750320798dac398be2eb51d3e5';
const currentFixturesHash = '3dc9747eadecec34958dfba14c5332db';
const currentSettingsHash = '7ac732b994a5bb1565f88c8a84872964';
const currentSettingsHash = 'b7c859988a6195db8daf8cfa8a65b171';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
// If this test is failing, then it is likely a change has been made that requires a DB version bump,