Skip to content

Add API for restricting operations for sensitive files#2597

Merged
iloveeclipse merged 1 commit intoeclipse-platform:masterfrom
trancexpress:gh2588_with_api
Mar 31, 2026
Merged

Add API for restricting operations for sensitive files#2597
iloveeclipse merged 1 commit intoeclipse-platform:masterfrom
trancexpress:gh2588_with_api

Conversation

@trancexpress
Copy link
Copy Markdown
Contributor

@trancexpress trancexpress commented Mar 30, 2026

This change adds the following API:

  • org.eclipse.core.resources.IFile.isContentRestricted()
  • org.eclipse.core.resources.IFile.setContentRestricted(boolean)

The goal of this API is to allow Eclipse-based IDEs to restrict certain
platform functionality on a per-file basis, for sensitive files.

The flags are not persisted, to enable restricted handling
these flags must be set for each session.

The restrictions will apply to following functionality:

  • File search
  • Storing file history

Potentially more platform functionality will be restricted.

See: #2588

@trancexpress
Copy link
Copy Markdown
Contributor Author

trancexpress commented Mar 30, 2026

@merks if you can help with the API documentation wording, that would be great!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Test Results

    54 files  ±0      54 suites  ±0   37m 26s ⏱️ + 1m 25s
 4 547 tests +1   4 524 ✅ +1   23 💤 ±0  0 ❌ ±0 
12 237 runs  +3  12 078 ✅ +3  159 💤 ±0  0 ❌ ±0 

Results for commit 8fbeb32. ± Comparison against base commit e02781c.

♻️ This comment has been updated with latest results.

@merks
Copy link
Copy Markdown
Contributor

merks commented Mar 30, 2026

@merks if you can help with the API documentation wording, that would be great!

FYI. I’m on vacation mostly monitoring from my iPhone with slow internet. Ping me when you think it’s done and I can look at it on my computer later.

@iloveeclipse iloveeclipse requested a review from Copilot March 30, 2026 12:50
Copy link
Copy Markdown
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

LGTM for me, just white space change on WorkspaceDescription should be reverted.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new session-scoped API in org.eclipse.core.resources to mark files as “restricted/sensitive” and to globally enable/disable restricted-content handling at the workspace level, intended to let downstream IDEs disable content-related operations for those files.

Changes:

  • Add IWorkspace.isRestrictedContentEnabled() / setRestrictedContentEnabled(boolean) workspace toggle.
  • Add IFile.isContentRestricted() / setContentRestricted(boolean) backed by a session property (RESTRICTED_CONTENT).
  • Implement the workspace toggle in internal Workspace and bump bundle version.

Reviewed changes

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

Show a summary per file
File Description
resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IWorkspace.java Adds new workspace-level restricted-content enablement API + Javadoc.
resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFile.java Adds session-property key and default methods for per-file restricted-content marking.
resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Workspace.java Implements the new IWorkspace API via an internal boolean flag.
resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/WorkspaceDescription.java Whitespace-only change.
resources/bundles/org.eclipse.core.resources/META-INF/MANIFEST.MF Bumps bundle version to 3.24.0.qualifier.

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

@trancexpress trancexpress force-pushed the gh2588_with_api branch 4 times, most recently from e8b9816 to 9c81084 Compare March 30, 2026 15:09
@iloveeclipse
Copy link
Copy Markdown
Member

From my POV this PR is ready to merge, so

  • @laeubi : please check the proposed API.
  • @merks : if you could look at wording, would be great.

Copy link
Copy Markdown
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

See comments below, I think the API exposure can be reduced a bit.

@trancexpress trancexpress force-pushed the gh2588_with_api branch 2 times, most recently from fcf3236 to f216b6c Compare March 31, 2026 06:47
Copy link
Copy Markdown
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

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

The wording looks fine. I'm not sure if a @param/@throws/@return description is supposed to end with a period. This is a bit inconsistent across the Javadoc entries.

Image

@trancexpress trancexpress force-pushed the gh2588_with_api branch 2 times, most recently from 8aa8740 to 1771aa1 Compare March 31, 2026 08:20
@trancexpress trancexpress force-pushed the gh2588_with_api branch 3 times, most recently from 584c8e3 to 1e2f103 Compare March 31, 2026 08:32
Copy link
Copy Markdown
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

LGTM.

@iloveeclipse
Copy link
Copy Markdown
Member

@laeubi : anything else? If no, let's merge that.

Copy link
Copy Markdown
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

It looks all clean and consistent to me and adding only minimal and reusable API.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

@trancexpress trancexpress force-pushed the gh2588_with_api branch 2 times, most recently from a569970 to 86b0323 Compare March 31, 2026 09:19
Copy link
Copy Markdown
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

@trancexpress trancexpress force-pushed the gh2588_with_api branch 2 times, most recently from d360cdc to 3a5a9a3 Compare March 31, 2026 11:09
This change adds the following API:

* org.eclipse.core.resources.IFile.isContentRestricted()
* org.eclipse.core.resources.IFile.setContentRestricted(boolean)

The goal of this API is to allow Eclipse-based IDEs to restrict certain
platform functionality on a per-file basis, for sensitive files.

The flags are not persisted, to enable restricted handling
these flags must be set for each session.

The restrictions will apply to following functionality:

* File search
* Storing file history

Potentially more platform functionality will be restricted.

See: eclipse-platform#2588
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

@iloveeclipse
Copy link
Copy Markdown
Member

Thanks all (including Copilot :-)), merging.

@iloveeclipse iloveeclipse merged commit e85fd97 into eclipse-platform:master Mar 31, 2026
22 checks passed
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.

5 participants