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

feat: SSO (Single Sign-On) support #2693

Merged
merged 203 commits into from
Dec 10, 2024

fix: avoid using tenant repository instead of service

d7f535a
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

feat: SSO (Single Sign-On) support #2693

fix: avoid using tenant repository instead of service
d7f535a
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test report for server-app:runWebsocketTests succeeded Dec 4, 2024 in 0s

165 passed, 0 failed and 0 skipped

Tests passed successfully

Report Passed Failed Skipped Time
backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.batch.BatchJobsGeneralWithoutRedisTest.xml 11✅ 21s
backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.batch.BatchJobsGeneralWithRedisTest.xml 12✅ 29s
backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.websocket.WebsocketWithoutRedisTest.xml 5✅ 3s
backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.websocket.WebsocketWithRedisTest.xml 5✅ 4s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.AdvancedPermissionControllerTest.xml 13✅ 9s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.AiPromptCustomizationControllerTest.xml 5✅ 1s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.ContentStorageControllerTest.xml 11✅ 4s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.EeLicenseControllerTest.xml 6✅ 1s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.slack.OrganizationSlackControllerTest.xml 4✅ 1s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.slack.SlackLoginControllerTest.xml 4✅ 992ms
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.SsoProviderControllerTest.xml 7✅ 1s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerActivityTest.xml 5✅ 2s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerAssigneesTest.xml 6✅ 2s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerBlockedTest.xml 1✅ 238ms
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerPermissionsTest.xml 5✅ 2s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerTest.xml 18✅ 5s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.V2ProjectsInvitationControllerEeTest.xml 5✅ 1s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.WebhookConfigControllerTest.xml 7✅ 2s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.EeTolgeeTranslatorControllerTest.xml 1✅ 3s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.service.EeSubscriptionProviderImplTest.xml 2✅ 2s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.service.slack.SavedSlackMessageServiceTest.xml 2✅ 415ms
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.service.slack.SlackConfigServiceTest.xml 2✅ 431ms
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.slack.SlackIntegrationTest.xml 4✅ 3s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.slack.SlackWithAutoTranslationTest.xml 2✅ 5s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.SsoGlobalTest.xml 8✅ 4s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.SsoOrganizationsTest.xml 10✅ 3s
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.UsageReportingTest.xml 1✅ 417ms
ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.UserLimitTest.xml 3✅ 1s

✅ backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.batch.BatchJobsGeneralWithoutRedisTest.xml

11 tests were completed in 21s with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.batch.BatchJobsGeneralWithoutRedisTest 11✅ 21s

✅ io.tolgee.batch.BatchJobsGeneralWithoutRedisTest

✅ it locks the single job for project()
✅ debounces job()
✅ doesn't lock non-exclusive job()
✅ cancels the job()
✅ retries failed with generic exception()
✅ retries failed with RequeueWithTimeoutException()
✅ correctly reports failed test when FailedDontRequeueException thrown()
✅ executes operation()
✅ retries and fails on management exceptions issues()
✅ publishes progress of single chunk job()
✅ retrying works with error keys()

✅ backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.batch.BatchJobsGeneralWithRedisTest.xml

12 tests were completed in 29s with 12 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.batch.BatchJobsGeneralWithRedisTest 12✅ 29s

✅ io.tolgee.batch.BatchJobsGeneralWithRedisTest

✅ it locks the single job for project()
✅ debounces job()
✅ doesn't lock non-exclusive job()
✅ cancels the job()
✅ retries failed with generic exception()
✅ retries failed with RequeueWithTimeoutException()
✅ correctly reports failed test when FailedDontRequeueException thrown()
✅ executes operation()
✅ retries and fails on management exceptions issues()
✅ publishes progress of single chunk job()
✅ retrying works with error keys()
✅ removes from queue using event()

✅ backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.websocket.WebsocketWithoutRedisTest.xml

5 tests were completed in 3s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.websocket.WebsocketWithoutRedisTest 5✅ 3s

✅ io.tolgee.websocket.WebsocketWithoutRedisTest

✅ notifies on key modification()
✅ doesn't subscribe without permissions()
✅ notifies on key deletion()
✅ notifies on key creation()
✅ notifies on translation modification()

✅ backend/app/build/test-results/runWebsocketTests/TEST-io.tolgee.websocket.WebsocketWithRedisTest.xml

5 tests were completed in 4s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.websocket.WebsocketWithRedisTest 5✅ 4s

✅ io.tolgee.websocket.WebsocketWithRedisTest

✅ notifies on key modification()
✅ doesn't subscribe without permissions()
✅ notifies on key deletion()
✅ notifies on key creation()
✅ notifies on translation modification()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.AdvancedPermissionControllerTest.xml

13 tests were completed in 9s with 13 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.AdvancedPermissionControllerTest 13✅ 9s

✅ io.tolgee.ee.api.v2.controllers.AdvancedPermissionControllerTest

✅ validates permissions (empty scopes)()
✅ view contains at least the scopes from translate and state change()
✅ sets user's permissions with translateLanguages and view ()
✅ validates permissions (admin and viewLanguages)()
✅ validates permissions (translate languages and scopes)()
✅ validates permissions (admin and stateChangeLanguages)()
✅ validates permissions (view languages and scopes)()
✅ cannot set organization base permission with scopes when disabled()
✅ validates permissions (state change languages and scopes)()
✅ goes from scopes to type and from type to scopes()
✅ fails to set user's permission when feature disabled()
✅ sets organization base permission with scopes()
✅ validates permissions (admin and translateLanguages)()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.AiPromptCustomizationControllerTest.xml

5 tests were completed in 1s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.AiPromptCustomizationControllerTest 5✅ 1s

✅ io.tolgee.ee.api.v2.controllers.AiPromptCustomizationControllerTest

✅ get language prompt customizations()
✅ set project prompt customization fails when feature is not enabled()
✅ set language prompt customization()
✅ get project prompt customization()
✅ set project prompt customization()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.ContentStorageControllerTest.xml

11 tests were completed in 4s with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.ContentStorageControllerTest 11✅ 4s

✅ io.tolgee.ee.api.v2.controllers.ContentStorageControllerTest

✅ deletes an storage()
✅ tests azure storage()
✅ lists storages()
✅ validates Azure Config storage()
✅ deletes not delete when in use()
✅ creates Content Storage()
✅ updates Content Storage to the same type()
✅ updates Content Storage()
✅ tests s3 storage()
✅ tests new configuration for existing azure storage()
✅ returns single storage()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.EeLicenseControllerTest.xml

6 tests were completed in 1s with 6 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.EeLicenseControllerTest 6✅ 1s

✅ io.tolgee.ee.api.v2.controllers.EeLicenseControllerTest

✅ prepare operation works fine()
✅ releases license key info()
✅ refreshes subscription()
✅ it set's license key()
✅ set license key operation is not sensitive for non-breaking API change()
✅ returns info()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.slack.OrganizationSlackControllerTest.xml

4 tests were completed in 1s with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.slack.OrganizationSlackControllerTest 4✅ 1s

✅ io.tolgee.ee.api.v2.controllers.slack.OrganizationSlackControllerTest

✅ get all works()
✅ delete one works()
✅ connection works()
✅ fail if connect and already have connection()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.slack.SlackLoginControllerTest.xml

4 tests were completed in 992ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.slack.SlackLoginControllerTest 4✅ 992ms

✅ io.tolgee.ee.api.v2.controllers.slack.SlackLoginControllerTest

✅ logs in for same Tolgee acc and different workspace()
✅ user logs in()
✅ should not allow duplicate SlackUserConnection for same Tolgee account and workspace()
✅ should not allow duplicate SlackUserConnection for same Tolgee account and workspace and different Slack acc()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.SsoProviderControllerTest.xml

7 tests were completed in 1s with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.SsoProviderControllerTest 7✅ 1s

✅ io.tolgee.ee.api.v2.controllers.SsoProviderControllerTest

✅ does not allow to save invalid sso provider #1()
✅ does not allow to save invalid sso provider #2()
✅ does not allow to save invalid sso provider #3()
✅ does not allow to save invalid sso provider #4()
✅ creates and returns sso provider()
✅ fails if user is not owner of organization()
✅ always creates sso provider when disabled()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerActivityTest.xml

5 tests were completed in 2s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.task.TaskControllerActivityTest 5✅ 2s

✅ io.tolgee.ee.api.v2.controllers.task.TaskControllerActivityTest

✅ logs task update()
✅ large scope change is doesn't cause n+1 issue()
✅ logs task key done()
✅ logs assignees when creating task()
✅ scope change is logged()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerAssigneesTest.xml

6 tests were completed in 2s with 6 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.task.TaskControllerAssigneesTest 6✅ 2s

✅ io.tolgee.ee.api.v2.controllers.task.TaskControllerAssigneesTest

✅ user tasks filter by type()
✅ properly excludes user with view rights()
✅ user tasks()
✅ properly excludes users without view rights for english()
✅ user tasks filter by assignee()
✅ properly includes user with view rights()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerBlockedTest.xml

1 tests were completed in 238ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.task.TaskControllerBlockedTest 1✅ 238ms

✅ io.tolgee.ee.api.v2.controllers.task.TaskControllerBlockedTest

✅ detects blocked task()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerPermissionsTest.xml

5 tests were completed in 2s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.task.TaskControllerPermissionsTest 5✅ 2s

✅ io.tolgee.ee.api.v2.controllers.task.TaskControllerPermissionsTest

✅ can do assigned task's basic operations()
✅ sees only tasks assigned to him()
✅ can access assigned task()
✅ can't access unassigned review task's data()
✅ can't do advanced assigned task's operations()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.task.TaskControllerTest.xml

18 tests were completed in 5s with 18 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.task.TaskControllerTest 18✅ 5s

✅ io.tolgee.ee.api.v2.controllers.task.TaskControllerTest

✅ project tasks filter by type()
✅ creates new task()
✅ can add keys()
✅ fails to create task with language from different project()
✅ can remove keys()
✅ fails when updating assignees to non-members()
✅ returns list of tasks()
✅ includes keys included in task of different type()
✅ updates existing task()
✅ calculates stats()
✅ gets task detail()
✅ project tasks filter by assignee()
✅ calculates stats for task()
✅ doesn't include keys which are in different task of same type()
✅ creates multiple new tasks()
✅ close and reopen task()
✅ project tasks()
✅ fails to create task with assignee from different project()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.V2ProjectsInvitationControllerEeTest.xml

5 tests were completed in 1s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.V2ProjectsInvitationControllerEeTest 5✅ 1s

✅ io.tolgee.ee.api.v2.controllers.V2ProjectsInvitationControllerEeTest

✅ fails when feature disabled()
✅ invites user to project with scopes()
✅ adds the languages to view()
✅ validates language permissions()
✅ validates permissions (type vs scopes)()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.api.v2.controllers.WebhookConfigControllerTest.xml

7 tests were completed in 2s with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.api.v2.controllers.WebhookConfigControllerTest 7✅ 2s

✅ io.tolgee.ee.api.v2.controllers.WebhookConfigControllerTest

✅ doesnt create multiple webhooks without feature enabled()
✅ creates webhook config()
✅ get single webhook config()
✅ lists webhook configs()
✅ deletes webhook config()
✅ tests a config()
✅ updates webhook config()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.EeTolgeeTranslatorControllerTest.xml

1 tests were completed in 3s with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.EeTolgeeTranslatorControllerTest 1✅ 3s

✅ io.tolgee.ee.EeTolgeeTranslatorControllerTest

✅ it translates()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.service.EeSubscriptionProviderImplTest.xml

2 tests were completed in 2s with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.service.EeSubscriptionProviderImplTest 2✅ 2s

✅ io.tolgee.ee.service.EeSubscriptionProviderImplTest

✅ cancels subscription when other instance uses the key()
✅ it checks for subscription changes()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.service.slack.SavedSlackMessageServiceTest.xml

2 tests were completed in 415ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.service.slack.SavedSlackMessageServiceTest 2✅ 415ms

✅ io.tolgee.ee.service.slack.SavedSlackMessageServiceTest

✅ deletes old messages()
✅ finds messages()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.service.slack.SlackConfigServiceTest.xml

2 tests were completed in 431ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.service.slack.SlackConfigServiceTest 2✅ 431ms

✅ io.tolgee.ee.service.slack.SlackConfigServiceTest

✅ deletes configs()
✅ creates new config()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.slack.SlackIntegrationTest.xml

4 tests were completed in 3s with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.slack.SlackIntegrationTest 4✅ 3s

✅ io.tolgee.ee.slack.SlackIntegrationTest

✅ sends message to correct channel after translation changed()
✅ Doesn't send a message if the subscription isn't global and modified language isn't in preferred languages()
✅ sends message to correct channel after key added()
✅ Doesn't send a message if the event isn't in subscribed by user()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.slack.SlackWithAutoTranslationTest.xml

2 tests were completed in 5s with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.slack.SlackWithAutoTranslationTest 2✅ 5s

✅ io.tolgee.ee.slack.SlackWithAutoTranslationTest

✅ sends auto translated text on a new key added with base translation()
✅ sends auto translated text when base provided (non-existing)()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.SsoGlobalTest.xml

8 tests were completed in 4s with 8 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.SsoGlobalTest 8✅ 4s

✅ io.tolgee.ee.SsoGlobalTest

✅ sso auth saves refresh token()
✅ creates new user account and return access token on sso log in()
✅ does not return auth link when tenant is disabled()
✅ user account available validation works()
✅ doesn't authorize user when token exchange fails()
✅ does not auth user when tenant is disabled()
✅ sso auth works via global config()
✅ after timeout should call token endpoint ()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.SsoOrganizationsTest.xml

10 tests were completed in 3s with 10 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.SsoOrganizationsTest 10✅ 3s

✅ io.tolgee.ee.SsoOrganizationsTest

✅ sso auth saves refresh token()
✅ new user belongs to organization associated with the sso issuer()
✅ creates new user account and return access token on sso log in()
✅ does not return auth link when tenant is disabled()
✅ user account available validation works()
✅ sso user can't create organization()
✅ doesn't authorize user when token exchange fails()
✅ does not auth user when tenant is disabled()
✅ sso auth doesn't create demo project and user organization()
✅ after timeout should call token endpoint ()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.UsageReportingTest.xml

1 tests were completed in 417ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.UsageReportingTest 1✅ 417ms

✅ io.tolgee.ee.UsageReportingTest

✅ it checks for subscription changes()

✅ ee/backend/tests/build/test-results/test/TEST-io.tolgee.ee.UserLimitTest.xml

3 tests were completed in 1s with 3 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
io.tolgee.ee.UserLimitTest 3✅ 1s

✅ io.tolgee.ee.UserLimitTest

✅ can delete users when over plan()
✅ cannot create 11th user()
✅ can disable users when over plan()