csp.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. export var conf = {
  6. brackets: [],
  7. autoClosingPairs: [],
  8. surroundingPairs: []
  9. };
  10. export var language = {
  11. // Set defaultToken to invalid to see what you do not tokenize yet
  12. // defaultToken: 'invalid',
  13. keywords: [],
  14. typeKeywords: [],
  15. tokenPostfix: '.csp',
  16. operators: [],
  17. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  18. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  19. tokenizer: {
  20. root: [
  21. [/child-src/, 'string.quote'],
  22. [/connect-src/, 'string.quote'],
  23. [/default-src/, 'string.quote'],
  24. [/font-src/, 'string.quote'],
  25. [/frame-src/, 'string.quote'],
  26. [/img-src/, 'string.quote'],
  27. [/manifest-src/, 'string.quote'],
  28. [/media-src/, 'string.quote'],
  29. [/object-src/, 'string.quote'],
  30. [/script-src/, 'string.quote'],
  31. [/style-src/, 'string.quote'],
  32. [/worker-src/, 'string.quote'],
  33. [/base-uri/, 'string.quote'],
  34. [/plugin-types/, 'string.quote'],
  35. [/sandbox/, 'string.quote'],
  36. [/disown-opener/, 'string.quote'],
  37. [/form-action/, 'string.quote'],
  38. [/frame-ancestors/, 'string.quote'],
  39. [/report-uri/, 'string.quote'],
  40. [/report-to/, 'string.quote'],
  41. [/upgrade-insecure-requests/, 'string.quote'],
  42. [/block-all-mixed-content/, 'string.quote'],
  43. [/require-sri-for/, 'string.quote'],
  44. [/reflected-xss/, 'string.quote'],
  45. [/referrer/, 'string.quote'],
  46. [/policy-uri/, 'string.quote'],
  47. [/'self'/, 'string.quote'],
  48. [/'unsafe-inline'/, 'string.quote'],
  49. [/'unsafe-eval'/, 'string.quote'],
  50. [/'strict-dynamic'/, 'string.quote'],
  51. [/'unsafe-hashed-attributes'/, 'string.quote']
  52. ]
  53. }
  54. };