From 4997b7f1eefa9be950145c662fe307c6ca5b4f8f Mon Sep 17 00:00:00 2001 From: Alexandre Bourdin Date: Thu, 22 Aug 2024 16:25:00 +0200 Subject: [PATCH] Merge pull request #20062 from overleaf/ab-saas-authentication-module-renaming [web] Rename overleaf-integration module to saas-authentication GitOrigin-RevId: 7d69e06a19da9855fa9a0962114ad97b45ad8875 --- services/web/README.md | 10 +++++----- .../app/src/Features/TokenGenerator/TokenGenerator.js | 2 +- services/web/app/src/infrastructure/Features.js | 2 -- services/web/frontend/stylesheets/main-style.less | 2 +- .../{overleaf-integration.less => onboarding.less} | 0 services/web/scripts/backfill_users_sso_attribute.js | 2 +- services/web/scripts/check_saml_emails.js | 2 +- services/web/scripts/sso_id_migration_check.js | 2 +- services/web/scripts/sso_id_remove_not_migrated.js | 2 +- .../unit/src/Project/ProjectListControllerTests.js | 2 +- .../web/test/unit/src/infrastructure/FeaturesTests.js | 9 ++++----- 11 files changed, 16 insertions(+), 19 deletions(-) rename services/web/frontend/stylesheets/modules/{overleaf-integration.less => onboarding.less} (100%) diff --git a/services/web/README.md b/services/web/README.md index 9a92d51cfb..f82a55d6f2 100644 --- a/services/web/README.md +++ b/services/web/README.md @@ -28,7 +28,7 @@ make test To run both unit and acceptance tests for a module run: ``` -make test_module MODULE=overleaf-integration +make test_module MODULE=saas-authentication ``` ### Unit Tests @@ -51,12 +51,12 @@ make test_unit MOCHA_GREP='AuthorizationManager' To run only the unit tests for a single module do: ``` -make test_unit_module MODULE=overleaf-integration +make test_unit_module MODULE=saas-authentication ``` Module tests can also use a MOCHA_GREP argument: ``` -make test_unit_module MODULE=overleaf-integration MOCHA_GREP=SSO +make test_unit_module MODULE=saas-authentication MOCHA_GREP=SSO ``` ### Acceptance Tests @@ -87,12 +87,12 @@ make test_acceptance_run MOCHA_GREP='AuthorizationManager' To run only the acceptance tests for a single module do: ``` -make test_acceptance_module MODULE=overleaf-integration +make test_acceptance_module MODULE=saas-authentication ``` Module tests can also use a MOCHA_GREP argument: ``` -make test_acceptance_module MODULE=overleaf-integration MOCHA_GREP=SSO +make test_acceptance_module MODULE=saas-authentication MOCHA_GREP=SSO ``` Routes diff --git a/services/web/app/src/Features/TokenGenerator/TokenGenerator.js b/services/web/app/src/Features/TokenGenerator/TokenGenerator.js index 21f69cc5ec..b9ebf16574 100644 --- a/services/web/app/src/Features/TokenGenerator/TokenGenerator.js +++ b/services/web/app/src/Features/TokenGenerator/TokenGenerator.js @@ -68,7 +68,7 @@ const TokenGenerator = { function (cb) { const token = TokenGenerator.readOnlyToken() - if (!Features.hasFeature('overleaf-integration')) { + if (!Features.hasFeature('saas')) { return cb(null, token) } diff --git a/services/web/app/src/infrastructure/Features.js b/services/web/app/src/infrastructure/Features.js index 2236461eda..c449b263a8 100644 --- a/services/web/app/src/infrastructure/Features.js +++ b/services/web/app/src/infrastructure/Features.js @@ -69,8 +69,6 @@ const Features = { case 'affiliations': case 'analytics': return Boolean(_.get(Settings, ['apis', 'v1', 'url'])) - case 'overleaf-integration': - return Boolean(Settings.overleaf) case 'references': return Boolean(_.get(Settings, ['apis', 'references', 'url'])) case 'saml': diff --git a/services/web/frontend/stylesheets/main-style.less b/services/web/frontend/stylesheets/main-style.less index 1bcda9774b..4a48bc3597 100644 --- a/services/web/frontend/stylesheets/main-style.less +++ b/services/web/frontend/stylesheets/main-style.less @@ -156,7 +156,7 @@ @import 'modules/admin-panel.less'; @import 'modules/git-bridge-modal.less'; @import 'modules/group-settings.less'; -@import 'modules/overleaf-integration.less'; +@import 'modules/onboarding.less'; @import 'modules/writefull.less'; @import 'modules/third-party-references.less'; @import 'modules/labs.less'; diff --git a/services/web/frontend/stylesheets/modules/overleaf-integration.less b/services/web/frontend/stylesheets/modules/onboarding.less similarity index 100% rename from services/web/frontend/stylesheets/modules/overleaf-integration.less rename to services/web/frontend/stylesheets/modules/onboarding.less diff --git a/services/web/scripts/backfill_users_sso_attribute.js b/services/web/scripts/backfill_users_sso_attribute.js index 791979b14e..03ecf0666e 100644 --- a/services/web/scripts/backfill_users_sso_attribute.js +++ b/services/web/scripts/backfill_users_sso_attribute.js @@ -1,4 +1,4 @@ -const SAMLUserIdAttributeBatchHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdAttributeBatchHandler') +const SAMLUserIdAttributeBatchHandler = require('../modules/saas-authentication/app/src/SAML/SAMLUserIdAttributeBatchHandler') const startInstitutionId = parseInt(process.argv[2]) const endInstitutionId = parseInt(process.argv[3]) diff --git a/services/web/scripts/check_saml_emails.js b/services/web/scripts/check_saml_emails.js index 6146b8af9c..24d0a26f2f 100644 --- a/services/web/scripts/check_saml_emails.js +++ b/services/web/scripts/check_saml_emails.js @@ -2,7 +2,7 @@ process.env.MONGO_SOCKET_TIMEOUT = '300000' // Run all the mongo queries on secondaries process.env.MONGO_CONNECTION_STRING = process.env.READ_ONLY_MONGO_CONNECTION_STRING -const SAMLEmailBatchCheck = require('../modules/overleaf-integration/app/src/SAML/SAMLEmailBatchCheck') +const SAMLEmailBatchCheck = require('../modules/saas-authentication/app/src/SAML/SAMLEmailBatchCheck') const startInstitutionId = parseInt(process.argv[2]) const emitDetailedData = process.argv.includes('--detailed-data') diff --git a/services/web/scripts/sso_id_migration_check.js b/services/web/scripts/sso_id_migration_check.js index 20adc37325..077ca395c8 100644 --- a/services/web/scripts/sso_id_migration_check.js +++ b/services/web/scripts/sso_id_migration_check.js @@ -3,7 +3,7 @@ process.env.MONGO_CONNECTION_STRING = process.env.READ_ONLY_MONGO_CONNECTION_STRING const { waitForDb } = require('../app/src/infrastructure/mongodb') -const SAMLUserIdMigrationHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdMigrationHandler') +const SAMLUserIdMigrationHandler = require('../modules/saas-authentication/app/src/SAML/SAMLUserIdMigrationHandler') const institutionId = parseInt(process.argv[2]) if (isNaN(institutionId)) throw new Error('No institution id') diff --git a/services/web/scripts/sso_id_remove_not_migrated.js b/services/web/scripts/sso_id_remove_not_migrated.js index a63c5c2104..0e20f0b9cc 100644 --- a/services/web/scripts/sso_id_remove_not_migrated.js +++ b/services/web/scripts/sso_id_remove_not_migrated.js @@ -1,6 +1,6 @@ process.env.MONGO_SOCKET_TIMEOUT = '300000' const { waitForDb } = require('../app/src/infrastructure/mongodb') -const SAMLUserIdMigrationHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdMigrationHandler') +const SAMLUserIdMigrationHandler = require('../modules/saas-authentication/app/src/SAML/SAMLUserIdMigrationHandler') const institutionId = parseInt(process.argv[2]) if (isNaN(institutionId)) throw new Error('No institution id') diff --git a/services/web/test/unit/src/Project/ProjectListControllerTests.js b/services/web/test/unit/src/Project/ProjectListControllerTests.js index 0813200877..53c2b941c1 100644 --- a/services/web/test/unit/src/Project/ProjectListControllerTests.js +++ b/services/web/test/unit/src/Project/ProjectListControllerTests.js @@ -362,7 +362,7 @@ describe('ProjectListController', function () { this.institutionName = 'Overleaf' this.Features.hasFeature.withArgs('saml').returns(true) this.Features.hasFeature.withArgs('affiliations').returns(true) - this.Features.hasFeature.withArgs('overleaf-integration').returns(true) + this.Features.hasFeature.withArgs('saas').returns(true) done() }) it('should show institution SSO available notification for confirmed domains', function () { diff --git a/services/web/test/unit/src/infrastructure/FeaturesTests.js b/services/web/test/unit/src/infrastructure/FeaturesTests.js index 857249cc83..dcdf1e4e62 100644 --- a/services/web/test/unit/src/infrastructure/FeaturesTests.js +++ b/services/web/test/unit/src/infrastructure/FeaturesTests.js @@ -59,7 +59,7 @@ describe('Features', function () { expect(this.Features.hasFeature('homepage')).to.be.false expect(this.Features.hasFeature('link-url')).to.be.false expect(this.Features.hasFeature('oauth')).to.be.false - expect(this.Features.hasFeature('overleaf-integration')).to.be.false + expect(this.Features.hasFeature('saas')).to.be.false expect(this.Features.hasFeature('references')).to.be.false expect(this.Features.hasFeature('saml')).to.be.false expect(this.Features.hasFeature('templates-server-pro')).to.be.false @@ -72,7 +72,7 @@ describe('Features', function () { this.settings.apis = {} }) it('should return true', function () { - expect(this.Features.hasFeature('overleaf-integration')).to.be.true + expect(this.Features.hasFeature('saas')).to.be.true expect(this.Features.hasFeature('registration')).to.be.true }) it('should return false', function () { @@ -104,7 +104,7 @@ describe('Features', function () { it('should return true', function () { expect(this.Features.hasFeature('affiliations')).to.be.true expect(this.Features.hasFeature('analytics')).to.be.true - expect(this.Features.hasFeature('overleaf-integration')).to.be.true + expect(this.Features.hasFeature('saas')).to.be.true expect(this.Features.hasFeature('references')).to.be.true expect(this.Features.hasFeature('registration')).to.be.true }) @@ -135,8 +135,7 @@ describe('Features', function () { expect(this.Features.hasFeature('homepage')).to.be.true expect(this.Features.hasFeature('link-url')).to.be.true expect(this.Features.hasFeature('oauth')).to.be.true - expect(this.Features.hasFeature('overleaf-integration')).to.be - .true + expect(this.Features.hasFeature('saas')).to.be.true expect(this.Features.hasFeature('references')).to.be.true expect(this.Features.hasFeature('registration')).to.be.true expect(this.Features.hasFeature('saml')).to.be.true