kubeshop / monokle-core

Monokle validation engine, CLI and shared UI components
MIT License
18 stars 3 forks source link

Handle multiple origins in authenticator #574

Open f1ames opened 11 months ago

f1ames commented 11 months ago

As described in https://github.com/kubeshop/monokle-saas/issues/2231:

Origin conflict between integration - when CLI logged in to enterprise, VSC ext will try to use those auth credentials (e.g. refresh token) for default origin (if not yet changed).

This is cumbersome in cases where I first login in with CLI and then start VSC (with Monokle ext) or when I will set origin in one workspace and then switch VSC to another project with different origin. Invalid token error occurs during extension initialization and it won't simply start which is quite an issue.

The idea is to store multiple origins in auth storage and make authenticator origin aware (so it knows which origin auth data to use). Also we will need to version auth data so authenticator know that it gets previous format and can either clean auth storage or migrate to new format without erroring.

Initial workaround was applied in #573.