late-tiger-78467
07/31/2022, 11:53 PMAdd*Handler
func was provided in the interfaces, I feel, semantically, the handlers don't fit a configuration parameter.
2. Modify the Compose
functions to take in Configurator
and not fosite.Config
- https://github.com/ory/fosite/blob/master/compose/compose.go#L55. The current approach implies that any implementer of Fosite has to use fosite.Config
instead of building on the interface with their own Configurator implementation that they pass around. In my case, for example, I would love to use my own MultiTenantConfig
implementation of Configurator that is able to support multi-tenancy. The tenant context is embedded in the Go context. The alternative is writing your own Compose, which I feel isn't necessary with a small change - as highlighted in 1.
Please let me know your thoughts. I am happy to submit a PR with any changes that you think makes sense.high-optician-2097
late-tiger-78467
08/01/2022, 7:04 AMhigh-optician-2097
late-tiger-78467
08/01/2022, 7:12 AMcompose
takes in *fosite.Config
as a parameter and not Configurator. It does so because it needs to directly update the array of handlers.
I am proposing that we add a function to add handlers rather than directly interact with the fosite.Config object. With this the compose
function would take in the Configurator and not fosite.Configlate-tiger-78467
08/01/2022, 7:14 AMhigh-optician-2097
late-tiger-78467
08/01/2022, 9:14 AMcompose
func contract. But on the flip side, if I plan to use a different config object, I can choose not to use compose at all and to pre-populate the handlers however I wish, so this isn't game-breaking for me.
I just felt that handlers don't make sense as config because they are the capabilities available in the OAuth provider which would be pre-determined. I wasn't quite sure why they would need to be hot-reloaded.