Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for logging in as a guest #131

Merged
merged 41 commits into from
Nov 8, 2023
Merged

Conversation

simonbs
Copy link
Contributor

@simonbs simonbs commented Nov 7, 2023

Guests are invited through the Invite Guest GitHub action and will only have access to the specified repositories.

After inviting a guest they will receive an e-mail asking them to set a password. After doing that they can login with their e-mail and password.

Because guests do not have a personal access token for GitHub, we use the GitHub App to generate an installation token that is only valid for the repositories that the user needs access to. Each installation token is unique to a user and to their set of repositories.

Unfortunately, the PR is huge. There are several reasons for this. For one, adding a new authentication mechanism isn’t trivial but I’ve also refactored some types in an attempt to keep reduce the complexity of our codebase.

Some of these changes have already been extracted into other PRs, namely #125, #126, #127, #128, and #132. I might make an attempt to split up the PR even more but I’m unsure if it’s worth the effort. I think the most important thing is that I onboard at least one of you to the ideas in the codebase so you know how we authenticate guests and can provide feedback where needed.

@simonbs simonbs self-assigned this Nov 7, 2023
# Conflicts:
#	__test__/auth/HostAccessTokenService.test.ts
#	__test__/auth/HostCredentialsTransferrer.test.ts
#	__test__/projects/CachingProjectDataSource.test.ts
#	src/common/keyValueStore/index.ts
#	src/common/mutex/index.ts
#	src/common/session/Auth0Session.ts
#	src/common/session/index.ts
#	src/common/utils/index.ts
#	src/composition.ts
#	src/features/auth/data/GitHubOAuthTokenRefresher.ts
#	src/features/auth/data/index.ts
#	src/features/auth/domain/accessToken/index.ts
#	src/features/auth/domain/credentialsTransfer/index.ts
#	src/features/auth/domain/index.ts
#	src/features/auth/domain/logIn/index.ts
#	src/features/auth/domain/logOut/index.ts
#	src/features/auth/domain/oAuthToken/index.ts
#	src/features/hooks/domain/index.ts
#	src/features/projects/data/GitHubProjectDataSource.ts
#	src/features/projects/data/index.ts
#	src/features/projects/data/useProjects.ts
#	src/features/projects/domain/ProjectRepository.ts
#	src/features/projects/domain/SessionValidatingProjectDataSource.ts
#	src/features/projects/domain/index.ts
# Conflicts:
#	src/common/session/index.ts
#	src/composition.ts
@simonbs simonbs mentioned this pull request Nov 8, 2023
@ulrikandersen ulrikandersen self-requested a review November 8, 2023 12:39
@simonbs simonbs merged commit aec64eb into develop Nov 8, 2023
3 checks passed
@simonbs simonbs deleted the enhancement/guest-login branch November 8, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants