Skip to content

Reverting printableCharacters SCEP validation - #49758

Merged
getvictor merged 2 commits into
mainfrom
revert-scep-challenge-printable-validation
Jul 22, 2026
Merged

Reverting printableCharacters SCEP validation#49758
getvictor merged 2 commits into
mainfrom
revert-scep-challenge-printable-validation

Conversation

@getvictor

@getvictor getvictor commented Jul 22, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #49756

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Custom SCEP proxy challenges can again include characters such as underscores.
    • Apple device enrollment works again with these challenges.
    • Removed the overly strict printable-character validation from the Custom SCEP configuration form.
    • The Challenge field now only enforces the required-value rule and no longer shows printable-character validation errors.

Copilot AI review requested due to automatic review settings July 22, 2026 16:14
@getvictor

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@getvictor

Copy link
Copy Markdown
Member Author

/agentic_review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b7897f68-a28a-42c8-9d1d-381b57839854

📥 Commits

Reviewing files that changed from the base of the PR and between 1d7bcd1 and 7b1cd8e.

📒 Files selected for processing (2)
  • ee/server/service/certificate_authorities_test.go
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/CustomSCEPForm.tests.tsx

Walkthrough

Custom SCEP proxy challenge PrintableString validation was removed from certificate authority creation, updates, batch processing, and the frontend form. Backend validation retains existing empty-value and SCEP URL checks. Challenge-specific frontend error typing and rendering were removed, along with tests covering rejected characters and unchanged masked challenges. Release notes document the reverted validation and separate Windows enrollment fix.

Possibly related issues

  • Issue 49659: Describes reverting the same Custom SCEP challenge-character validation across backend, GitOps, and UI paths.
  • Issue 47492: Covers the non-PrintableString challenge rejection addressed by removing these validations.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: reverting printable-character validation for SCEP challenges.
Description check ✅ Passed The description includes the related issue, key checklist items, and testing, and is mostly complete for this PR.
Linked Issues check ✅ Passed The code reverts backend, UI, and GitOps SCEP challenge validation and adds regression tests, matching issue #49756.
Out of Scope Changes check ✅ Passed The changes stay focused on reverting SCEP challenge validation and associated tests, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-scep-challenge-printable-validation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
ee/server/service/certificate_authorities.go (1)

395-409: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the reverted challenge behavior.

Cover _ and @ in create, update, and batch requests so the intentionally removed PrintableString restriction cannot be reintroduced.

Also applies to: 793-795, 1476-1480

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ee/server/service/certificate_authorities.go` around lines 395 - 409, The
validation tests for custom SCEP proxy challenges need regression coverage for
underscores and at-signs. Extend the create, update, and batch request tests
covering validateCustomSCEPProxy to submit challenge values containing “_” and
“@” and assert they are accepted, preserving the removed PrintableString
restriction behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@ee/server/service/certificate_authorities.go`:
- Around line 395-409: The validation tests for custom SCEP proxy challenges
need regression coverage for underscores and at-signs. Extend the create,
update, and batch request tests covering validateCustomSCEPProxy to submit
challenge values containing “_” and “@” and assert they are accepted, preserving
the removed PrintableString restriction behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9a811bb6-5dd8-44de-a3e3-d5b37e8ec0f9

📥 Commits

Reviewing files that changed from the base of the PR and between 8923dda and 1d7bcd1.

📒 Files selected for processing (6)
  • changes/49756-revert-scep-challenge-printable-validation
  • ee/server/service/certificate_authorities.go
  • ee/server/service/certificate_authorities_test.go
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/CustomSCEPForm.tests.tsx
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/CustomSCEPForm.tsx
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/helpers.ts
💤 Files with no reviewable changes (3)
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/CustomSCEPForm.tsx
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/CustomSCEPForm.tests.tsx
  • ee/server/service/certificate_authorities_test.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

Reverts the printable-character (ASN.1 PrintableString) validation for Custom SCEP proxy challenges across the UI and backend, aligning Fleet behavior with pre-4.89.0 and unblocking Apple enrollments that use base64url-style challenge secrets (e.g., containing _).

Changes:

  • Removed Custom SCEP challenge “printable characters” validation from the CustomSCEP form validation helper and UI field error display.
  • Removed backend validation that rejected Custom SCEP challenges containing non-PrintableString characters (create/update + GitOps/batch path).
  • Removed the associated frontend and backend tests that asserted the previous rejection behavior.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/helpers.ts Drops printable-character validation; adjusts validation typings.
frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/CustomSCEPForm.tsx Removes challenge field error display tied to the removed validation.
frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/CustomSCEPForm/CustomSCEPForm.tests.tsx Removes UI tests that asserted challenge rejection for underscores / masked challenge behavior.
ee/server/service/certificate_authorities.go Removes backend printable-character challenge validation for Custom SCEP proxy CAs.
ee/server/service/certificate_authorities_test.go Removes backend tests that asserted challenge rejection for non-PrintableString characters.
Files excluded by content exclusion policy (1)
  • changes/49756-revert-scep-challenge-printable-validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ee/server/service/certificate_authorities_test.go
Copilot AI review requested due to automatic review settings July 22, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Files excluded by content exclusion policy (1)
  • changes/49756-revert-scep-challenge-printable-validation

Comment thread ee/server/service/certificate_authorities_test.go
@getvictor
getvictor marked this pull request as ready for review July 22, 2026 18:37
@getvictor
getvictor requested review from a team as code owners July 22, 2026 18:37
@getvictor
getvictor requested a review from sharon-fdm July 22, 2026 18:38

@sharon-fdm sharon-fdm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@getvictor
getvictor merged commit 95b535a into main Jul 22, 2026
38 checks passed
@getvictor
getvictor deleted the revert-scep-challenge-printable-validation branch July 22, 2026 18:46
getvictor added a commit that referenced this pull request Jul 22, 2026
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #49756

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes

files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **Bug Fixes**
* Custom SCEP proxy challenges can again include characters such as
underscores.
  * Apple device enrollment works again with these challenges.
* Removed the overly strict printable-character validation from the
Custom SCEP configuration form.
* The Challenge field now only enforces the required-value rule and no
longer shows printable-character validation errors.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 95b535a)
getvictor added a commit that referenced this pull request Jul 22, 2026
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #49756

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes

files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **Bug Fixes**
* Custom SCEP proxy challenges can again include characters such as
underscores.
  * Apple device enrollment works again with these challenges.
* Removed the overly strict printable-character validation from the
Custom SCEP configuration form.
* The Challenge field now only enforces the required-value rule and no
longer shows printable-character validation errors.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 95b535a)
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.90%. Comparing base (130c562) to head (7b1cd8e).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #49758      +/-   ##
==========================================
+ Coverage   67.88%   67.90%   +0.01%     
==========================================
  Files        3896     3896              
  Lines      248688   248808     +120     
  Branches    13224    13062     -162     
==========================================
+ Hits       168820   168950     +130     
+ Misses      64649    64645       -4     
+ Partials    15219    15213       -6     
Flag Coverage Δ
backend 69.30% <100.00%> (+0.02%) ⬆️
frontend 60.35% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Custom SCEP proxy challenge printable-character validation blocks valid Apple enrollments

4 participants