Skip to content

Commit

Permalink
Merge pull request #12 from slauth-io/generate-role-gcp
Browse files Browse the repository at this point in the history
feat: add gcp custom role generation
  • Loading branch information
almeidabbm authored Nov 30, 2023
2 parents 3de1471 + b0ec06f commit 067e5ab
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"typescript": "^5.3.2"
},
"dependencies": {
"@slauth.io/langchain-wrapper": "^1.3.1",
"@slauth.io/langchain-wrapper": "^1.4.2",
"cli-spinners": "^2.9.1",
"commander": "^11.1.0",
"dotenv": "^16.3.1"
Expand Down
17 changes: 16 additions & 1 deletion src/utils/scanner-strategies/gcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ export default class GCPScanner implements ScannerStrategy {

const permissions = (await permissionsPromise).flat();

return permissions.length ? permissions : undefined;
const customRolesPromise = Services.gcp.getCustomRolesFromPermissions(
permissions,
modelName
);

await showAsyncSpinner(
{
spinner: spinners.dots,
text: yellow(
'Generating custom roles (this process might take a few minutes)'
),
},
customRolesPromise
);

return await customRolesPromise;
}
}

0 comments on commit 067e5ab

Please sign in to comment.