Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Redirect starter links to the desired integration manager #1342

Closed
wants to merge 4 commits into from

Conversation

turt2live
Copy link
Member

When Scalar is not the integrations manager for Riot, the scalar_token is unlikely to be valid for scalar.vector.im. This can lead to authentication problems, particularly with setting up the Github bot.

Instead, Riot should redirect the starter link to the chosen integrations manager. This means the integrations manager is responsible for maintaining the route, much like with the register route.

This change only changes the link if it starts with the REST API route for Scalar. This is to ensure that starter links not using an integrations manager can still function, if they exist in the wild.

When not using Scalar for the integrations manager, the scalar_token in Riot may not be valid for scalar.vector.im, leading to authentication problems. Starter links should instead point to the desired integrations manager where the token is more likely to be valid.

Signed-off-by: Travis Ralston <travpc@gmail.com>
@ara4n
Copy link
Member

ara4n commented Sep 17, 2017

@lukebarnard1, @rxl881, any thoughts on how this should actually be done? Given we have multiple scalar deployments flying around the place, special-casing the one at scalar.vector.im/api in the riot-web codebase doesn't smell right...

@turt2live
Copy link
Member Author

It might be better to define a spec for basic integration server operations. Such as the /api/regiser route and possible routes for handling starter links. Starter links could also have an event structure that indicates whether it is the integration manager's job to handle the link, or to proxy it to somewhere else that will take care of it.

@lukebarnard1
Copy link
Contributor

lukebarnard1 commented Sep 18, 2017

I think the starter link URL in the starter link events should only include the path (i.e. one route for all starter links) but the domain should be the configured integration manager.

Unless an explicit URL is given, then we'll just use that.

Signed-off-by: Travis Ralston <travpc@gmail.com>
@turt2live
Copy link
Member Author

@ara4n @lukebarnard1 @rxl881 I've updated this to implement @lukebarnard1's suggestion.

go-neb would need updates to ensure it's not spamming out absolute URLs, which this PR will still accept at risk of the scalar_token not being applicable to that URL (ie: Dimension tokens not working on scalar.riot.im).

However, there's still the problem where third party integration managers can't communicate with go-neb instances hosted elsewhere, like on matrix.org. As far as I can tell, the /admin/requestAuthSession route is not accessible anywhere, and the realm information isn't known. In terms of a spec, the starter_link should probably also have a realm ID and URL to where an auth session can be requested.

@dbkr
Copy link
Member

dbkr commented Jan 4, 2018

@ara4n @lukebarnard1 @rxl881 prod?

@rxl881
Copy link
Contributor

rxl881 commented Jan 11, 2018

@turt2live, @dbkr -- Sorry for sitting on this one for a while. This is still very much on my radar, but I've not had a chance to look in to all the potential impacts and work needed for scalar and goneb yet. I'm hoping to get to this next week and will update asap.

@lukebarnard1 lukebarnard1 removed their assignment Jan 22, 2018
@turt2live
Copy link
Member Author

@rxl881 any news?

@turt2live
Copy link
Member Author

Closing this while I think about how this should work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants