mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 00:41:31 +00:00
Support data plane RBAC for E2E tests. (#2176)
* Acquire token for NoSQL account prior to running tests. * Change client id to user assigned managed identity. * Change to use managed identity. Add token variables for gremlin and tables. * Add RBAC details to test README. * Add token for SQL readonly database. Skip resource token tests when RBAC enabled. * Use hardcoded account name for sql readonly. * Use specific tag for sql readonly. * Remove comment.
This commit is contained in:
24
test/fx.ts
24
test/fx.ts
@@ -86,6 +86,30 @@ export async function getTestExplorerUrl(accountType: TestAccount, iframeSrc?: s
|
||||
// For now, since we don't test copilot, we can disable the copilot APIs by setting the feature flag to false.
|
||||
params.set("feature.enableCopilot", "false");
|
||||
|
||||
const nosqlRbacToken = process.env.NOSQL_TESTACCOUNT_TOKEN;
|
||||
if (nosqlRbacToken) {
|
||||
params.set("nosqlRbacToken", nosqlRbacToken);
|
||||
params.set("enableaaddataplane", "true");
|
||||
}
|
||||
|
||||
const nosqlReadOnlyRbacToken = process.env.NOSQL_READONLY_TESTACCOUNT_TOKEN;
|
||||
if (nosqlReadOnlyRbacToken) {
|
||||
params.set("nosqlReadOnlyRbacToken", nosqlReadOnlyRbacToken);
|
||||
params.set("enableaaddataplane", "true");
|
||||
}
|
||||
|
||||
const tableRbacToken = process.env.TABLE_TESTACCOUNT_TOKEN;
|
||||
if (tableRbacToken) {
|
||||
params.set("tableRbacToken", tableRbacToken);
|
||||
params.set("enableaaddataplane", "true");
|
||||
}
|
||||
|
||||
const gremlinRbacToken = process.env.GREMLIN_TESTACCOUNT_TOKEN;
|
||||
if (gremlinRbacToken) {
|
||||
params.set("gremlinRbacToken", gremlinRbacToken);
|
||||
params.set("enableaaddataplane", "true");
|
||||
}
|
||||
|
||||
if (iframeSrc) {
|
||||
params.set("iframeSrc", iframeSrc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user