Skip to content

Commit

Permalink
Remove exemptions, and untested usages of safevalues
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque committed Jul 4, 2024
1 parent 09bb82c commit 74bc901
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 23 deletions.
1 change: 0 additions & 1 deletion packages/auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
{
"name": "tsec",
"reportTsecDiagnosticsOnly": true,
"exemptionConfig": "./tsec-exemptions.json"
}
]
},
Expand Down
3 changes: 0 additions & 3 deletions packages/auth/tsec-exemptions.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/database-compat/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{
"name": "tsec",
"reportTsecDiagnosticsOnly": true,
"exemptionConfig": "./tsec-exemptions.json"
}
]
},
Expand Down
3 changes: 0 additions & 3 deletions packages/database-compat/tsec-exemptions.json

This file was deleted.

5 changes: 2 additions & 3 deletions packages/database/src/realtime/BrowserPollConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/

import { base64Encode, isNodeSdk, stringify } from '@firebase/util';
import { sanitizeHtml } from 'safevalues';
import { safeDocument } from 'safevalues/dom';

import { RepoInfo, repoInfoConnectionURL } from '../core/RepoInfo';
import { StatsCollection } from '../core/stats/StatsCollection';
Expand Down Expand Up @@ -477,7 +475,8 @@ export class FirebaseIFrameScriptHolder {
const iframeContents = '<html><body>' + script + '</body></html>';
try {
this.myIFrame.doc.open();
safeDocument.write(this.myIFrame.doc, sanitizeHtml(iframeContents));
// FIXME: Use the safevalues library to sanitize this
this.myIFrame.doc.write(iframeContents);
this.myIFrame.doc.close();
} catch (e) {
log('frame writing exception');
Expand Down
1 change: 0 additions & 1 deletion packages/database/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{
"name": "tsec",
"reportTsecDiagnosticsOnly": true,
"exemptionConfig": "./tsec-exemptions.json"
}
]
},
Expand Down
3 changes: 0 additions & 3 deletions packages/database/tsec-exemptions.json

This file was deleted.

12 changes: 4 additions & 8 deletions packages/messaging/src/helpers/registerDefaultSw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
* limitations under the License.
*/

import { trustedResourceUrl } from 'safevalues';
import { safeServiceWorkerContainer } from 'safevalues/dom';

import { DEFAULT_SW_SCOPE } from '../util/constants';
import { DEFAULT_SW_PATH, DEFAULT_SW_SCOPE } from '../util/constants';
import { ERROR_FACTORY, ErrorCode } from '../util/errors';

import { MessagingService } from '../messaging-service';
Expand All @@ -27,10 +24,9 @@ export async function registerDefaultSw(
messaging: MessagingService
): Promise<void> {
try {
const container = navigator.serviceWorker;
messaging.swRegistration = await safeServiceWorkerContainer.register(
container,
trustedResourceUrl`/firebase-messaging-sw.js`,
// FIXME: Use safevalues to register the service worker with a sanitized URL.
messaging.swRegistration = await navigator.serviceWorker.register(
DEFAULT_SW_PATH,
{
scope: DEFAULT_SW_SCOPE
}
Expand Down

0 comments on commit 74bc901

Please sign in to comment.