Skip to content

Commit

Permalink
chore(release): Test v7.20.0 (#9488)
Browse files Browse the repository at this point in the history
* chore(env vars): Stripe vars moved to the Integrations section (#9427)

* chore: fix misleading `isLead` field name on `Team` (#9413)

* chore: fix misleading `isLead` field name on `Team`

The field indicates whether the viewer is the lead, but when used in a
query for a different user, the result could be read wrong.

* Fix Team.isLead dependencies

* feat: remove team template limit (#9424)

* update error message and increase template limit

* remove max team template limits

* remove canClone prop from CloneTemplate

* remove unused threshold

* remove unused threshold

* feat: Add Google calendar meeting series for recurrence (#9380)

* feat: Add recurrence to GCal events

* Fun with timezones

* fix: Increase the number of projects fetched per request from Atlassian (#9435)

We ran into timeouts in `getAllProjects`, presumably because we're doing
too many roundtrips. As a quick fix, increse the number of projects
fetched per request from 50 to 500.

* chore(deps): bump ip from 1.1.8 to 1.1.9 (#9442)

Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.8...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(release): release v7.17.0 (#9428)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* feat(standalone-deployment): Standalone host deployment improved and documented (#9445)

* Docker compose stack improved

* Remove unused containers from docker-compse and add useful comment on .env.example about PGSSLMODE

* Docker compose profiles added. Documentation extended on how to use the profiles to manage the stack.

* README fixed as docker compose up and down commands were not working

* Typo fixed and docker-compose command replaced by docker compose

* feat: support env-defined saml issuer for PPMIs (#9455)

* feat: support env-defined saml issuer for PPMIs

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* feat: support single SAML for entire tenant

Signed-off-by: Matt Krick <matt.krick@gmail.com>

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore: Associate logs with traces (#9444)

* chore: Associate logs with traces

Add trace information to log output for server side log statements. This
does not include logging from code exclusively used for debugging,
deploying or development.

* Actually add the logger

* Fix DD_LOGS_INJECTION check

* chore(release): release v7.18.0 (#9450)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* chore: no force-push to prod (#9401)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.18.1 (#9459)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* feat: embedder service (#9417)

* feat: add embedder service

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>

* merge production to avoid force push (#9461)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.0 (#9460)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: checkout prod before merging it (#9463)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.1 (#9464)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: mrege origin/production strategy (#9465)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.2 (#9466)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: force push 5 (#9467)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.19.3 (#9468)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: limit invites from spammers (#9416)

* fix: limit invites from spammers

* update where we check pending emails

* check total plus pending invites

* use invitees instead of pending

* fix: Fetch Jira projects in parallel (#9456)

Previously we tried to fetch more projects per page, but Jira only ever
returns 50 max. Instead once we know how many projects there are after
fetching the first page, we fetch all remaining pages in parallel.

* fix: replace lone surrogates in draft-js content (#9415)

* fix: replace lone surrogates in draft-js content

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* fix typo

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* fix: eslint errors

Signed-off-by: Matt Krick <matt.krick@gmail.com>

---------

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(deps): bump es5-ext from 0.10.62 to 0.10.64 (#9457)

Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](medikoo/es5-ext@v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: packages/server/package.json to reduce vulnerabilities (#9434)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-UNDICI-6252336

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* fix: packages/server/package.json to reduce vulnerabilities (#9392)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-NODEMAILER-6219989

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* fix: packages/server/package.json to reduce vulnerabilities (#9298)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-FOLLOWREDIRECTS-6141137

Co-authored-by: snyk-bot <snyk-bot@snyk.io>

* chore(deps): bump follow-redirects from 1.14.8 to 1.15.4 (#9312)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.8 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.14.8...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>

* chore: add upload to GCS step in ironbank (#9471)

* add upload to GCS step in ironbank

* update workflow name

* chore(release): release v7.19.4 (#9470)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: Fix seasonal templates for leap years (#9476)

* fix: Fix seasonal templates for leap years

It would produce invalid dates on February 29th.

* Master was not clean

* chore(release): release v7.19.5 (#9477)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix: After parameter for meetingCount was ignored (#9479)

* chore(docker-build): simplify the docker build process and reduce docker image size (#9447)

* Dockerfile basic created. Improvements added to reduce build time and size (down from 795MB to 445MB, depending on systemtap). Readme reduced, removing the old process used to build the image.

* basic-env file using a RethinkDB database name that is clearly dedicated to the building proces.

* Readme improved to run all three components

* Unused dockerfiles removed. Docker entrypoint renamed. Docker Readme adapted

* Legacy build kept in both dockerfile and env file. Readme adapted to use the new basic image. Build GH workflow adapted to use the new basic.dockerfile.

* chore(release): release v7.19.6 (#9480)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* fix(docker-build): home folder is /home/node now (#9482)

* chore(release): release v7.19.7 (#9483)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

* feat: OpenAIGeneration model for embedder (#9474)

* fix: support single-tenant saml record (#9486)

Signed-off-by: Matt Krick <matt.krick@gmail.com>

* chore(release): release v7.20.0 (#9485)

Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Rafa <101704572+rafaelromcar-parabol@users.noreply.github.com>
Co-authored-by: Georg Bremer <github@dschoordsch.de>
Co-authored-by: Nick O'Ferrall <nickoferrall@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Krick <matt.krick@gmail.com>
Co-authored-by: Jordan Husney <jordan.husney@gmail.com>
Co-authored-by: adaniels-parabol <71724289+adaniels-parabol@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Dale Bumblis <135627447+dbumblis-parabol@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
12 people authored Mar 1, 2024
1 parent 94be730 commit 75a5676
Show file tree
Hide file tree
Showing 17 changed files with 141 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.19.7"
".": "7.20.0"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).

This CHANGELOG follows conventions [outlined here](http://keepachangelog.com/).

## [7.20.0](https://github.com/ParabolInc/parabol/compare/v7.19.7...v7.20.0) (2024-03-01)


### Added

* OpenAIGeneration model for embedder ([#9474](https://github.com/ParabolInc/parabol/issues/9474)) ([807e347](https://github.com/ParabolInc/parabol/commit/807e34718d8a7939b7be84438900ef200a6ca896))


### Fixed

* support single-tenant saml record ([#9486](https://github.com/ParabolInc/parabol/issues/9486)) ([4e2e2ca](https://github.com/ParabolInc/parabol/commit/4e2e2ca00f237a7a8c94dc2e7f0d2f7d9ef9210d))

## [7.19.7](https://github.com/ParabolInc/parabol/compare/v7.19.6...v7.19.7) (2024-02-29)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "An open-source app for building smarter, more agile teams.",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.7",
"version": "7.20.0",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down
4 changes: 2 additions & 2 deletions packages/chronos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chronos",
"version": "7.19.7",
"version": "7.20.0",
"description": "A cron job scheduler",
"author": "Matt Krick <matt.krick@gmail.com>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/chronos#readme",
Expand All @@ -25,6 +25,6 @@
},
"dependencies": {
"cron": "^2.3.1",
"parabol-server": "7.19.7"
"parabol-server": "7.20.0"
}
}
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "An open-source app for building smarter, more agile teams.",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.7",
"version": "7.20.0",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down
2 changes: 0 additions & 2 deletions packages/embedder/ai_models/AbstractModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export interface GenerationModelConfig extends ModelConfig {}

export abstract class AbstractModel {
public readonly url?: string
public modelInstance: any

constructor(config: ModelConfig) {
this.url = this.normalizeUrl(config.url)
Expand Down Expand Up @@ -57,7 +56,6 @@ export interface GenerationOptions {
temperature?: number
topK?: number
topP?: number
truncate?: boolean
}

export abstract class AbstractGenerationModel extends AbstractModel {
Expand Down
9 changes: 6 additions & 3 deletions packages/embedder/ai_models/ModelManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
GenerationModelConfig,
ModelConfig
} from './AbstractModel'
import OpenAIGeneration from './OpenAIGeneration'
import TextEmbeddingsInference from './TextEmbeddingsInference'
import TextGenerationInference from './TextGenerationInference'

Expand All @@ -16,7 +17,7 @@ interface ModelManagerConfig {
}

export type EmbeddingsModelType = 'text-embeddings-inference'
export type GenerationModelType = 'text-generation-inference'
export type GenerationModelType = 'openai' | 'text-generation-inference'

export class ModelManager {
embeddingModels: AbstractEmbeddingsModel[]
Expand Down Expand Up @@ -80,9 +81,11 @@ export class ModelManager {
const [modelType, _] = modelConfig.model.split(':') as [GenerationModelType, string]

switch (modelType) {
case 'openai': {
return new OpenAIGeneration(modelConfig)
}
case 'text-generation-inference': {
const generator = new TextGenerationInference(modelConfig)
return generator
return new TextGenerationInference(modelConfig)
}
default:
throw new Error(`unsupported summarization model '${modelType}'`)
Expand Down
94 changes: 94 additions & 0 deletions packages/embedder/ai_models/OpenAIGeneration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import OpenAI from 'openai'
import {
AbstractGenerationModel,
GenerationModelConfig,
GenerationModelParams,
GenerationOptions
} from './AbstractModel'

const MAX_REQUEST_TIME_S = 3 * 60

export type ModelId = 'gpt-3.5-turbo-0125' | 'gpt-4-turbo-preview'

type OpenAIGenerationOptions = Omit<GenerationOptions, 'topK'>

const modelIdDefinitions: Record<ModelId, GenerationModelParams> = {
'gpt-3.5-turbo-0125': {
maxInputTokens: 4096
},
'gpt-4-turbo-preview': {
maxInputTokens: 128000
}
}

function isValidModelId(object: any): object is ModelId {
return Object.keys(modelIdDefinitions).includes(object)
}

export class OpenAIGeneration extends AbstractGenerationModel {
private openAIApi: OpenAI | null
private modelId: ModelId

constructor(config: GenerationModelConfig) {
super(config)
if (!process.env.OPEN_AI_API_KEY) {
this.openAIApi = null
return
}
this.openAIApi = new OpenAI({
apiKey: process.env.OPEN_AI_API_KEY,
organization: process.env.OPEN_AI_ORG_ID
})
}

async summarize(content: string, options: OpenAIGenerationOptions) {
if (!this.openAIApi) {
const eMsg = 'OpenAI is not configured'
console.log('OpenAIGenerationSummarizer.summarize(): ', eMsg)
throw new Error(eMsg)
}
const {maxNewTokens: max_tokens = 512, seed, stop, temperature = 0.8, topP: top_p} = options
const prompt = `Create a brief, one-paragraph summary of the following: ${content}`

try {
const response = await this.openAIApi.chat.completions.create({
frequency_penalty: 0,
max_tokens,
messages: [
{
role: 'user',
content: prompt
}
],
model: this.modelId,
presence_penalty: 0,
temperature,
seed,
stop,
top_p
})
const maybeSummary = response.choices[0]?.message?.content?.trim()
if (!maybeSummary) throw new Error('OpenAI returned empty summary')
return maybeSummary
} catch (e) {
console.log('OpenAIGenerationSummarizer.summarize(): ', e)
throw e
}
}
protected constructModelParams(config: GenerationModelConfig): GenerationModelParams {
const modelConfigStringSplit = config.model.split(':')
if (modelConfigStringSplit.length != 2) {
throw new Error('OpenAIGeneration model string must be colon-delimited and len 2')
}

const maybeModelId = modelConfigStringSplit[1]
if (!isValidModelId(maybeModelId))
throw new Error(`OpenAIGeneration model id unknown: ${maybeModelId}`)

this.modelId = maybeModelId

return modelIdDefinitions[maybeModelId]
}
}

export default OpenAIGeneration
2 changes: 1 addition & 1 deletion packages/embedder/ai_models/TextEmbeddingsInference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class TextEmbeddingsInference extends AbstractEmbeddingsModel {
if (!this.url) throw new Error('TextGenerationInferenceSummarizer model requires url')
const maybeModelId = modelConfigStringSplit[1]
if (!isValidModelId(maybeModelId))
throw new Error(`TextGenerationInference model subtype unknown: ${maybeModelId}`)
throw new Error(`TextGenerationInference model id unknown: ${maybeModelId}`)
return modelIdDefinitions[maybeModelId]
}
}
Expand Down
26 changes: 9 additions & 17 deletions packages/embedder/ai_models/TextGenerationInference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,16 @@ export class TextGenerationInference extends AbstractGenerationModel {
super(config)
}

public async summarize(content: string, options: GenerationOptions) {
const {
maxNewTokens: max_new_tokens = 512,
seed,
stop,
temperature = 0.8,
topP,
topK,
truncate
} = options
async summarize(content: string, options: GenerationOptions) {
const {maxNewTokens: max_new_tokens = 512, seed, stop, temperature = 0.8, topP, topK} = options
const parameters = {
max_new_tokens,
seed,
stop,
temperature,
topP,
topK,
truncate
truncate: true
}
const prompt = `Create a brief, one-paragraph summary of the following: ${content}`
const fetchOptions = {
Expand All @@ -59,27 +51,27 @@ export class TextGenerationInference extends AbstractGenerationModel {
}

try {
// console.log(`TextGenerationInterface.summarize(): summarizing from ${this.url}/generate`)
// console.log(`TextGenerationInference.summarize(): summarizing from ${this.url}/generate`)
const res = await fetchWithRetry(`${this.url}/generate`, fetchOptions)
const json = await res.json()
if (!json || !json.generated_text)
throw new Error('TextGenerationInterface.summarize(): malformed response')
throw new Error('TextGenerationInference.summarize(): malformed response')
return json.generated_text as string
} catch (e) {
console.log('TextGenerationInterfaceSummarizer.summarize(): timeout')
console.log('TextGenerationInferenceSummarizer.summarize(): timeout')
throw e
}
}
protected constructModelParams(config: GenerationModelConfig): GenerationModelParams {
const modelConfigStringSplit = config.model.split(':')
if (modelConfigStringSplit.length != 2) {
throw new Error('TextGenerationInterface model string must be colon-delimited and len 2')
throw new Error('TextGenerationInference model string must be colon-delimited and len 2')
}

if (!this.url) throw new Error('TextGenerationInterfaceSummarizer model requires url')
if (!this.url) throw new Error('TextGenerationInferenceSummarizer model requires url')
const maybeModelId = modelConfigStringSplit[1]
if (!isValidModelId(maybeModelId))
throw new Error(`TextGenerationInterface model subtype unknown: ${maybeModelId}`)
throw new Error(`TextGenerationInference model id unknown: ${maybeModelId}`)
return modelIdDefinitions[maybeModelId]
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/embedder/embedder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ const dequeueAndEmbedUntilEmpty = async (modelManager: ModelManager) => {
try {
const generator = modelManager.generationModels[0] // use 1st generator
if (!generator) throw new Error(`Generator unavailable`)
const summarizeOptions = {maxInputTokens, truncate: true}
console.log(`embedder: ...summarizing ${itemKey} for ${modelTable}`)
embedText = await generator.summarize(fullText, summarizeOptions)
embedText = await generator.summarize(fullText, {maxNewTokens: maxInputTokens})
} catch (e) {
await updateJobState(jobQueueId, 'failed', {
stateMessage: `unable to summarize long embed text: ${e}`
Expand Down
2 changes: 1 addition & 1 deletion packages/embedder/indexing/embeddingsTablesOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export async function selectMetaToQueue(
.where(({eb, not, or, and, exists, selectFrom}) =>
and([
or([
not(eb('em.models', '<@', sql`ARRAY[${sql.ref('model')}]::varchar[]` as any) as any),
not(eb('em.models', '@>', sql`ARRAY[${sql.ref('model')}]::varchar[]` as any) as any),
eb('em.models' as any, 'is', null)
]),
not(
Expand Down
6 changes: 3 additions & 3 deletions packages/gql-executor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gql-executor",
"version": "7.19.7",
"version": "7.20.0",
"description": "A Stateless GraphQL Executor",
"author": "Matt Krick <matt.krick@gmail.com>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/gqlExecutor#readme",
Expand All @@ -27,8 +27,8 @@
},
"dependencies": {
"dd-trace": "^4.2.0",
"parabol-client": "7.19.7",
"parabol-server": "7.19.7",
"parabol-client": "7.20.0",
"parabol-server": "7.20.0",
"undici": "^5.26.2"
}
}
2 changes: 1 addition & 1 deletion packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "integration-tests",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.7",
"version": "7.20.0",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions packages/server/graphql/private/mutations/loginSAML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import getSignOnURL from '../../public/mutations/helpers/SAMLHelpers/getSignOnUR
import {SSORelayState} from '../../queries/SAMLIdP'
import {MutationResolvers} from '../resolverTypes'
import standardError from '../../../utils/standardError'
import {isSingleTenantSSO} from '../../../utils/getSAMLURLFromEmail'

const serviceProvider = samlify.ServiceProvider({})
samlify.setSchemaValidator(samlXMLValidator)
Expand Down Expand Up @@ -104,8 +105,10 @@ const loginSAML: MutationResolvers['loginSAML'] = async (
}
const ssoDomain = getSSODomainFromEmail(email)
if (!ssoDomain || !domains.includes(ssoDomain)) {
// don't blindly trust the IdP
return {error: {message: `${email} does not belong to ${domains.join(', ')}`}}
if (!isSingleTenantSSO) {
// don't blindly trust the IdP unless there is only 1
return {error: {message: `${email} does not belong to ${domains.join(', ')}`}}
}
}

if (newMetadata) {
Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "An open-source app for building smarter, more agile teams.",
"author": "Parabol Inc. <love@parabol.co> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "7.19.7",
"version": "7.20.0",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down Expand Up @@ -124,7 +124,7 @@
"oauth-1.0a": "^2.2.6",
"openai": "^4.24.1",
"oy-vey": "^0.11.0",
"parabol-client": "7.19.7",
"parabol-client": "7.20.0",
"pg": "^8.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/utils/getSAMLURLFromEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {URL} from 'url'
import {DataLoaderWorker} from '../graphql/graphql'
import getKysely from '../postgres/getKysely'

const isSingleTenantSSO =
export const isSingleTenantSSO =
process.env.AUTH_INTERNAL_DISABLED === 'true' &&
process.env.AUTH_GOOGLE_DISABLED === 'true' &&
process.env.AUTH_MICROSOFT_DISABLED === 'true' &&
Expand Down

0 comments on commit 75a5676

Please sign in to comment.