-
Notifications
You must be signed in to change notification settings - Fork 0
[v6 PROD RELEASE] - dev -> master #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2e91cea
e880c4e
904b25a
2ca7880
e4bdf44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Trivy Scanner | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - dev | ||
| pull_request: | ||
| jobs: | ||
| trivy-scan: | ||
| name: Use Trivy | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Trivy scanner in repo mode | ||
| uses: aquasecurity/trivy-action@0.33.1 | ||
| with: | ||
| scan-type: "fs" | ||
| ignore-unfixed: true | ||
| format: "sarif" | ||
| output: "trivy-results.sarif" | ||
| severity: "CRITICAL,HIGH,UNKNOWN" | ||
| scanners: vuln,secret,misconfig,license | ||
| github-pat: ${{ secrets.GITHUB_TOKEN }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
|
|
||
| - name: Upload Trivy scan results to GitHub Security tab | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: "trivy-results.sarif" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ export class RolesGuard implements CanActivate { | |
| .map((s: string) => s.trim()) | ||
| .filter(Boolean); | ||
|
|
||
| const scopeOk = fallbackScopes.every((s) => scopes.includes(s)); | ||
| const scopeOk = fallbackScopes.some((s) => scopes.includes(s)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| if (scopeOk) return true; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ export class ScopesGuard implements CanActivate { | |
| .map((s: string) => s.trim()) | ||
| .filter(Boolean); | ||
|
|
||
| const ok = required.every((s) => scopes.includes(s)); | ||
| const ok = required.some((s) => scopes.includes(s)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| if (ok) return true; | ||
|
|
||
| const fallbackRoles = this.reflector.getAllAndOverride<string[]>(ROLES_KEY, [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,14 @@ export class MembersLookupService { | |
| return; | ||
| } | ||
| // Create a dedicated Prisma client targeting the members DB | ||
| this.client = new PrismaClient({ datasources: { db: { url } } }); | ||
| this.client = new PrismaClient({ | ||
| transactionOptions: { | ||
| timeout: process.env.BA_SERVICE_PRISMA_TIMEOUT | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| ? parseInt(process.env.BA_SERVICE_PRISMA_TIMEOUT, 10) | ||
| : 10000, | ||
| }, | ||
| datasources: { db: { url } } | ||
| }); | ||
| this.initialized = true; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,16 @@ import { PrismaClient } from "@prisma/client"; | |
|
|
||
| @Injectable() | ||
| export class PrismaService extends PrismaClient implements OnModuleInit { | ||
| constructor() { | ||
| super({ | ||
| transactionOptions: { | ||
| timeout: process.env.BA_SERVICE_PRISMA_TIMEOUT | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| ? parseInt(process.env.BA_SERVICE_PRISMA_TIMEOUT, 10) | ||
| : 10000, | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| async onModuleInit() { | ||
| await this.$connect(); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[⚠️
maintainability]Consider using
ubuntu-latestinstead ofubuntu-24.04to ensure the workflow benefits from the latest security patches and updates. This can help avoid potential issues with outdated dependencies or vulnerabilities.