-
Notifications
You must be signed in to change notification settings - Fork 146
refactor: migrate tests to Vitest + TS #1202
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
Open
jescalada
wants to merge
149
commits into
finos:main
Choose a base branch
from
jescalada:1150-vitest-migration-from-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
149 commits
Select commit
Hold shift + click to select a range
d3d73d9
refactor(ts): passport/activeDirectory
jescalada ba086f1
chore: add missing types
jescalada 0c7d1fb
refactor(ts): JWT handler and utils
jescalada b419f4e
refactor(ts): passport/index
jescalada 06a64ea
refactor(ts): passport/local
jescalada 4dfbc2d
refactor(ts): passport/ldaphelper
jescalada 09a1876
refactor(ts): passport/oidc
jescalada abc09bd
refactor(ts): auth routes
jescalada 03c4952
refactor(ts): config routes
jescalada 7ed9eb0
refactor(ts): misc routes and index
jescalada 3d99de2
refactor(ts): push routes and update related types/db handlers
jescalada 944e0b5
refactor(ts): repo routes
jescalada 6a7089f
refactor(ts): user routes
jescalada 6c9d3bf
refactor(ts): emailSender and missing implementation
jescalada 6899e4e
refactor(ts): service/index and missing types
jescalada 63c30a0
refactor(ts): urls
jescalada 812a910
fix: failing tests due to incorrect imports
jescalada 9d5bdd8
chore: update .eslintrc
jescalada c951015
chore: fix type checks
jescalada b046903
chore: fix CLI service imports
jescalada 97ad7c7
Merge branch 'main' of https://github.com/finos/git-proxy into servic…
jescalada 9008ac5
chore: run npm format
jescalada f36b3d1
test: add basic oidc tests and ignore openid-client type error on import
jescalada 51df315
test: increase testOidc and testPush coverage
jescalada f7ed291
test: improve push test coverage
jescalada b2b1b14
test: add missing smtp tests
jescalada ae43800
Update .eslintrc.json
jescalada 17a8adf
Update src/db/file/users.ts
jescalada c7cf87e
Update src/service/passport/jwtAuthHandler.ts
jescalada 8aa1a97
Update src/service/passport/index.ts
jescalada 962a0ba
chore: fix service/index proxy type and npm run format
jescalada 7eda433
Update src/service/passport/jwtAuthHandler.ts
jescalada df80fef
Update src/service/passport/jwtUtils.ts
jescalada 095ae62
chore: add getSessionStore helper for fs sink and fix types
jescalada b094ff1
Merge branch 'service-ts-refactor-redone' of https://github.com/jesca…
jescalada f9cea8c
chore: remove unnecessary casting for JWT verifiedPayload
jescalada ee63f9c
chore: update getSessionStore call
jescalada 0dc78ce
chore: replace unused UserInfoResponse with imported version
jescalada 2429fbe
chore: improve userEmail checks on push routes
jescalada a368642
chore: update packages
jescalada 8971566
Merge branch 'main' into service-ts-refactor-redone
jescalada 6c427b9
chore: add typing for thirdPartyApiConfig
jescalada 5805dd9
chore: fix AD passport types
jescalada bec32f7
chore: replace AD type with activedirectory2
jescalada 573cc92
chore: improve loginSuccessHandler
jescalada a211560
chore: fix PushQuery typing
jescalada e299e85
chore: fix "any" in repo and users routes and fix failing tests
jescalada 3dd1bd0
refactor: flatten push routes and fix typings
jescalada 8e6d1d3
chore: add isAdminUser check to repo routes
jescalada db60fbf
test: improve push test checks for cancel endpoint
jescalada dfb1e04
Merge branch 'main' into service-ts-refactor-redone
jescalada 95495f2
chore: fix createDefaultAdmin and isAdminUser functions
jescalada 3469b54
chore: fix thirdPartyApiConfig and AD type errors
jescalada cd68915
chore: remove nodemailer and unused functionality
jescalada 728b5aa
chore: fix failing CLI test (email not unique)
jescalada 4d3d083
chore: remove unused smtp config variables
jescalada 0343438
Update src/service/routes/publicApi.ts
jescalada 0109b0b
chore: fix toPublicUser calls and typing
jescalada 052a00e
Merge branch 'main' into service-ts-refactor-redone
jescalada 3a66ca4
chore: update sample test src/service import
jescalada e321a3a
chore: fix inline imports for vitest execution
jescalada 18994f5
refactor(vite): prepare vite dependencies
jescalada f572fa8
refactor(vite): sample test file to TS and vite, update comments
jescalada 5f10eb2
refactor(vite): checkHiddenCommit tests
jescalada 7f15848
fix: add vitest config and fix flaky tests
jescalada 7ca70a5
refactor(vite): chain tests
jescalada 8ccb420
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 177889c
chore: remove unused vite dep
jescalada b42350b
fix: add missing auth attributes to config.schema.json
jescalada 29ad29b
fix: add missing types and fix TS errors
jescalada ee1cfae
refactor(vitest): ConfigLoader tests and fix type errors
jescalada 445b5de
refactor(vitest): db-helper tests
jescalada 3e57988
refactor(vitest): generated-config tests
jescalada 0c322b6
refactor(vitest): proxy tests and add lazy loading for server options
jescalada 2a2c476
refactor(vitest): proxyURL
jescalada c60aee4
refactor(vitest): teeAndValidation
jescalada 762d4b1
refactor(vitest): activeDirectoryAuth
jescalada e706f5f
refactor(vitest): authMethods and checkUserPushPermissions
jescalada 4fe3fd6
refactor(vitest): config
jescalada 9918720
refactor(vitest): db tests and fix type mismatches
jescalada b5243cc
refactor(vitest): jwtAuthHandler tests
jescalada 339d30d
refactor(vitest): login tests
jescalada b9d0a97
chore: add vitest script to package.json
jescalada f871eec
refactor(vitest): src/service/passport/oidc
jescalada 0526f59
refactor(vitest): testParseAction
jescalada d30f6ad
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 6d5bc20
fix: unused/invalid tests and refactor extractRawBody tests
jescalada 022afd4
refactor(vitest): testParsePush tests and linting
jescalada ee0ee7e
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 73b43d6
fix: users endpoint merge conflict
jescalada 9ea3fd4
refactor(vitest): rewrite proxy tests in Vitest + TS
jescalada b435c1e
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 710d705
refactor(vitest): testProxyRoute tests
jescalada 43a2bb7
refactor(vitest): push tests
jescalada 0776568
refactor(vitest): testRepoApi tests
jescalada a82c7f4
refactor(vitest): testRouteFilter tests
jescalada 5aaceb1
refactor(vitest): forcePush integration test
jescalada 717d5d6
refactor(vitest): plugin tests
jescalada 6c81ec3
refactor(vitest): prereceive hook tests
jescalada 5e1064a
refactor(vitest): rewrite tests for blockForAuth
jescalada a5dc971
refactor(vitest): rewrite checkAuthorEmails tests
jescalada 792acc0
chore: add fuzzing and fix lint/type errors
jescalada 194e0bc
refactor(vitest): rewrite checkCommitMessages tests
jescalada cc23768
fix: uncaught error on invalid regex in checkCommitMessages, type fix
jescalada 3e6e9aa
chore: update vitest script
jescalada b11cc92
refactor(vitest): checkEmptyBranch tests
jescalada 8cbac2b
refactor(vitest): checkIfWaitingAuth tests
jescalada fdf1c47
refactor(vitest): checkUserPushPermission tests
jescalada 1f82d8f
refactor(vitest): clearBareClone tests
jescalada c0e416b
refactor(vitest): getDiff tests
jescalada aa93e14
refactor(vitest): gitLeaks tests
jescalada e10b33f
refactor(vitest): scanDiff emptyDiff tests
jescalada fdb064d
refactor(vitest): scanDiff tests
jescalada 86759ff
refactor(vitest): testCheckRepoInAuthList tests
jescalada 46ab992
refactor(vitest): writePack tests
jescalada b5f0fb1
refactor(vitest): auth tests
jescalada 6b9bf65
refactor(vitest): file repo tests
jescalada e570dbf
refactor(vitest): mongo repo tests
jescalada 3bcddb8
refactor(vitest): user routes tests
jescalada 88f992d
refactor(vitest): apiBase tests
jescalada 173028e
refactor(vitest): db tests
jescalada 7a198e3
chore: replace old test and coverage scripts
jescalada c4a4423
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 33117d0
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada f7be67c
chore: remove unused test deps and update depcheck script
jescalada c85bb34
Merge branch '1150-vitest-migration-from-service' of https://github.c…
jescalada b5746d0
fix: reset modules in testProxyRoute and add/replace types for app
jescalada a20d39a
fix: CI test script and unused deps
jescalada fb903c3
fix: add proper cleanup to proxy tests
jescalada 73e5d8b
chore: temporarily skip proxy tests to prevent errors
jescalada f1920c9
chore: temporarily skip problematic proxy route tests
jescalada 5f4ac95
chore: temporarily add ts-mocha to CLI dev deps
jescalada 52cfaab
chore: update vitest config to limit coverage check to API
jescalada c9b324a
chore: exclude more unnecessary files in coverage and include only TS…
jescalada a268711
chore: exclude type files from coverage check
jescalada 41abea2
test: rewrite proxy filter tests and new ones for helpers
jescalada 65aa650
chore: bump vite to latest
jescalada 4909c03
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 51478b0
chore: update package-lock.json and remove unused JS test
jescalada bfa4374
fix: failing tests and formatting
jescalada b375597
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada c3995c5
chore: add BlueOak-1.0.0 to allowed licenses list
jescalada 4b1adbc
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada ef6b730
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 2350b59
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 9951967
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 8e38584
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada ea1f875
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada 1a42226
Merge branch 'main' into 1150-vitest-migration-from-service
jescalada File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -427,6 +427,10 @@ | |
| "password": { | ||
| "type": "string", | ||
| "description": "Password for the given `username`." | ||
| }, | ||
|
Contributor
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. Are you able to run the schema docs generator (gen-schema-doc) to add these properties to the config reference? Give me a shout if not (i.e. if you haven't got the python env setup needed to do so). You have run the quicktype generator (generate-config-types). |
||
| "searchBase": { | ||
| "type": "string", | ||
| "description": "Override baseDN to query for users in other OUs or sub-trees." | ||
| } | ||
| }, | ||
| "required": ["url", "baseDN", "username", "password"] | ||
|
|
@@ -466,7 +470,9 @@ | |
| "description": "Additional JWT configuration.", | ||
| "properties": { | ||
| "clientID": { "type": "string" }, | ||
| "authorityURL": { "type": "string" } | ||
| "authorityURL": { "type": "string" }, | ||
| "expectedAudience": { "type": "string" }, | ||
| "roleMapping": { "$ref": "#/definitions/roleMapping" } | ||
| }, | ||
| "required": ["clientID", "authorityURL"] | ||
| } | ||
|
|
@@ -482,6 +488,14 @@ | |
| "adminOnly": { "type": "boolean" }, | ||
| "loginRequired": { "type": "boolean" } | ||
| } | ||
| }, | ||
| "roleMapping": { | ||
| "type": "object", | ||
| "description": "Mapping of application roles to JWT claims. Each key is a role name, and its value is an object mapping claim names to expected values.", | ||
| "additionalProperties": { | ||
| "type": "object", | ||
| "additionalProperties": { "type": "string" } | ||
| } | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.