mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 18:32:00 +00:00
Add AAD Endpoints for Data Explorer in Portal (#1943)
* Fix API endpoint for CassandraProxy query API * activate Mongo Proxy and Cassandra Proxy in Prod * Add CP Prod endpoint * Run npm format and tests * Revert code * fix bug that blocked local mongo proxy and cassandra proxy development * Add prod endpoint * fix pr check tests * Remove prod * Remove prod endpoint * Remove dev endpoint * Support data plane RBAC * Support data plane RBAC * Add additional changes for Portal RBAC functionality * Remove unnecessary code * Remove unnecessary code * Add code to fix VCoreMongo/PG bug * Address feedback * Add more logs for RBAC feature * Add more logs for RBAC features * Add AAD endpoints for all environments * Add AAD endpoints * Run npm format --------- Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
@@ -619,6 +619,31 @@ function shouldForwardMessage(message: PortalMessage, messageOrigin: string) {
|
||||
return messageOrigin === window.document.location.origin && message.type === MessageTypes.TelemetryInfo;
|
||||
}
|
||||
|
||||
function updateAADEndpoints(portalEnv: PortalEnv) {
|
||||
switch (portalEnv) {
|
||||
case "prod1":
|
||||
case "prod":
|
||||
updateConfigContext({
|
||||
AAD_ENDPOINT: Constants.AadEndpoints.Prod,
|
||||
});
|
||||
break;
|
||||
case "fairfax":
|
||||
updateConfigContext({
|
||||
AAD_ENDPOINT: Constants.AadEndpoints.Fairfax,
|
||||
});
|
||||
break;
|
||||
case "mooncake":
|
||||
updateConfigContext({
|
||||
AAD_ENDPOINT: Constants.AadEndpoints.Mooncake,
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
console.warn(`Unknown portal environment: ${portalEnv}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
|
||||
if (
|
||||
configContext.BACKEND_ENDPOINT &&
|
||||
@@ -639,6 +664,8 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
|
||||
PORTAL_BACKEND_ENDPOINT: inputs.portalBackendEndpoint,
|
||||
});
|
||||
|
||||
updateAADEndpoints(inputs.serverId as PortalEnv);
|
||||
|
||||
updateUserContext({
|
||||
authorizationToken,
|
||||
databaseAccount,
|
||||
|
||||
Reference in New Issue
Block a user