Skip to content

chore: Subdomain blacklist when creating org#9728

Merged
zomars merged 10 commits into
mainfrom
chore/subdomain-blacklist-constant
Jun 27, 2023
Merged

chore: Subdomain blacklist when creating org#9728
zomars merged 10 commits into
mainfrom
chore/subdomain-blacklist-constant

Conversation

@leog
Copy link
Copy Markdown
Contributor

@leog leog commented Jun 22, 2023

What does this PR do?

When creating an organization, we shouldn't let users pick reserved subdomains such as docs, design, etc. This PR introduces a blacklist of subdomains to check before creating an org.

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

Any user shouldn't be able to pick reserved subdomains as valid organization when creating one.

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@leog leog added High priority Created by Linear-GitHub Sync organizations area: organizations, orgs labels Jun 22, 2023
@leog leog requested a review from a team June 22, 2023 20:29
@leog leog self-assigned this Jun 22, 2023
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 8:36pm
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 8:36pm
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 8:36pm
web-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 8:36pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 22, 2023

Thank you for following the naming conventions! 🙏

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 22, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Jun 22, 2023

Current Playwright Test Results Summary

✅ 98 Passing - ⚠️ 2 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 06/27/2023 08:31:45pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: d085a79

Started: 06/27/2023 08:29:54pm UTC

⚠️ Flakes

📄   apps/web/playwright/booking-pages.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
pro user -- new-booker can reschedule a booking
Retry 1Initial Attempt
1.67% (5) 5 / 300 runs
failed over last 7 days
6.67% (20) 20 / 300 runs
flaked over last 7 days
pro user -- old-booker can reschedule a booking
Retry 1Initial Attempt
3.72% (11) 11 / 296 runs
failed over last 7 days
5.07% (15) 15 / 296 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Copy Markdown
Contributor

@pumfleet pumfleet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just added some more suggestions

Comment thread packages/lib/constants.ts Outdated
leog and others added 2 commits June 23, 2023 10:19
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should selfhosters modify this file if they don't want to blacklist?

Should we put these in a comma separated list in an env variable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discarding changes to prevent conflicts with #9727

@github-actions github-actions Bot added the ❗️ .env changes contains changes to env variables label Jun 27, 2023
zomars
zomars previously approved these changes Jun 27, 2023
@zomars
Copy link
Copy Markdown
Contributor

zomars commented Jun 27, 2023

  • Moved constant to a env
  • Added fallback when envs are undefined
  • Tested locally
  • Fixed types

@zomars
Copy link
Copy Markdown
Contributor

zomars commented Jun 27, 2023

Envs already set on Vercel as well

@zomars
Copy link
Copy Markdown
Contributor

zomars commented Jun 27, 2023

Fixed unit tests. (my bad)

@zomars zomars merged commit b799fdc into main Jun 27, 2023
@zomars zomars deleted the chore/subdomain-blacklist-constant branch June 27, 2023 20:32
fritterhoff pushed a commit to hm-edu/cal.com that referenced this pull request Jul 25, 2023
Co-authored-by: Bailey Pumfleet <bailey@pumfleet.co.uk>
Co-authored-by: Omar López <zomars@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❗️ .env changes contains changes to env variables High priority Created by Linear-GitHub Sync organizations area: organizations, orgs

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants