csp.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. define(["require", "exports"], function (require, exports) {
  6. 'use strict';
  7. Object.defineProperty(exports, "__esModule", { value: true });
  8. exports.conf = {
  9. brackets: [],
  10. autoClosingPairs: [],
  11. surroundingPairs: []
  12. };
  13. exports.language = {
  14. // Set defaultToken to invalid to see what you do not tokenize yet
  15. // defaultToken: 'invalid',
  16. keywords: [],
  17. typeKeywords: [],
  18. tokenPostfix: '.csp',
  19. operators: [],
  20. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  21. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  22. tokenizer: {
  23. root: [
  24. [/child-src/, 'string.quote'],
  25. [/connect-src/, 'string.quote'],
  26. [/default-src/, 'string.quote'],
  27. [/font-src/, 'string.quote'],
  28. [/frame-src/, 'string.quote'],
  29. [/img-src/, 'string.quote'],
  30. [/manifest-src/, 'string.quote'],
  31. [/media-src/, 'string.quote'],
  32. [/object-src/, 'string.quote'],
  33. [/script-src/, 'string.quote'],
  34. [/style-src/, 'string.quote'],
  35. [/worker-src/, 'string.quote'],
  36. [/base-uri/, 'string.quote'],
  37. [/plugin-types/, 'string.quote'],
  38. [/sandbox/, 'string.quote'],
  39. [/disown-opener/, 'string.quote'],
  40. [/form-action/, 'string.quote'],
  41. [/frame-ancestors/, 'string.quote'],
  42. [/report-uri/, 'string.quote'],
  43. [/report-to/, 'string.quote'],
  44. [/upgrade-insecure-requests/, 'string.quote'],
  45. [/block-all-mixed-content/, 'string.quote'],
  46. [/require-sri-for/, 'string.quote'],
  47. [/reflected-xss/, 'string.quote'],
  48. [/referrer/, 'string.quote'],
  49. [/policy-uri/, 'string.quote'],
  50. [/'self'/, 'string.quote'],
  51. [/'unsafe-inline'/, 'string.quote'],
  52. [/'unsafe-eval'/, 'string.quote'],
  53. [/'strict-dynamic'/, 'string.quote'],
  54. [/'unsafe-hashed-attributes'/, 'string.quote']
  55. ]
  56. }
  57. };
  58. });