Skip to content

feat(cedar): add Cedar policy language support#4373

Open
KJyang-0114 wants to merge 2 commits intohighlightjs:mainfrom
KJyang-0114:feat/add-cedar-language
Open

feat(cedar): add Cedar policy language support#4373
KJyang-0114 wants to merge 2 commits intohighlightjs:mainfrom
KJyang-0114:feat/add-cedar-language

Conversation

@KJyang-0114
Copy link
Copy Markdown

Description

Add syntax highlighting for Cedar authorization policy language. Resolves issue #4164.

Cedar is a language for writing authorization policies and making authorization decisions based on those policies.

Changes

  • Added new language definition in src/languages/cedar.js
  • Implements:
    • Keywords: permit, forbid, when, unless, if, then, else
    • Variables: principal, action, resource, context
    • Policy templates: ?principal, ?resource
    • Built-in functions: ip, decimal, datetime, duration
    • Method highlighting for entity operations
    • Operators, integers, entities, and string support

Testing

Verified highlighting works correctly with sample Cedar policy code:

permit principal, action, resource == Photo::"view"
  when { principal.age > 18 };

Renders with proper syntax highlighting for all Cedar constructs.

- Add missing Ceylon language entry
- Add missing 'edn' alias to Clojure (closes highlightjs#4359)
Add syntax highlighting for Cedar authorization policy language.
 Cedar is a language for writing authorization policies and making
 authorization decisions based on those policies.

 - Implements keywords: permit, forbid, when, unless, if, then, else
 - Supports Cedar variables: principal, action, resource, context
 - Supports policy templates: ?principal, ?resource
 - Implements built-in functions: ip, decimal, datetime, duration
 - Implements method highlighting for entity operations
 - Resolves issue highlightjs#4164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant