Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Parse all directives, and merge/replace them #7

Closed
xbc5 opened this issue Apr 18, 2022 · 1 comment
Closed

Parse all directives, and merge/replace them #7

xbc5 opened this issue Apr 18, 2022 · 1 comment
Labels
feat New feature or request

Comments

@xbc5
Copy link
Owner

xbc5 commented Apr 18, 2022

This relates to #6.

The default is merge -- always.

Front-matter takes precedence, then URI specific directives, then the default directives.

First, merge/replace the production environment, then merge/replace with development environment. These respect the env mode and individual frontmatter/URI modes.

csp:
  mode:
    env: merge
  prod:
    directives:
      foo/index.html
      mode: replace

This is frontmatter, it replaces the layer below it.

---
csp:
  mode: replace
---

Examples:

If front-matter specifies replace, then that is the final form. If that's then merged with development environment, then it's a mix of the two.

If front-matter is merge and URI is replace, then the final form is front matter + URI (replacing default).

@xbc5 xbc5 added the feat New feature or request label Apr 18, 2022
@xbc5 xbc5 closed this as completed in 4d2c6f5 Apr 20, 2022
@xbc5 xbc5 reopened this Apr 20, 2022
@xbc5
Copy link
Owner Author

xbc5 commented Apr 20, 2022

Replace is not fully implemented. Re-opening.

@xbc5 xbc5 closed this as completed in 64fb4e2 Apr 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant