Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit b6b6dba

Browse files
committed
chore: bring back security blocks
1 parent b1e03fd commit b6b6dba

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/events.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,15 @@ export const onNotebookEventReceived = (
213213
* Domain matcher; we check that the message we recieved is indeed coming from a Glue Studio notebook; if it's not we drop it
214214
* do an early return.
215215
*/
216-
// NOTE: To be added back
217-
// const domainMatcher =
218-
// /^(https:\/\/)(.*\.)?(console\.amazonaws\.cn|console\.aws\.amazon\.com|console\.amazonaws-us-gov\.com|.*notebookauthproxy\.gluestudio\.a2z\.org\.cn|.*notebookauthproxy\.gluestudio\.aws\.dev)(\/.*)?$/;
219-
220-
// if (!domainMatcher.test(origin)) {
221-
// fetch(
222-
// `${origin}${jupyterConfigData.baseUrl}api/contents?unauthorizedOrigin&origin=${message.origin}`
223-
// );
224-
// return;
225-
// }
216+
const domainMatcher =
217+
/^(https:\/\/)(.*\.)?(console\.amazonaws\.cn|console\.aws\.amazon\.com|console\.amazonaws-us-gov\.com|.*notebookauthproxy\.gluestudio\.a2z\.org\.cn|.*notebookauthproxy\.gluestudio\.aws\.dev)(\/.*)?$/;
218+
219+
if (!domainMatcher.test(origin)) {
220+
fetch(
221+
`${origin}${jupyterConfigData.baseUrl}api/contents?unauthorizedOrigin&origin=${message.origin}`
222+
);
223+
return;
224+
}
226225

227226
switch (type) {
228227
/**

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ const activate = (
5757

5858
// Ensuring extension loads in an iframe within the AWS console context; otherwise do early return
5959
if (window.location === window.parent.location) {
60-
// NOTE: Te be enabled
61-
// body.innerHTML = '';
60+
body.innerHTML = '';
6261
return;
6362
}
6463

0 commit comments

Comments
 (0)