Skip to content

Commit

Permalink
Update default cluster from EU to ROW (#572)
Browse files Browse the repository at this point in the history
* update default cluster

* pass headers to email hrd call

* add a comment

---------

Co-authored-by: Arpan Kundu <[email protected]>
  • Loading branch information
ArpanKundu97 and Arpan Kundu authored Jan 8, 2025
1 parent abaf362 commit 5c147dd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/scripts/extensions/authenticationHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export class AuthenticationHelper {
if (isValidUser) {
const dataBoundaryHelper = new UserDataBoundaryHelper();
let userDataBoundary: string = await dataBoundaryHelper.getUserDataBoundary(response.data);
// The default logging has been configured to EU Pipeline. Once we find the
// userdataboundary and if it is different from EUDB , reinit the logger with WW Pipeline
if (userDataBoundary === DataBoundary[DataBoundary.GLOBAL] || userDataBoundary === DataBoundary[DataBoundary.PUBLIC]) {
// The default logging has been configured to WW Pipeline. Once we find the
// userdataboundary and if it is EUDB , reinit the logger with EU Pipeline
if (userDataBoundary === DataBoundary[DataBoundary.EMEA] || userDataBoundary === DataBoundary[DataBoundary.EUDB]) {
LogManager.reInitLoggerForDataBoundaryChange(userDataBoundary);
}
getInfoEvent.setCustomProperty(Log.PropertyName.Custom.DataBoundary, userDataBoundary);
Expand Down
21 changes: 20 additions & 1 deletion src/scripts/extensions/userDataBoundaryHelper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Clipper } from "../clipperUI/frontEndGlobals";
import { Constants } from "../constants";
import { HttpWithRetries } from "../http/httpWithRetries";
import { StringUtils } from "../stringUtils";
import { UrlUtils } from "../urlUtils";
import { UserInfoData, AuthType } from "../userInfo";
import { DataBoundary } from "./dataBoundary";
Expand Down Expand Up @@ -39,7 +40,25 @@ export class UserDataBoundaryHelper {
let domainValue = userInfo.emailAddress.substring(
userInfo.emailAddress.indexOf("@") + 1);
const urlDataBoundaryDomain: string = UrlUtils.addUrlQueryValue(Constants.Urls.userDataBoundaryDomain, Constants.Urls.QueryParams.domain, domainValue);
HttpWithRetries.get(urlDataBoundaryDomain).then((response: Response) => {
const headers = {
/**
* TODO: Update the officeApplicationNumber to the correct value
* once OneNote Web Clipper is onboarded to HRD.
*/
"X-Office-Application": undefined,
"Enlightened-Hrd-Client": "1", // To turn on the EUDB/Telemetry region
"X-Office-Platform": "Web",
"Content-Type": "application/json",
};
/**
* TODO: Revisit the correlationId generation logic if there
* is ever a need for us to actually check the Email HRD logs.
*/
const correlationId = StringUtils.generateGuid();
HttpWithRetries.get(urlDataBoundaryDomain, {
...headers,
"X-CorrelationId": correlationId,
}).then((response: Response) => {
let expectedCodes = [200];
if (expectedCodes.indexOf(response.status) > -1) {
response.text().then((responseText: string) => {
Expand Down

0 comments on commit 5c147dd

Please sign in to comment.