sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

Code Insights: Add API guards on the backend for limited access mode #38134

Open vovakulikov opened 2 years ago

vovakulikov commented 2 years ago

Background

At the moment Code Insights pages have two modes

At the moment the second mode is implemented only on the frontend (by fetching information about user license and having a dozen FE checks based on this information) in a meantime our API is still providing insight information even if users don't have a license.

Why do we need this change?

Since code insights is a paid part of the product we need to close API endpoints from users who don't have a special license for it, this move also will give us benefits in terms of complexity on the FE which is important if we want to spread insights UI across of the app.

sourcegraph-bot-2 commented 2 years ago

Heads up @joelkw @felixfbecker @vovakulikov @unclejustin - the "team/code-insights" label was applied to this issue.