Skip to content

docs: update resource URI and add plugin support#1468

Open
fitzthum wants to merge 5 commits into
confidential-containers:mainfrom
fitzthum:plugin-scheme
Open

docs: update resource URI and add plugin support#1468
fitzthum wants to merge 5 commits into
confidential-containers:mainfrom
fitzthum:plugin-scheme

Conversation

@fitzthum
Copy link
Copy Markdown
Member

Update the resource URI doc and add support for plugins.

Specifically, let's allow the scheme to be something like kbs+plugin://. This seems pretty reasonable and is backwards compatible.

If this looks good, I will add some commits to actually implement the change.

Our resource URI doc is out-of-date.

Let's update it to reflect how we actually use resource URIs and to
clarify the relationship between resource URIs and the KBS API. This has
confused a number of people in the past.

Also, let's introduce a mechanism for specifying the plugin in the
resource URI.
Specifically, let's allow people to specify the plugin in the scheme.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
@fitzthum fitzthum requested a review from a team as a code owner May 12, 2026 20:33
@fitzthum fitzthum marked this pull request as draft May 12, 2026 20:33
Comment on lines +54 to +58
### Repository, Type, and Tag

Currently resource URIs have three levels of identifiers/scope.
The terms `repository`, `type`, and `tag` are somewhat arbitrary.
These identifiers can be used in any way.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's resource plugin-specific and no requirements on other plugins

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.

yeah, I was also thinking whether it is a good idea to require the same path segment for every plugin, for some this hierarchy might just not make any sense. but it keeps implementation complexity at bay for now and that requirement can be relaxed later once it becomes a nuisance

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes - and there is already some implementations that do not follow this, e.g. pkcs11

Copy link
Copy Markdown
Member Author

@fitzthum fitzthum May 13, 2026

Choose a reason for hiding this comment

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

Yes, we need to clarify this. Currently you cannot access the pkcs11 plugin via the resource uri, which is essentially a bug imo. I am open to allowing arbitrary length requests, like we do with rv uris, but that is not how the resource uri works today.

A Resource URI must comply with the following format:

```plaintext
kbs+<plugin>://<kbs_host>:<kbs_port>/<repository>/<type>/<tag>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like this design

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.

The asymmetry here is that with kbs+<plugin>:// callers need to know the resource is provided by <plugin> but with the resource plugin, they have no way to say the resources comes from vault.

How the plugin URIs can be supported with api-server-rest queries?

Copy link
Copy Markdown
Member

@Xynnn007 Xynnn007 May 13, 2026

Choose a reason for hiding this comment

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

vault is not a plugin level conception, but a resource plugin level. Thus it's expected that the caller does not know that.

for ASR, currently is 127.0.0.1:8006/cdh/resource/.... we could generize it as 127.0.0.1:8006/cdh/<plugin-in-name>/... for kbs+<plugin-in-name>:///...

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.

I would also that the caller doesn't get to request a concrete backing store for their resource is (say, vault or filesystem), this is up to the KBS, no?

I also like this URI scheme 👍

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.

vault is not a plugin level conception, but a resource plugin level.

yup, my comment was just that the implementation detail is visible to the user and they don't necessarily understand: why kbs+pcks11:// is needed but kbs+vault:// is not.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the pkcs11 apis are different from the vaults. see https://github.com/confidential-containers/trustee/blob/main/kbs/src/plugins/implementations/pkcs11.rs#L135 for example wrap-key

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, also worth noting that the resource plugin only supports one storage backend anyway.

A Resource URI must comply with the following format:

```plaintext
kbs+<plugin>://<kbs_host>:<kbs_port>/<repository>/<type>/<tag>
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.

I would also that the caller doesn't get to request a concrete backing store for their resource is (say, vault or filesystem), this is up to the KBS, no?

I also like this URI scheme 👍

Comment on lines +54 to +58
### Repository, Type, and Tag

Currently resource URIs have three levels of identifiers/scope.
The terms `repository`, `type`, and `tag` are somewhat arbitrary.
These identifiers can be used in any way.
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.

yeah, I was also thinking whether it is a good idea to require the same path segment for every plugin, for some this hierarchy might just not make any sense. but it keeps implementation complexity at bay for now and that requirement can be relaxed later once it becomes a nuisance


* `kbs://example.cckbs.org:8081/alice/decryption-key/1`
* `kbs:///a/b/c`
* `kbs+pkcs11:///a/b/c`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

btw the original resource URI could also support query string, like kbs+plugin1://a/b/c?d=e

@Xynnn007
Copy link
Copy Markdown
Member

btw, confidential-containers/trustee#1305 needs POST and DELETE method. So the concrete implementation should care about this.

fitzthum added 4 commits May 14, 2026 13:14
Allow the plugin to be specifid as part of the scheme.

For example, kbs+plugin:///a/b/c

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
Fixup a couple of checks based on the scheme to allow for plugins

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
The keyprovider does some manipulation of the resource uri. Update this
so that it will work if the uri specifies a plugin.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
Allow plugins in the resource uri scheme

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
@fitzthum fitzthum marked this pull request as ready for review May 14, 2026 21:00
@fitzthum
Copy link
Copy Markdown
Member Author

Added implementation. PTAL

note that I am not touching the ASR in this PR. We will still have a gap there. Currently you can make a request via the ASR like this

curl http://127.0.0.1:8006/cdh/resource/default/key/1

I don't think we can make that work with plugins so probably we should add a new endpoint like

curl http://127.0.0.1:8006/cdh/plugin/<plugin-name>/a/b/c

But that is still a bit limited. Open to suggestions here. Probably will address in a follow-up rather than this one.

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.

4 participants