Skip to content

Carl 9782 block v1v2 access#1311

Merged
bhagatparwinder merged 4 commits intomainfrom
carl-9782-block-v1v2-access
Feb 13, 2026
Merged

Carl 9782 block v1v2 access#1311
bhagatparwinder merged 4 commits intomainfrom
carl-9782-block-v1v2-access

Conversation

@carlpartridge
Copy link
Collaborator

🎫 Ticket

https://jira.cms.gov/browse/BCDA-9782

🛠 Changes

Add a v1/v2 deny access configuration check to v1/v2 request middleware.

ℹ️ Context

Part of making sure new clients that start with v3 are not making old request.

🧪 Validation

Local linting and testing.

@carlpartridge carlpartridge requested a review from a team as a code owner February 12, 2026 21:07
fn := func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ad, ok := ctx.Value(auth.AuthDataContextKey).(auth.AuthData)
ad, ok := handleAuthData(r)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

DRYed up the left side as it was now happening in 3 places, see handleAuthData() below.

V3EnabledACOs []string `conf:"v3_enabled_acos"` // Simple list of ACOs with v3 access
CutoffDuration time.Duration
RateLimitConfig RateLimitConfig `conf:"rate_limit_config"`
V1V2DenyRegexes []string `conf:"v1_v2_deny_regexes"`
Copy link
Collaborator Author

@carlpartridge carlpartridge Feb 12, 2026

Choose a reason for hiding this comment

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

I went with an array of regexes as it gives us pretty dynamic control, allowing for cutting off of whole models (eg IOTA), specific ACO IDs (eg A1234, A1235), or all access in general (eg ".*").

And I went with handling both v1 and v2 together as both will be getting replaced with v3 at the same time.

Copy link
Contributor

Choose a reason for hiding this comment

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

[...] allowing for cutting off of whole models

Is this referring to matching models based on the CMS_ID pattern that ACOs in that model follow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If Im understanding your question then we could cut off all of IOTA for example by doing "IOTA\d{3}".

@bhagatparwinder bhagatparwinder merged commit 9b58ff9 into main Feb 13, 2026
6 checks passed
@bhagatparwinder bhagatparwinder deleted the carl-9782-block-v1v2-access branch February 13, 2026 18: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