Skip to content

Commit

Permalink
chore: update to Cedar 2.4.2 (#7)
Browse files Browse the repository at this point in the history
Co-authored-by: Craig Disselkoen <cdiss@amazon.com>
  • Loading branch information
hakanson and cdisselkoen authored Dec 19, 2023
1 parent 14720b4 commit 9c7048b
Show file tree
Hide file tree
Showing 30 changed files with 2,250 additions and 630 deletions.
4 changes: 4 additions & 0 deletions .vscode-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// https://code.visualstudio.com/api/working-with-extensions/testing-extension
const { defineConfig } = require('@vscode/test-cli');

module.exports = defineConfig({ files: 'out/test/**/*.test.js' });
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"editor.formatOnType": true,
// tell the ESLint plugin to run on save
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
},
"cSpell.words": ["cedarentities", "cedarlanguage", "cedarschema", "vsix"],
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.5.4 (Preview) 2023-12-18

- Update to Cedar 2.4.2
- Add JSON export of Cedar policies
- Require Visual Studio Code version [1.82](https://code.visualstudio.com/updates/v1_82) or later

## v0.5.3 (Preview) 2023-10-16

- Update to Cedar 2.4.1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:18
RUN apt-get -y update
RUN apt-get -y install --fix-missing xvfb
RUN apt-get -y install libnss3 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev libasound2
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,26 @@ Cedar is a language for writing authorization policies and making authorization

### Cedar policy language

Files matching `*.cedar` are detected as a Cedar policy language and receive syntax highlighting. Validation is performed on document open, document save, during formatting, and via context menu. Formatting can disabled per file using a leading comment line of `// @formatter:off`. Policy navigation using Outline or Breadcrumb.
Files matching `*.cedar` are detected as a Cedar policy language and receive syntax highlighting. Validation is performed on document open, document save, during formatting, and via context menu. Formatting can disabled per file using a leading comment line of `// @formatter:off`. Policy navigation using Outline or Breadcrumb. "Go to Definition" on Cedar entity types and action names. Policies exportable to their JSON representation.

![Cedar policy validation and navigation](https://raw.githubusercontent.com/cedar-policy/vscode-cedar/main/docs/marketplace/cedar_policy.gif)

### Cedar schema

Files named `cedarschema.json` or matching `*.cedarschema.json` are detected as a Cedar schema and receive additional syntax highlighting. Validation is performed on document open, document save, and via context menu. When a Cedar schema file is detected or configured in [Settings](#settings), additional validation of Cedar files uses that schema. Entity type navigation using Outline or Breadcrumb.
Files named `cedarschema.json` or matching `*.cedarschema.json` are detected as a Cedar schema and receive additional syntax highlighting. Validation is performed on document open, document save, and via context menu. When a Cedar schema file is detected or configured in [Settings](#settings), additional validation of Cedar files uses that schema. Entity type navigation using Outline or Breadcrumb. "Go to Definition" on Cedar entity types and action names.

![Cedar schema validation and navigation](https://raw.githubusercontent.com/cedar-policy/vscode-cedar/main/docs/marketplace/cedar_schema.gif)

### Cedar entities

Files named `cedarentities.json` or matching `*.cedarentities.json` are detected as Cedar entities and receive additional syntax highlighting. Validation is performed against a Cedar schema on document open, document save, and via context menu. Entity navigation using Outline or Breadcrumb.
Files named `cedarentities.json` or matching `*.cedarentities.json` are detected as Cedar entities and receive additional syntax highlighting. Validation is performed against a Cedar schema on document open, document save, and via context menu. Entity navigation using Outline or Breadcrumb. "Go to Definition" on Cedar entity types.

![Cedar entities validation and navigation](https://raw.githubusercontent.com/cedar-policy/vscode-cedar/main/docs/marketplace/cedar_entities.gif)

### Cedar CLI

Various commands of the `cedar` CLI take JSON formatted file inputs. Files named `cedarauth.json` or matching `*.cedarauth.json` are detected as input to the `--request-json` option for the `authorize` command. Files named `cedartemplatelinks.json` or matching `*.cedartemplatelinks.json` are detected as input to the `--template-linked` option for the `authorize` command. These files receive additional syntax highlighting.

### Markdown

Syntax highlighting of `cedar` code fence blocks within markdown (`*.md`) files.
Expand Down
6 changes: 3 additions & 3 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Then run the `package` command to create the .vsix file.
npm run package
```

### Docker
### Container Testing

To build and run tests in a clean environment, first build the container, then open a bash shell in the container.
To build and run tests in a clean environment, first build the container, then open a bash shell in the container. The CLI commands below use `docker`, but are compatible with the [`Finch`](https://github.com/runfinch/finch) open source client for container development.

```bash
docker build . -t cedar-policy/vscode-cedar
Expand All @@ -93,7 +93,7 @@ Then build and test the extension inside the container. This will take several
This extension can locally be installed to `~/.vscode/extensions` using the command palette and selecting **Extensions: Install from VSIX...** or running the following [Visual Studio Code command-line interface](https://code.visualstudio.com/docs/editor/command-line) command (see link if `code` is not in your PATH):

```bash
code --install-extension vscode-cedar-0.5.3.vsix
code --install-extension vscode-cedar-0.5.4.vsix
```

Note: Preview install may see a `[DEP0005] DeprecationWarning` tracked in GitHub issue [install-extension command throws Buffer deprecated warning #82524](https://github.com/microsoft/vscode/issues/82524)
Loading

0 comments on commit 9c7048b

Please sign in to comment.