Skip to content

Comments

sync up with API PR changes#63

Merged
rgarcia merged 2 commits intomainfrom
updates
Aug 28, 2025
Merged

sync up with API PR changes#63
rgarcia merged 2 commits intomainfrom
updates

Conversation

@rgarcia
Copy link
Contributor

@rgarcia rgarcia commented Aug 28, 2025

the main / public Kernel API updates merged yesterday had some feedback on these endpoints--this syncs those changes in

I also filled out the implementation of process exec and added / refactored tests

https://github.com/onkernel/kernel/pull/416


TL;DR

Syncs API endpoints with recent public API updates and implements the process.exec endpoint, including support for running commands as a specific user.

Why we made these changes

To incorporate feedback and align with recent updates to the main public Kernel API.

What changed?

  • Updated openapi.yaml and the auto-generated oapi.go to match the latest public API contract.
  • Implemented the process.exec endpoint, adding logic to buildCmd to handle execution as root (AsRoot) or a specific user (AsUser).
  • Removed unsupported streaming-related code and comments from the ProcessExec endpoint.
  • Added new tests to verify the AsRoot and AsUser functionality and refactored existing tests using stretchr/testify.

Description generated by Mesa. Update settings

@rgarcia rgarcia requested a review from Sayan- August 28, 2025 13:40
Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

Performed full review of 5b79420...253b999

4 files reviewed | 1 comments | Review on Mesa | Edit Reviewer Settings

if gidStr != "" {
if gOverride, err := strconv.ParseUint(gidStr, 10, 32); err == nil {
gid64 = gOverride
}
Copy link

Choose a reason for hiding this comment

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

This logic silently ignores non-numeric group specifiers. If a user passes something like "1000:wheel", the "wheel" group name will be silently ignored rather than being looked up or causing an error. Consider either:

  1. Adding group name lookup similar to user lookup, or
  2. Returning an error for non-numeric gid overrides to make the behavior explicit
Suggested change
}
if gidStr != "" {
if gOverride, err := strconv.ParseUint(gidStr, 10, 32); err == nil {
gid64 = gOverride
} else {
return nil, fmt.Errorf("gid override must be numeric, got %q", gidStr)
}
}

Type: Logic | Severity: Medium

Copy link
Contributor

@Sayan- Sayan- left a comment

Choose a reason for hiding this comment

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

💯

@rgarcia rgarcia merged commit 330685e into main Aug 28, 2025
4 checks passed
@rgarcia rgarcia deleted the updates branch August 28, 2025 18:11
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