Refactor utils to share components (#3279)

* refactor: 💡 initial refactor for utils to share components

* refactor: 💡 actions logic

* Add missing copyright headers

* refactor: 💡 simplify actions getter logic

* refactor: 💡 convert output fields logic into a separate getter

* test: 💍 fix unit test

* fix: 🐛 bug with unknown fields lint error

* refactor: 💡 pr feedback - simplify template check

* refactor: 💡 remove unnecessary unit test file
This commit is contained in:
Lisbet Alvarez authored and GitHub committed 2026-05-29 16:52:00 -07:00
1 parent 878bd241f3
commit 7cddf7cb91
4 files changed
+428 -520

No files matched your search

@@ -72,6 +72,10 @@ module('Unit | Utility | grant-linter', function (hooks) {
'type=credential;ids=csst_1234;actions=read,write;actions=delete',
'Duplicate field "actions"',
], // duplicate actions field
[
'type=credential;ids=cs_1234;actions=read;random=',
'Unknown field "random"',
], // unknown field "random"
[
'type=credential;ids=cs_1234;actions=read;random=name',
'Unknown field "random"',
@@ -80,6 +84,7 @@ module('Unit | Utility | grant-linter', function (hooks) {
'=credential;actions=;ids=cs_1234',
'Invalid format: expected key=value',
], // missing type key
['type;actions=;ids=cs_1234', 'Invalid format: expected key=value'], // missing type value and equal sign
],
function (assert, [grantString, errorMsg]) {
const diagnostics = this.grantLinter(createContext(grantString));