Skip to content

Only allow canonical names when deserializing Capability#321

Open
stepancheg wants to merge 1 commit intoyouki-dev:mainfrom
stepancheg:deserialize-capability
Open

Only allow canonical names when deserializing Capability#321
stepancheg wants to merge 1 commit intoyouki-dev:mainfrom
stepancheg:deserialize-capability

Conversation

@stepancheg
Copy link
Copy Markdown
Contributor

@stepancheg stepancheg commented Mar 2, 2026

What type of PR is this?

/kind design

What this PR does / why we need it:

OCI spec, states:

Valid values are defined in the capabilities(7) man page, such as CAP_CHOWN.

So I believe deserializing Capability should not accept strings like sys_Admin for CAP_SYS_ADMIN.

If custom deserializer for capability is needed, it does not have to be a part of this crate.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

- `Deserialize` for `Capability` now only accepts canonical capability name

Signed-off-by: Stepan Koltsov <stepan.koltsov@gmail.com>
@stepancheg stepancheg force-pushed the deserialize-capability branch from 8c84b54 to e7b49a0 Compare March 2, 2026 04:22
@utam0k
Copy link
Copy Markdown
Member

utam0k commented Mar 10, 2026

So I believe deserializing Capability should not accept strings like sys_Admin for CAP_SYS_ADMIN.

That's right.

Copy link
Copy Markdown
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

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

LGTM but waiting for @saschagrunert's review because he introduced this logic in this PR #27.

@utam0k utam0k requested a review from saschagrunert March 10, 2026 12:34
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.

2 participants