generated from caido/starterkit-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from caido-community/ib-initial
Ib initial
- Loading branch information
Showing
91 changed files
with
5,705 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"formatter": { | ||
"indentStyle": "space" | ||
}, | ||
"overrides": [ | ||
{ | ||
"include": ["*.vue"], | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"useConst": "off", | ||
"useImportType": "off" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
{ | ||
"id": "starterkit-plugin", | ||
"name": "StarterKit Plugin", | ||
"id": "authmatrix", | ||
"name": "AuthMatrix", | ||
"version": "0.1.0", | ||
"description": "This is a starterkit plugin", | ||
"description": "Grid-based authorization testing across multiple users and roles.", | ||
"author": { | ||
"name": "Caido Labs Inc.", | ||
"email": "[email protected]", | ||
"url": "https://github.com/caido/starterkit-plugin" | ||
"url": "https://github.com/caido-community/authmatrix" | ||
}, | ||
"plugins": [ | ||
{ | ||
"kind": "frontend", | ||
"id": "caido-extra-commands", | ||
"name": "Extra Commands", | ||
"id": "authmatrix-frontend", | ||
"name": "Authmatrix Frontend", | ||
"entrypoint": "frontend/script.js", | ||
"style": "frontend/style.css", | ||
"backend": { | ||
"id": "caido-extra-commands-backend" | ||
"id": "authmatrix-backend" | ||
} | ||
}, | ||
{ | ||
"kind": "backend", | ||
"id": "caido-extra-commands-backend", | ||
"name": "Extra Commands Backend", | ||
"id": "authmatrix-backend", | ||
"name": "Authmatrix Backend", | ||
"runtime": "javascript", | ||
"entrypoint": "backend/script.js" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
{ | ||
"name": "starterkit-plugin-backend", | ||
"name": "backend", | ||
"version": "0.1.0", | ||
"description": "StarterKit plugin for Caido", | ||
"author": "Caido Labs Inc. <[email protected]>", | ||
"license": "CC0-1.0", | ||
"type": "module", | ||
"types": "src/index.ts", | ||
"scripts": { | ||
"typecheck": "tsc --noEmit", | ||
"build": "vite build" | ||
}, | ||
"dependencies": { | ||
"shared": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@caido/sdk-backend": "0.39.0" | ||
"@caido/sdk-backend": "0.40.1-beta.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,85 @@ | ||
import { Body } from "caido:utils"; | ||
import { SDK, DefineAPI } from "caido:plugin"; | ||
import type { DefineAPI, SDK } from "caido:plugin"; | ||
import { | ||
getRequestResponse, | ||
getResults, | ||
runAnalysis, | ||
} from "./services/analysis"; | ||
import { addRole, deleteRole, getRoles, updateRole } from "./services/roles"; | ||
import { getSettings, updateSettings } from "./services/settings"; | ||
import { | ||
addTemplate, | ||
deleteTemplate, | ||
getTemplates, | ||
registerTemplateEvents, | ||
toggleTemplateRole, | ||
toggleTemplateUser, | ||
updateTemplate, | ||
} from "./services/templates"; | ||
import { addUser, deleteUser, getUsers, updateUser } from "./services/users"; | ||
|
||
function generateNumber(sdk: SDK, min: number, max: number): number { | ||
sdk.console.log(new Body("test")); // Example from utils | ||
|
||
// Generate random number between min and max | ||
return Math.floor(Math.random() * (max - min + 1) + min); | ||
} | ||
export type { BackendEvents } from "./types"; | ||
|
||
export type API = DefineAPI<{ | ||
generateNumber: typeof generateNumber; | ||
// Role endpoints | ||
getRoles: typeof getRoles; | ||
addRole: typeof addRole; | ||
updateRole: typeof updateRole; | ||
deleteRole: typeof deleteRole; | ||
|
||
// User endpoints | ||
getUsers: typeof getUsers; | ||
addUser: typeof addUser; | ||
updateUser: typeof updateUser; | ||
deleteUser: typeof deleteUser; | ||
|
||
// Template endpoints | ||
getTemplates: typeof getTemplates; | ||
addTemplate: typeof addTemplate; | ||
updateTemplate: typeof updateTemplate; | ||
deleteTemplate: typeof deleteTemplate; | ||
toggleTemplateRole: typeof toggleTemplateRole; | ||
toggleTemplateUser: typeof toggleTemplateUser; | ||
|
||
// Settings endpoints | ||
getSettings: typeof getSettings; | ||
updateSettings: typeof updateSettings; | ||
|
||
// Analysis endpoints | ||
runAnalysis: typeof runAnalysis; | ||
getResults: typeof getResults; | ||
getRequestResponse: typeof getRequestResponse; | ||
}>; | ||
|
||
export function init(sdk: SDK) { | ||
sdk.api.register("generateNumber", generateNumber); | ||
export function init(sdk: SDK<API>) { | ||
// Role endpoints | ||
sdk.api.register("getRoles", getRoles); | ||
sdk.api.register("addRole", addRole); | ||
sdk.api.register("updateRole", updateRole); | ||
sdk.api.register("deleteRole", deleteRole); | ||
|
||
// User endpoints | ||
sdk.api.register("getUsers", getUsers); | ||
sdk.api.register("addUser", addUser); | ||
sdk.api.register("updateUser", updateUser); | ||
sdk.api.register("deleteUser", deleteUser); | ||
|
||
// Template endpoints | ||
sdk.api.register("getTemplates", getTemplates); | ||
sdk.api.register("addTemplate", addTemplate); | ||
sdk.api.register("updateTemplate", updateTemplate); | ||
sdk.api.register("deleteTemplate", deleteTemplate); | ||
sdk.api.register("toggleTemplateRole", toggleTemplateRole); | ||
sdk.api.register("toggleTemplateUser", toggleTemplateUser); | ||
|
||
// Settings endpoints | ||
sdk.api.register("getSettings", getSettings); | ||
sdk.api.register("updateSettings", updateSettings); | ||
|
||
// Analysis function | ||
sdk.api.register("runAnalysis", runAnalysis); | ||
sdk.api.register("getResults", getResults); | ||
sdk.api.register("getRequestResponse", getRequestResponse); | ||
|
||
// Events | ||
registerTemplateEvents(sdk); | ||
} |
Oops, something went wrong.