kubeshop / monokle-core

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

Authenticator doesn't react on external auth file changes #524

Open f1ames opened 1 year ago

f1ames commented 1 year ago

Authenticator (part of synchronizer package) stores auth data in a dedicated file. This file is updated when user state changes (login / logout / token refresh) and then in-memory user state is reloaded. This means that any external changes to a file will not be reflected.

This is visible when multiple instance which share same auth file are running, e.g. two instances of VSC with Monokle extension or CLI + Monokle VSC ext.

Example repro steps:

  1. Launch tow instances of VSC with monokle extension running.
  2. Run Monokle: Login in one of them and finish login process.

The instance in which Monokle: Login was run will be authenticated while the other one won't be. There is no reasonable workaround apart from reloading VSC window (so it will ready auth file again on initialization) or running Monokle: Login there two.

I think authenticator should watch auth file and react on external changes too.