Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does GetCapabilities() interact with authorization & unknown instance names? #215

Open
EdSchouten opened this issue Feb 24, 2022 · 3 comments

Comments

@EdSchouten
Copy link
Collaborator

EdSchouten commented Feb 24, 2022

  • Assume I have a build cluster that supports writes to the AC, but only to certain users/clients.
    • Is it permitted to return ActionCacheUpdateCapabilities that has update_enabled set to true for some of them, while returning false to ones that are unauthorized? Or should access controls have no influence in this matter?
    • Nit: What is the default value of update_enabled, in case action_cache_update_capabilities in ActionCacheUpdateCapabilities is not set? I assume false? Why isn't this boolean embedded into the parent directly?
  • Does the same hold for ExecutionCapabilities's exec_enabled field?
    • What does it mean if this field is not set? That it's unknown whether execution is supported?
  • Assume GetCapabilities() is called against an instance name that does not exist. Should an error be returned? If so, which one? NOT_FOUND or INVALID_ARGUMENT? Or is it allowed to succeed, returning a ServerCapabilities that has both execution_capabilities and cache_capabilities left unset?
  • What if the user is not authorized to interact with the instance name? Should we return PERMISSION_DENIED errors? This is in my opinion somewhat inconsistent with exec_enabled and update_enabled, as based on the previous questions those may also be used to convey authorization related decisions.

Long story short, I have the feeling that the semantics of the GetCapabilities() call are underspecified.

@bergsieker
Copy link
Collaborator

bergsieker commented Feb 24, 2022 via email

@EdSchouten
Copy link
Collaborator Author

I suspect that we may be able to make things clearer by embedding google.rpc.Status messages in there. For example, instead of having an update_enabled field that is a boolean, we could return a google.rpc.Status that indicates why a client won't be able to make AC updates. The same with execution: execution_capabilities could be placed in a oneof that gives a reason why remote execution can't be used.

Another thing I've observed to be impractical is that symlink_absolute_path_strategy is part of CacheCapabilities. You could argue that for a pure data store, it's irrelevant whether symlinks can contain absolute paths. This is more a limitation of remote execution, thereby making ExecutionCapabilities a better fit.

What are your thoughts on leaving this issue open, but rebranding it to be a "V3 idea" ticket?

@bergsieker
Copy link
Collaborator

I'm all for leaving this open and fixing in v3. I suspect we'll either eliminate the Capabilities API entirely in v3, or significantly overhaul it and possibly split it by associated service--the API as-written has never really lived up to its promise.

In terms of specifics (for future reference), I'm not wild about reusing google.rpc.Status within the response. That seems like we'd be reusing Status because it's convenient, not because it's a great fit. If we want more granular errors, I think we should define them ourselves.

I haven't given much thought to symlink_absolute_path_strategy. I think there's an inherent linkage between CacheCapabilities and ExecutionCapabilities. Possibly the right position, API-wise, is to include it in both. But let's deal with that in v3.

@bergsieker bergsieker added this to the Remote Execution API v3 milestone May 9, 2022
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

No branches or pull requests

2 participants