lostintangent / spaces

Discover, share, and connect with developers across your favorite teams, classrooms and communities
https://aka.ms/vsls-spaces
MIT License
34 stars 3 forks source link

[auth]: add authentication #59

Closed legomushroom closed 5 years ago

legomushroom commented 5 years ago
  1. Adds the required Bearer auth strategy service API to the endpoints.
  2. Adds the AAD JWT verification logic.
  3. Adds the Cascade JWT verification logic.
  4. Moves the extension to use the @vs/vscode-account module for authentication to share the access tokens with Live Share.

Still waits on:

  1. Live Share change and release to reuse the auth strategies used by Live Share.
arjunattam commented 5 years ago

looks awesome! would we want auth on the websocket?

also, couple of very minor things

legomushroom commented 5 years ago

@arjun27 @lostintangent added the Cascade token validation, now the user will be able to use any (ms/gh) account thru live share. Also addressed some feedback please take a look.

Re the WS auth, what are we using the WS for at the moment?

arjunattam commented 5 years ago

Re the WS auth, what are we using the WS for at the moment?

We're using the websocket transport that comes with cowboy (webserver for elixir) – cowboy is also listening for http. We could de-prioritize gating on websocket, at least till we implement private communities (#45)

Code for websocket, on the service, in case you want to review: https://github.com/vsls-contrib/communities/blob/master/service/lib/communities/websocket.ex

legomushroom commented 5 years ago

@arjun27 ya, but what scenarios we are using the WS for?

arjunattam commented 5 years ago

what scenarios we are using the WS for?

The websocket delivers real-time updates for: changes to the communities the user is a member of (member added/removed, founder changed), and new requests and messages in these communities

legomushroom commented 5 years ago

@arjun27 I see, thanks. Sounds like we do want to restrict those also. Maybe not in this PR though.