Skip to content

Commit 31c7719

Browse files
authored
feat: update to Cedar SDK 4.7.0 (#40)
Signed-off-by: Kevin Hakanson <kevhak@amazon.com> Signed-off-by: Sarah Cecchetti <sarahcec@amazon.com> Signed-off-by: John Kastner <jkastner@amazon.com>
1 parent d4f4a79 commit 31c7719

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+6224
-2853
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ node_modules
44
.vscode-test/
55
*.vsix
66
vscode-cedar-wasm/target
7+
tsconfig.tsbuildinfo
78
Dockerfile

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/build_and_test.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Build and Test
2+
permissions:
3+
contents: read
24

35
on:
46
push:
@@ -15,21 +17,27 @@ jobs:
1517
- name: Check out repository code
1618
uses: actions/checkout@v4
1719

18-
- name: Install Node 18
20+
- name: Install Node 20
1921
uses: actions/setup-node@v4
2022
with:
21-
node-version: '18'
23+
node-version: '20'
2224
cache: 'npm'
2325

2426
- name: Install XVFB for testing with VS Code
2527
run: |
2628
sudo apt-get -y update
2729
sudo apt-get -y install --fix-missing xvfb
2830
31+
- name: Cache wasm-pack binary
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.cargo/bin/wasm-pack
35+
key: wasm-pack-${{ runner.os }}-v0.13.1
36+
2937
- name: Update rust and install wasm-pack
3038
run: |
3139
rustup update stable && rustup default stable
32-
npm install -g wasm-pack
40+
which wasm-pack || cargo install wasm-pack --version 0.13.1
3341
3442
- name: Cache cargo build artifacts
3543
# https://doc.rust-lang.org/cargo/guide/build-cache.html

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ dist
33
node_modules
44
.vscode-test/
55
*.vsix
6-
vscode-cedar-wasm/target
6+
vscode-cedar-wasm/target
7+
tsconfig.tsbuildinfo
8+
.idea

.vscode-test.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
// https://code.visualstudio.com/api/working-with-extensions/testing-extension
22
const { defineConfig } = require('@vscode/test-cli');
33

4-
module.exports = defineConfig({ files: 'out/test/**/*.test.js' });
4+
module.exports = defineConfig({
5+
files: 'out/test/**/*.test.js',
6+
// --disable-gpu prevents the following error
7+
// ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
8+
launchArgs: [
9+
'--disable-gpu',
10+
'--no-sandbox',
11+
'--disable-extensions',
12+
'--disable-dev-shm-usage',
13+
'--disable-workspace-trust',
14+
'--skip-release-notes',
15+
'--disable-telemetry',
16+
'--disable-updates'
17+
],
18+
env: {
19+
SHELL: '/bin/bash',
20+
VSCODE_SKIP_PRELAUNCH: 'true'
21+
},
22+
settings: {
23+
'terminal.integrated.inheritEnv': false
24+
}
25+
});

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"explorer.fileNesting.expand": false,
2727
"explorer.fileNesting.patterns": {
2828
"package.json": "package-lock.json",
29-
"tsconfig.json": ".eslint*, .prettier*"
29+
"tsconfig.json": "tsconfig.tsbuildinfo, eslint.*, .prettier*",
30+
"Dockerfile": ".dockerignore"
3031
},
3132
"terminal.integrated.env.osx": {
3233
"PATH": "/usr/local/opt/llvm/bin/:$PATH",

.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea/**
12
.vscode/**
23
.vscode-test/**
34
.vscode-test.js
@@ -6,13 +7,16 @@ src/**
67
.yarnrc
78
vsc-extension-quickstart.md
89
**/tsconfig.json
10+
tsconfig.tsbuildinfo
911
**/.eslintrc.json
12+
eslint.config.mjs
1013
**/*.map
1114
**/*.ts
1215
*.tgz
1316
vscode-cedar-wasm/**
1417
development.md
1518
testdata/**
19+
out/test/**
1620
Dockerfile
1721
.dockerignore
1822
.prettierignore

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## v0.10.0 (Preview) 2025-11-12
2+
3+
- Update to Cedar SDK 4.7.0
4+
- IntelliSense for Cedar entities JSON
5+
- JSON preview for Cedar policies and schema
6+
- Support enumerated entity types
7+
- Require Visual Studio Code version [1.83](https://code.visualstudio.com/updates/v1_83) or later
8+
19
## v0.8.0 (Preview) 2024-09-26
210

311
- Update to Cedar 3.4.1

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18
1+
FROM node:20
22
RUN apt-get -y update
33
RUN apt-get -y install --fix-missing xvfb
44
RUN apt-get -y install libnss3 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev libasound2
@@ -17,8 +17,10 @@ dbus-daemon --session --address=$DBUS_SESSION_BUS_ADDRESS --nofork --nopidfile -
1717
mkdir ~/.vscode && echo '{ "disable-hardware-acceleration": true }' > ~/.vscode/argv.json
1818
# Build and Test
1919
npm ci
20-
npm install -g wasm-pack
20+
rustup update stable && rustup default stable
21+
cargo install wasm-pack --version 0.13.1
2122
npm run wasm-build
23+
npm run compile
2224
xvfb-run -a npm run test
2325
npm run package
2426
EOT

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Cedar policy language extension for Visual Studio Code supports syntax highl
44

55
Cedar is an open-source language for writing authorization policies and making authorization decisions based on those policies. Visit the [Cedar policy language reference guide](https://docs.cedarpolicy.com/) for the documentation and the language specification.
66

7-
**Note:** The release version of this extension uses Cedar 3.x.
7+
**Note:** The release version of this extension uses Cedar SDK 4.x.
88

99
## Features
1010

@@ -22,7 +22,7 @@ Files named `cedarschema` or matching `*.cedarschema` are detected as a Cedar sc
2222

2323
### Cedar entities
2424

25-
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.
25+
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. IntelliSense for entity types and add entity via context menu. Entity navigation using Outline or Breadcrumb. "Go to Definition" on Cedar entity types.
2626

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

0 commit comments

Comments
 (0)