cube-js / cube-js/cube

feat: SQL API req.meta expose target dbname

Open
#10,934 4 comments 0 reactions 0 assignees View on GitHub
api:sql
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Is your feature request related to a problem? Please describe.**
We're currently implementing a multi-tenancy authorization scenario and would like to match the target database for a connection through SQL API to data contained in the JWT of the user. We're able to extract the claims from the token in our cube.js but the target dbname isn't available in the context.

**Describe the solution you'd like**
In addition to the existing metadata we propose to add also the dbname. This field is already stored in the session, but currently not exposed to req.meta

**Describe alternatives you've considered**
With the available metadata we were thinking about re-using the changeUser or applicationName. Nevertheless we think it would be beneficial to expose the intended target database on a separate optional field.

**Additional context**
I'll link a PR with a proposal for an implementation.

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.