Skip to content

Commit

Permalink
fix: update in jwt credentials format from downloaded project config (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron authored May 23, 2020
1 parent 245f23d commit 8dc6c75
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions schema/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@
"properties": {
"client_id": { "type": "string" },
"client_secret": { "type": "string" },
"techacct": {
"technical_account_email": {
"type": "string",
"format": "email"
},
"technical_account_id": {
"type": "string",
"format": "email"
},
Expand All @@ -178,7 +182,7 @@
"default": []
}
},
"required": [ "client_id", "client_secret", "techacct", "meta_scopes" ]
"required": [ "client_id", "client_secret", "technical_account_email", "technical_account_id", "meta_scopes" ]
}
}
}
3 changes: 2 additions & 1 deletion test/__fixtures__/config.orgid.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
AIO_$ims_ProjectB_client__id=XUXUXUXUXUXUXUX
AIO_$ims_ProjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_$ims_ProjectB_techacct=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_ProjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_ProjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_$ims_ProjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_$ims_ProjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_$ims_NewTestIntegration8_client__id=XRXRXRXRXRXRXRXRXR
Expand Down
3 changes: 2 additions & 1 deletion test/__fixtures__/config.orgid.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"jwt": {
"client_id": "XUXUXUXUXUXUXUX",
"client_secret": "XPXPXPXPXPXPXPXPX",
"techacct": "XTXTXTXTXTX@techacct.adobe.com",
"technical_account_email": "XTXTXTXTXTX@techacct.adobe.com",
"technical_account_id": "IDIDIDIDID@techacct.adobe.com",
"meta_scopes": [
"ent_smartcontent_sdk",
"ent_adobeio_sdk"
Expand Down
3 changes: 2 additions & 1 deletion test/__fixtures__/existing.merged.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ AIO_$ims_Projéct__A_redirect__uri=["https://test123"]
AIO_$ims_Projéct__A_defaultRedirectUri=https://test123
AIO_$ims_PröjectB_client__id=XUXUXUXUXUXUXUX
AIO_$ims_PröjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_$ims_PröjectB_techacct=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_PröjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_PröjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_$ims_PröjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_$ims_PröjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_$ims_New__Test__Intégration__8_client__id=XRXRXRXRXRXRXRXRXR
Expand Down
3 changes: 2 additions & 1 deletion test/__fixtures__/valid.config.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ AIO_$ims_Projéct__A_redirect__uri=["https://test123"]
AIO_$ims_Projéct__A_defaultRedirectUri=https://test123
AIO_$ims_PröjectB_client__id=XUXUXUXUXUXUXUX
AIO_$ims_PröjectB_client__secret=XPXPXPXPXPXPXPXPX
AIO_$ims_PröjectB_techacct=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_PröjectB_technical__account__email=XTXTXTXTXTX@techacct.adobe.com
AIO_$ims_PröjectB_technical__account__id=IDIDIDIDID@techacct.adobe.com
AIO_$ims_PröjectB_meta__scopes=["ent_smartcontent_sdk","ent_adobeio_sdk"]
AIO_$ims_PröjectB_ims__org__id=XOXOXOXOXOXOX@AdobeOrg
AIO_$ims_New__Test__Intégration__8_client__id=XRXRXRXRXRXRXRXRXR
Expand Down
3 changes: 2 additions & 1 deletion test/__fixtures__/valid.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"jwt": {
"client_id": "XUXUXUXUXUXUXUX",
"client_secret": "XPXPXPXPXPXPXPXPX",
"techacct": "XTXTXTXTXTX@techacct.adobe.com",
"technical_account_email": "XTXTXTXTXTX@techacct.adobe.com",
"technical_account_id": "IDIDIDIDID@techacct.adobe.com",
"meta_scopes": [
"ent_smartcontent_sdk",
"ent_adobeio_sdk"
Expand Down
4 changes: 2 additions & 2 deletions test/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('validate failure', () => {
const ajv = new Ajv({ allErrors: true })
const validate = ajv.compile(schema)
const valid = validate(fixtureJson('invalid.config.json'))
// the two errors are the missing name properties
expect(validate.errors.length).toEqual(2)
// the 4 errors are the missing name properties, and techacct migration to two new properties
expect(validate.errors.length).toEqual(4)
expect(valid).toBeFalsy()
})

0 comments on commit 8dc6c75

Please sign in to comment.