-
Notifications
You must be signed in to change notification settings - Fork 0
fix: constrain interactive confirmation choices to 1 or 2 #238
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
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5a58ac6
보안 강화: readline() 입력에 대한 약한 정규식 수정 (DoS 방지)
seonghobae 51fa1e4
보안 강화: readline() 입력에 대한 약한 정규식 수정 (DoS 방지) 및 R CMD check 오류 수정
seonghobae 970bbb7
보안 강화: readline() 입력에 대한 약한 정규식 수정 (DoS 방지) 및 R CMD check 오류 패치
seonghobae a1625aa
보안 강화: readline() 입력에 대한 약한 정규식 수정 (DoS 방지) 및 R CMD check 오류 최종 패치
seonghobae 2b649e5
ci: rebuild the RcppParallel and qs2 ABI pair
seonghobae 0aaac6a
ci: verify pinned ABI dependency sources
seonghobae 18595b5
test: cover oversized interactive confirmation inputs
seonghobae cf20d29
보안 강화: readline() 입력에 대한 약한 정규식 수정 (DoS 방지) 및 CI/CD 오류 패치
seonghobae 31bb0e8
보안 강화: readline() 입력에 대한 약한 정규식 수정 및 yamllint 패치
seonghobae a751ead
보안 강화: readline() 입력에 대한 약한 정규식 수정 및 yamllint 패치
seonghobae 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,3 +22,5 @@ | |
| ^\.jules(/.*)?$ | ||
| ^\.trivyignore\.yaml$ | ||
| ^trivy\.yaml$ | ||
| ^.semgrepignore$ | ||
| ^\.semgrepignore$ | ||
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| library(testthat) | ||
| library(mockery) | ||
|
|
||
| test_that("weak regex is bounded properly", { | ||
| mockery::stub(aFIPC::autoFIPC, 'interactive', TRUE) | ||
| m_readline <- mockery::mock('3', '3', '3') | ||
| mockery::stub(aFIPC::autoFIPC, 'readline', m_readline) | ||
|
|
||
| # Stub mirt to avoid estimation error and just get to validation | ||
| mod <- new("SingleGroupClass") | ||
| mod@OptimInfo$converged <- TRUE | ||
| mockery::stub(aFIPC::autoFIPC, 'mirt::mirt', mod) | ||
|
|
||
| dummy_data <- data.frame(v1=c(0,1,0,1,1), v2=c(1,0,1,0,0), v3=c(1,1,0,0,1)) | ||
|
|
||
| expect_error( | ||
| aFIPC::autoFIPC( | ||
| oldformYData = dummy_data, | ||
| newformXData = dummy_data, | ||
| oldformCommonItemNames = c("v1"), | ||
| newformCommonItemNames = c("v1") | ||
| ), | ||
| "Too many invalid common item confirmation attempts" | ||
| ) | ||
| }) | ||
|
|
||
| test_that("weak regex is bounded properly for oldform BILOG prior", { | ||
| mockery::stub(aFIPC::autoFIPC, 'interactive', TRUE) | ||
|
|
||
| m_readline <- mockery::mock('1', '3', '3', '3') | ||
| mockery::stub(aFIPC::autoFIPC, 'readline', m_readline) | ||
|
|
||
| mod <- new("SingleGroupClass") | ||
| mod@OptimInfo$converged <- TRUE | ||
| mockery::stub(aFIPC::autoFIPC, 'mirt::mirt', mod) | ||
|
|
||
| dummy_data <- data.frame(v1=c(0,1,0,1,1), v2=c(1,0,1,0,0), v3=c(1,1,0,0,1)) | ||
|
|
||
| expect_error( | ||
| aFIPC::autoFIPC( | ||
| oldformYData = dummy_data, | ||
| newformXData = dummy_data, | ||
| itemtype = '3PL', | ||
| oldformCommonItemNames = c("v1"), | ||
| newformCommonItemNames = c("v1") | ||
| ), | ||
| "Too many invalid oldform BILOG prior attempts" | ||
| ) | ||
| }) | ||
|
|
||
| test_that("weak regex is bounded properly for newform BILOG prior", { | ||
| mockery::stub(aFIPC::autoFIPC, 'interactive', TRUE) | ||
|
|
||
| m_readline <- mockery::mock('1', '1', '3', '3', '3') | ||
| mockery::stub(aFIPC::autoFIPC, 'readline', m_readline) | ||
|
|
||
| mod <- new("SingleGroupClass") | ||
| mod@OptimInfo$converged <- TRUE | ||
| mockery::stub(aFIPC::autoFIPC, 'mirt::mirt', mod) | ||
|
|
||
| dummy_data <- data.frame(v1=c(0,1,0,1,1), v2=c(1,0,1,0,0), v3=c(1,1,0,0,1)) | ||
|
|
||
| expect_error( | ||
| aFIPC::autoFIPC( | ||
| oldformYData = dummy_data, | ||
| newformXData = dummy_data, | ||
| itemtype = '3PL', | ||
| oldformCommonItemNames = c("v1"), | ||
| newformCommonItemNames = c("v1") | ||
| ), | ||
| "Too many invalid newform BILOG prior attempts" | ||
| ) | ||
| }) | ||
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.
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: ContextualWisdomLab/aFIPC
Length of output: 7964
🏁 Script executed:
Repository: ContextualWisdomLab/aFIPC
Length of output: 12009
🏁 Script executed:
Repository: ContextualWisdomLab/aFIPC
Length of output: 13509
🏁 Script executed:
Repository: ContextualWisdomLab/aFIPC
Length of output: 405
secondordertest를 mock에 설정하십시오.tryFitwholeOldItems = TRUE가 기본값입니다.secondordertest가TRUE가 아니면 old-form fallback이checknewformBILOGprior()보다 먼저 실행됩니다.수정 예시
mod@OptimInfo$converged <- TRUE +mod@OptimInfo$secondordertest <- TRUE📝 Committable suggestion
🤖 Prompt for AI Agents