Skip to content

Commit 9026355

Browse files
committed
fix(credentials): refuse a national-cloud Microsoft app credential for Dataverse as a cloud mismatch
1 parent 5eaf4a5 commit 9026355

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/sim/lib/credentials/microsoft-app-service-account.server.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ describe('getting a Microsoft app token for a run', () => {
742742
expect(tokens[1]?.form.client_secret).toBe('rotated')
743743
})
744744

745-
it.each(['microsoft-ad', 'sharepoint', 'microsoft-intune'])(
746-
'refuses a national-cloud credential for %s, whose tools call the global Graph, without minting',
745+
it.each(['microsoft-ad', 'sharepoint', 'microsoft-intune', 'microsoft-dataverse'])(
746+
'refuses a national-cloud credential for %s, whose tools call the global cloud, without minting',
747747
async (service) => {
748748
fakeMicrosoft(fetch)
749749
storeCredential(

‎apps/sim/lib/credentials/microsoft-app-service-account.server.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ const MICROSOFT_APP_SERVICE_AUDIENCES: Record<string, MicrosoftAppAudience> = {
756756
// The environment is part of the stored secret, so one secret version has one environment.
757757
key: 'dataverse',
758758
select: (config) => {
759+
requireCloud(config, ['global'], 'Dataverse')
759760
if (!config.environmentUrl) {
760761
throw new TokenServiceAccountValidationError('invalid_credentials', 400, {
761762
step: 'microsoft_app_environment',

0 commit comments

Comments
 (0)