-
Notifications
You must be signed in to change notification settings - Fork 238
feat(compass-web): add the AtlasUserData class to save user data COMPASS-9565 #7152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 42 commits
e04e887
6e7876b
b28596b
669f626
c00749f
c41114e
10b0bc1
d22cebc
eb9c0c2
b3612a7
0e9d6dc
6a3f59d
4c6bb7c
817d4c5
f0db6d0
d18cd15
6161d84
6bd8634
e397192
e9850ba
d678af0
dd868db
ed227d6
2c69698
2020afa
ae63fac
194430d
8c8519f
ad739f5
1986cca
663f992
7809ed8
d99d1b1
f1c3ac1
834454f
953fa73
0c38299
fc98fd8
18c3f4a
f57e87c
860bbae
110ee91
3176131
412c700
08c9f20
765c77e
6bc78e2
c406f40
7b79c0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -78,6 +78,11 @@ export class AtlasService { | |||||||
// https://github.com/10gen/mms/blob/9f858bb987aac6aa80acfb86492dd74c89cbb862/client/packages/project/common/ajaxPrefilter.ts#L34-L49 | ||||||||
return this.cloudEndpoint(path); | ||||||||
} | ||||||||
userDataEndpoint(path?: string): string { | ||||||||
return `https://cluster-connection.cloud-dev.mongodb.com/userData${normalizePath( | ||||||||
path | ||||||||
)}`; | ||||||||
} | ||||||||
driverProxyEndpoint(path?: string): string { | ||||||||
return `${this.config.ccsBaseUrl}${normalizePath(path)}`; | ||||||||
} | ||||||||
|
@@ -91,13 +96,14 @@ export class AtlasService { | |||||||
{ url } | ||||||||
); | ||||||||
try { | ||||||||
const headers = { | ||||||||
...this.options?.defaultHeaders, | ||||||||
...(shouldAddCSRFHeaders(init?.method) && getCSRFHeaders()), | ||||||||
...init?.headers, | ||||||||
}; | ||||||||
const res = await fetch(url, { | ||||||||
...init, | ||||||||
headers: { | ||||||||
...this.options?.defaultHeaders, | ||||||||
...(shouldAddCSRFHeaders(init?.method) && getCSRFHeaders()), | ||||||||
...init?.headers, | ||||||||
}, | ||||||||
headers, | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Hard to leave a comment about this in more relevant place) Because we now doing cross origin authenticated requests through AtlasService, we need to allow fetch to include cookies in the request when possible. This is how you do it:
Suggested change
But we should probably do this only for authenticatedFetch below |
||||||||
}); | ||||||||
this.logger.log.info( | ||||||||
this.logger.mongoLogId(1_001_000_309), | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be coming from the config property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I was going to do this in a followup PR for this ticket: https://jira.mongodb.org/browse/COMPASS-9663
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super small nit for the future, if you already have a TODO like that in mind, it's super helpful to add it in the code to clarify that something is out of scope for the particular change being up for review 🙂