confluentinc / confluentinc/vscode

Fix schema authz check for non-CCloud message viewer instances

Open
#958 0 comments 0 reactions 1 assignee Claimed by @shouples View on GitHub
direct connection/resources local connection/resources RBAC/authorization
Dominant language
TypeScript
Stars
34
Forks
17
Avg merge
1d 22h
Merged PRs (30d)
8

Description

https://github.com/confluentinc/vscode/pull/654 started using `LocalEnvironment`s and introduced `DirectEnvironment`s, but there is still an old leftover assumption that local Kafka topics don't have an associated `environmentId` (which is false, since they have the `vscode-local-connection` ID):
https://github.com/confluentinc/vscode/blob/aca3bf54df9828ee98b5b409e5bb3d156a7af619/src/authz/schemaRegistry.ts#L29-L48

So when opening message viewer for a local/direct Kafka topic, we see these in the logs:
```
no Schema Registry in extension state matching CCloud topic's environment ID; assuming user can access (non-existent) schemas { environmentId: "vscode-local-connection" / }
```

We need to update this to correctly handle local/direct environments and migrate it to using the appropriate ResourceLoader instances.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.