Skip to content
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

feat: Enforce keycloak UUIDs as user identifiers - take 2 #118

Merged
merged 6 commits into from
Dec 17, 2024

Conversation

einnhverr
Copy link
Contributor

@einnhverr einnhverr commented Dec 13, 2024

This PR enforces the usage of keycloak UUIDs.

Copy link

Code Coverage Report

Project Statements Rate Branch Rate Indicator
packages/autopilot-utils 96.71% 90.08% 💚
dist/coverage/python 96.71% 90.08% 💚
apps/splunk-fetcher 92.51% 82.00% 💚
apps/sharepoint-fetcher 84.83% 76.62% 💚
apps/sharepoint-evaluator 94.09% 90.48% 💚
apps/sharepoint 84.06% 67.24% 💚
apps/security-scanner 0.00% 0.00% 💔
apps/pex-tool 93.07% 78.05% 💚
apps/pdf-signature-evaluator 67.48% 48.80% 💛
apps/papsr 98.28% 94.74% 💚
apps/filecheck 98.53% 96.30% 💚
apps/excel-tools 78.37% 62.89% 💛
apps/artifactory-fetcher 98.51% 92.86% 💚
Total 87.16% 75.59% 💚

@einnhverr einnhverr force-pushed the feat-3869/uuid-columns branch 2 times, most recently from e53a271 to 3c0853d Compare December 16, 2024 13:15
@einnhverr einnhverr force-pushed the feat-3869/uuid-columns branch from d93bee0 to fd75f04 Compare December 16, 2024 14:49
@einnhverr einnhverr marked this pull request as ready for review December 16, 2024 14:57
@einnhverr einnhverr requested a review from fbufler December 16, 2024 14:57
Copy link
Member

@fbufler fbufler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing, besides that LGTM

Comment on lines +29 to +35
await queryRunner.query(
`ALTER TABLE "findings" ALTER COLUMN "resolver" SET DATA TYPE uuid
USING CASE
WHEN "resolver" IN ('SYSTEM_ACTOR', 'Yaku', 'Aqua') THEN '00000000-0000-0000-0000-000000000000'::uuid
ELSE "resolver"::uuid
END`,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's exactly what I meant, nice job :)

@@ -21,9 +21,9 @@ import { SYSTEM_REQUEST_USER } from '../module.utils'

const CACHE_TIMEOUT = 1000 * 60 * 5 // 5 minutes
export const SYSTEM_USER = new UserInNamespaceDto()
SYSTEM_USER.id = 'SYSTEM_ACTOR'
SYSTEM_USER.id = '00000000-0000-0000-0000-000000000000'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this user now as well.
As you replaced the other entries it should be not used anymore.
Just to prevent having two possibilities to use and to update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cleaned-up any SYSTEM_USER references, only SYSTEM_REQUEST_USER is used now

@einnhverr einnhverr merged commit 5a1aa58 into main Dec 17, 2024
10 checks passed
@einnhverr einnhverr deleted the feat-3869/uuid-columns branch December 17, 2024 12:17
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.

3 participants