Skip to content
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

Removed $IMA.$Path without any replacements since it imposed security riscs #605

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/short-rules-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ima/react-page-renderer": major
"@ima/server": major
"@ima/core": major
---

Removed $IMA.$Path without any replacements since it imposed security riscs
2 changes: 0 additions & 2 deletions packages/core/src/Bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export type BootSettings = Pick<
| '$Protocol'
| '$Language'
| '$Host'
| '$Path'
| '$Root'
| '$LanguagePartPath'
>;
Expand All @@ -102,7 +101,6 @@ export interface BootServices {
router: {
$Protocol: GlobalImaObject['$Protocol'];
$Host: GlobalImaObject['$Host'];
$Path: GlobalImaObject['$Path'];
$Root: GlobalImaObject['$Root'];
$LanguagePartPath: GlobalImaObject['$LanguagePartPath'];
};
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ export function getClientBootConfig(
router: {
$Protocol: $IMA.$Protocol,
$Host: $IMA.$Host,
$Path: $IMA.$Path,
$Root: $IMA.$Root,
$LanguagePartPath: $IMA.$LanguagePartPath,
},
Expand All @@ -237,7 +236,6 @@ export function getClientBootConfig(
$Protocol: $IMA.$Protocol,
$Language: $IMA.$Language,
$Host: $IMA.$Host,
$Path: $IMA.$Path,
$Root: $IMA.$Root,
$LanguagePartPath: $IMA.$LanguagePartPath,
},
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export interface GlobalImaObject {
$Debug: boolean;
$Protocol: 'http:' | 'https:';
$Host: string;
$Path: string;
$Root: string;
$LanguagePartPath: string;
Runner: object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const settings = {
$Host: undefined,
$Language: undefined,
$LanguagePartPath: undefined,
$Path: undefined,
$Page: {
$Render: {
documentView: DocumentView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const settings = {
$Host: undefined,
$Language: undefined,
$LanguagePartPath: undefined,
$Path: undefined,
$Page: {
$Render: {
documentView: DocumentView,
Expand Down
12 changes: 1 addition & 11 deletions packages/server/lib/factory/IMAInternalFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,13 @@ module.exports = function IMAInternalFactory({
}

const dummyApp = serverGlobal.get(GLOBAL.DUMMY_APP);
const {
protocol,
host,
path: urlPath,
root,
languagePartPath,
} = res.locals;
const { protocol, host, root, languagePartPath } = res.locals;

dummyApp.oc.get('$Request').init(req);
dummyApp.oc.get('$Response').init(res);
dummyApp.oc.get('$Router').init({
$Protocol: protocol,
$Host: host,
$Path: urlPath,
$Root: root,
$LanguagePartPath: languagePartPath,
});
Expand Down Expand Up @@ -177,7 +170,6 @@ module.exports = function IMAInternalFactory({
let languagePartPath = res.locals.languagePartPath;
let host = res.locals.host;
let root = res.locals.root;
let urlPath = res.locals.path;
let protocol = res.locals.protocol;

let dictionary = language ? languageLoader(language) : {};
Expand All @@ -194,7 +186,6 @@ module.exports = function IMAInternalFactory({
router: {
$Protocol: protocol,
$Host: host,
$Path: urlPath,
$Root: root,
$LanguagePartPath: languagePartPath,
},
Expand All @@ -208,7 +199,6 @@ module.exports = function IMAInternalFactory({
$Protocol: protocol,
$Language: language,
$Host: host,
$Path: urlPath,
$Root: root,
$LanguagePartPath: languagePartPath,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ exports[`responseUtilsFactory createContentVariables should generate base set of
$IMA.$App = undefined;
$IMA.$Protocol = "undefined";
$IMA.$Host = "undefined";
$IMA.$Path = "undefined";
$IMA.$Root = "undefined";
$IMA.$LanguagePartPath = "undefined";
})(typeof window !== 'undefined' && window !== null ? window : global);
Expand All @@ -431,7 +430,6 @@ exports[`responseUtilsFactory processContent should allow overrides through cust
$IMA.$App = undefined;
$IMA.$Protocol = "undefined";
$IMA.$Host = "undefined";
$IMA.$Path = "undefined";
$IMA.$Root = "undefined";
$IMA.$LanguagePartPath = "undefined";
})(typeof window !== 'undefined' && window !== null ? window : global);
Expand All @@ -452,7 +450,6 @@ exports[`responseUtilsFactory processContent should interpolate revival scripts
$IMA.$App = undefined;
$IMA.$Protocol = "undefined";
$IMA.$Host = "undefined";
$IMA.$Path = "undefined";
$IMA.$Root = "undefined";
$IMA.$LanguagePartPath = "undefined";
})(typeof window !== 'undefined' && window !== null ? window : global);
Expand Down
1 change: 0 additions & 1 deletion packages/server/lib/factory/responseUtilsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ module.exports = function responseUtilsFactory({ applicationFolder }) {
settings.$Protocol && encodeHTMLEntities(settings.$Protocol)
}";
$IMA.$Host = "${settings.$Host && encodeHTMLEntities(settings.$Host)}";
$IMA.$Path = "${settings.$Path && encodeHTMLEntities(settings.$Path)}";
$IMA.$Root = "${settings.$Root && encodeHTMLEntities(settings.$Root)}";
$IMA.$LanguagePartPath = "${
settings.$LanguagePartPath &&
Expand Down
Loading