movio / bramble

A federated GraphQL API gateway
https://movio.github.io/bramble/
MIT License
497 stars 53 forks source link

Plugin` configuration doesnt depend on config changes #176

Open ITheCorgi opened 1 year ago

ITheCorgi commented 1 year ago

Once plugin configuration was changed in bramble.json file, file watcher handles event and reload config in case of CREATE or CHANGE. But, for example auth plugin doesn`t depend on this reload process, as this object is constructed at the moment of starting Bramble (i tried to change Role section, bramble triggered event changes, but auth plugin was working under old role model)

ITheCorgi commented 1 year ago

I re-checked the process of auth plugin hot reload and figured out that the issue is during unmarshalling data json.RawMessage in case role was removed from Roles config

image

Suggest clearing a plugin` config at the start of configuring (commented line)

pkqk commented 1 year ago

Thanks for spotting the bug @ITheCorgi, would you like to make a PR of the change?

ITheCorgi commented 1 year ago

@pkqk Yeah, sure