Skip to content

Commit f46cfa4

Browse files
authored
add default ledger api audience to all m2m apps (#2691)
Signed-off-by: Itai Segall <itai.segall@digitalasset.com>
1 parent 265fc1a commit f46cfa4

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

cluster/expected/infra/expected.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3381,6 +3381,20 @@
33813381
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
33823382
"type": "auth0:index/clientGrant:ClientGrant"
33833383
},
3384+
{
3385+
"custom": true,
3386+
"id": "",
3387+
"inputs": {
3388+
"audience": "https://canton.network.global",
3389+
"clientId": "SV1 SV Backend (Pulumi managed, test-stack)_id",
3390+
"scopes": [
3391+
"daml_ledger_api"
3392+
]
3393+
},
3394+
"name": "sv1SvBackendAppLedgerGrant",
3395+
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
3396+
"type": "auth0:index/clientGrant:ClientGrant"
3397+
},
33843398
{
33853399
"custom": true,
33863400
"id": "",
@@ -3475,6 +3489,20 @@
34753489
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
34763490
"type": "auth0:index/clientGrant:ClientGrant"
34773491
},
3492+
{
3493+
"custom": true,
3494+
"id": "",
3495+
"inputs": {
3496+
"audience": "https://canton.network.global",
3497+
"clientId": "SV1 Validator Backend (Pulumi managed, test-stack)_id",
3498+
"scopes": [
3499+
"daml_ledger_api"
3500+
]
3501+
},
3502+
"name": "sv1ValidatorBackendAppLedgerGrant",
3503+
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
3504+
"type": "auth0:index/clientGrant:ClientGrant"
3505+
},
34783506
{
34793507
"custom": true,
34803508
"id": "",
@@ -3513,6 +3541,20 @@
35133541
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
35143542
"type": "auth0:index/clientGrant:ClientGrant"
35153543
},
3544+
{
3545+
"custom": true,
3546+
"id": "",
3547+
"inputs": {
3548+
"audience": "https://canton.network.global",
3549+
"clientId": "SVDA1 SV Backend (Pulumi managed, test-stack)_id",
3550+
"scopes": [
3551+
"daml_ledger_api"
3552+
]
3553+
},
3554+
"name": "svda1SvBackendAppLedgerGrant",
3555+
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
3556+
"type": "auth0:index/clientGrant:ClientGrant"
3557+
},
35163558
{
35173559
"custom": true,
35183560
"id": "",
@@ -3607,6 +3649,20 @@
36073649
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
36083650
"type": "auth0:index/clientGrant:ClientGrant"
36093651
},
3652+
{
3653+
"custom": true,
3654+
"id": "",
3655+
"inputs": {
3656+
"audience": "https://canton.network.global",
3657+
"clientId": "SVDA1 Validator Backend (Pulumi managed, test-stack)_id",
3658+
"scopes": [
3659+
"daml_ledger_api"
3660+
]
3661+
},
3662+
"name": "svda1ValidatorBackendAppLedgerGrant",
3663+
"provider": "urn:pulumi:test-stack::test-project::pulumi:providers:auth0::dev::undefined_id",
3664+
"type": "auth0:index/clientGrant:ClientGrant"
3665+
},
36103666
{
36113667
"custom": true,
36123668
"id": "",

cluster/pulumi/infra/src/auth0.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,22 @@ function newM2MApp(
137137
}
138138
);
139139

140+
if (ledgerApiAudValue !== 'https://canton.network.global') {
141+
// TODO(DACH-NY/canton-network-internal#2206): For now, we also grant all apps access to the old default ledger API
142+
// audience, to un-break it until we clean up the audiences we use.
143+
new auth0.ClientGrant(
144+
`${resourceName}LedgerGrant`,
145+
{
146+
clientId: ret.id,
147+
audience: 'https://canton.network.global',
148+
scopes: ['daml_ledger_api'],
149+
},
150+
{
151+
provider: auth0DomainProvider,
152+
}
153+
);
154+
}
155+
140156
if (ledgerApiAudValue !== appAudValue) {
141157
new auth0.ClientGrant(
142158
`${resourceName}AppGrant`,

0 commit comments

Comments
 (0)