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

chore(repo): Replace clerk.dev with clerk.com #1878

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/friendly-vans-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'gatsby-plugin-clerk': patch
'@clerk/clerk-js': patch
'@clerk/clerk-sdk-node': patch
'@clerk/backend': patch
'@clerk/fastify': patch
'@clerk/nextjs': patch
'@clerk/shared': patch
'@clerk/clerk-expo': patch
---

Internal update default apiUrl domain from clerk.dev to clerk.com
2 changes: 1 addition & 1 deletion packages/backend/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const API_URL = 'https://api.clerk.dev';
export const API_URL = 'https://api.clerk.com';
export const API_VERSION = 'v1';
Copy link
Member

Choose a reason for hiding this comment

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

❓ I'm wondering if there could be use cases that depend on that value, for example:

  • test suites asserting things like expect(request).to('api.clerk.dev')
  • strict firewalls configured to only allow outgoing traffic to api.clerk.dev and not api.clerk.com

These seem unlikely to me, but just wanted to point out that this has some small chance of breaking someone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

strict firewalls configured to only allow outgoing traffic to api.clerk.dev and not api.clerk.com

@agis Could you check the firewall rules if we support the clerk.com for all of our workers services (eg img.clerk.com)? If so, I think we could proceed with this PR.

test suites asserting things like expect(request).to('api.clerk.dev')

Could you elaborate more on this? In the javascript repo, I believe that all the tests are updated to use clerk.com

Copy link
Member

Choose a reason for hiding this comment

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

I was referring to customers' test suites and WAF, not our own (our own WAF is fine, since clerk.com is already used by a handful of customers already). I was just trying to envision any cases where changing this constant's value would break customers.

Feel free to disregard my comment if you believe this is highly unlikely.

Copy link
Contributor Author

@dimkl dimkl Oct 16, 2023

Choose a reason for hiding this comment

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

Based on the above comments i think we should introduce the change of clerk.dev -> clerk.com) as part of the next major version and add references in the migration guide and changelog about changing the clerk domains to avoid causing issues in customers depending the requests to our systems (eg mocking the requests).


// TODO: Get information from package.json or define them from ESBuild
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/tokens/keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default (QUnit: QUnit) => {
skipJwksCache: true,
});

fakeFetch.calledOnceWith('https://api.clerk.dev/v1/jwks', {
fakeFetch.calledOnceWith('https://api.clerk.com/v1/jwks', {
method: 'GET',
headers: {
Authorization: 'Bearer deadbeef',
Expand All @@ -73,7 +73,7 @@ export default (QUnit: QUnit) => {
skipJwksCache: true,
});

fakeFetch.calledOnceWith('https://api.clerk.dev/v1/jwks', {
fakeFetch.calledOnceWith('https://api.clerk.com/v1/jwks', {
method: 'GET',
headers: {
Authorization: 'Bearer deadbeef',
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/core/clerk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ describe('Clerk singleton', () => {
external_verification_redirect_url: '',
error: {
code: 'not_allowed_to_sign_up',
long_message: 'You cannot sign up with test@clerk.dev since this is a restricted application.',
long_message: 'You cannot sign up with test@clerk.com since this is a restricted application.',
message: 'Not allowed to sign up',
meta: {
session_id: 'sess_1yDceUR8SIKtQ0gIOO8fNsW7nhe',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('OrganizationDomain', () => {
const organization = new OrganizationDomain({
object: 'organization_domain',
id: 'test_domain_id',
name: 'clerk.dev',
name: 'clerk.com',
organization_id: 'test_org_id',
enrollment_mode: 'manual_invitation',
verification: {
Expand All @@ -14,7 +14,7 @@ describe('OrganizationDomain', () => {
strategy: 'email_code',
status: 'verified',
},
affiliation_email_address: 'some@clerk.dev',
affiliation_email_address: 'some@clerk.com',
created_at: 12345,
updated_at: 5678,
});
Expand All @@ -26,7 +26,7 @@ describe('OrganizationDomain', () => {
const organization = new OrganizationDomain({
object: 'organization_domain',
id: 'test_domain_id',
name: 'clerk.dev',
name: 'clerk.com',
organization_id: 'test_org_id',
enrollment_mode: 'manual_invitation',
verification: null,
Expand Down
4 changes: 2 additions & 2 deletions packages/clerk-js/src/core/resources/User.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('User', () => {
const userWithUnverifiedEmail = new User({
email_addresses: [
{
emailAddress: 'unverified@clerk.dev',
emailAddress: 'unverified@clerk.com',
verification: null,
},
],
Expand All @@ -88,7 +88,7 @@ describe('User', () => {
const userWithVerifiedEmail = new User({
email_addresses: [
{
emailAddress: 'unverified@clerk.dev',
emailAddress: 'unverified@clerk.com',
verification: {
status: 'verified',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OrganizationDomain {
"delete": [Function],
"enrollmentMode": "manual_invitation",
"id": "test_domain_id",
"name": "clerk.dev",
"name": "clerk.com",
"organizationId": "test_org_id",
"pathRoot": "",
"prepareAffiliationVerification": [Function],
Expand All @@ -20,12 +20,12 @@ OrganizationDomain {

exports[`OrganizationDomain has the same initial properties 1`] = `
OrganizationDomain {
"affiliationEmailAddress": "some@clerk.dev",
"affiliationEmailAddress": "some@clerk.com",
"attemptAffiliationVerification": [Function],
"delete": [Function],
"enrollmentMode": "manual_invitation",
"id": "test_domain_id",
"name": "clerk.dev",
"name": "clerk.com",
"organizationId": "test_org_id",
"pathRoot": "",
"prepareAffiliationVerification": [Function],
Expand Down
4 changes: 2 additions & 2 deletions packages/clerk-js/src/core/test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const createEmail = (params?: Partial<EmailAddressJSON>): EmailAddressJSO
return {
object: 'email_address',
id: params?.email_address || '',
email_address: 'test@clerk.dev',
email_address: 'test@clerk.com',
reserved: false,
verification: {
status: 'verified',
Expand Down Expand Up @@ -106,7 +106,7 @@ export const createExternalAccount = (params?: Partial<ExternalAccountJSON>): Ex
identification_id: '98675202',
provider_user_id: '3232',
approved_scopes: '',
email_address: 'test@clerk.dev',
email_address: 'test@clerk.com',
first_name: 'First name',
last_name: 'Last name',
avatar_url: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('CreateOrganization', () => {
const { wrapper } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});
const { getByText } = render(<CreateOrganization />, { wrapper });
Expand All @@ -83,7 +83,7 @@ describe('CreateOrganization', () => {
const { wrapper, fixtures, props } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down Expand Up @@ -111,7 +111,7 @@ describe('CreateOrganization', () => {
const { wrapper, fixtures, props } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down Expand Up @@ -139,7 +139,7 @@ describe('CreateOrganization', () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down Expand Up @@ -167,7 +167,7 @@ describe('CreateOrganization', () => {
const { wrapper, fixtures, props } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand All @@ -191,7 +191,7 @@ describe('CreateOrganization', () => {
const { wrapper, fixtures, props } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('OrganizationList', () => {
const { wrapper } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand All @@ -40,7 +40,7 @@ describe('OrganizationList', () => {
const { wrapper, props, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down Expand Up @@ -88,7 +88,7 @@ describe('OrganizationList', () => {
const { wrapper, props } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
organization_memberships: [{ name: 'Org1', id: '1', role: 'admin' }],
});
});
Expand Down Expand Up @@ -118,7 +118,7 @@ describe('OrganizationList', () => {
const { wrapper, props, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down Expand Up @@ -198,7 +198,7 @@ describe('OrganizationList', () => {
it('display CreateOrganization within OrganizationList', async () => {
const { wrapper } = await createFixtures(f => {
f.withOrganizations();
f.withUser({ email_addresses: ['test@clerk.dev'] });
f.withUser({ email_addresses: ['test@clerk.com'] });
});

const { queryByLabelText, getByRole, userEvent, queryByRole } = render(<OrganizationList />, { wrapper });
Expand All @@ -224,7 +224,7 @@ describe('OrganizationList', () => {
it('display CreateOrganization and navigates to Invite Members', async () => {
const { wrapper } = await createFixtures(f => {
f.withOrganizations();
f.withUser({ email_addresses: ['test@clerk.dev'] });
f.withUser({ email_addresses: ['test@clerk.com'] });
});

const { getByLabelText, getByRole, userEvent, queryByText } = render(<OrganizationList />, { wrapper });
Expand All @@ -247,7 +247,7 @@ describe('OrganizationList', () => {
f.withOrganizations();
f.withUser({
id: 'test_user_id',
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down Expand Up @@ -276,7 +276,7 @@ describe('OrganizationList', () => {
f.withOrganizations();
f.withUser({
id: 'test_user_id',
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('InviteMembersPage', () => {
it('renders the component', async () => {
const { wrapper } = await createFixtures(f => {
f.withOrganizations();
f.withUser({ email_addresses: ['test@clerk.dev'], organization_memberships: [{ name: 'Org1', role: 'admin' }] });
f.withUser({ email_addresses: ['test@clerk.com'], organization_memberships: [{ name: 'Org1', role: 'admin' }] });
});

const { getByText } = render(<InviteMembersPage />, { wrapper });
Expand All @@ -26,33 +26,33 @@ describe('InviteMembersPage', () => {
const { wrapper } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
organization_memberships: [{ name: 'Org1', role: 'admin' }],
});
});

const { getByRole, userEvent, getByTestId } = render(<InviteMembersPage />, { wrapper });
expect(getByRole('button', { name: 'Send invitations' })).toBeDisabled();

await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.dev,');
await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.com,');
expect(getByRole('button', { name: 'Send invitations' })).not.toBeDisabled();
});

it('sends invite to email entered and basic member role when clicking Send', async () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
organization_memberships: [{ name: 'Org1', role: 'admin' }],
});
});

fixtures.clerk.organization?.inviteMembers.mockResolvedValueOnce([{}] as OrganizationInvitationResource[]);
const { getByRole, userEvent, getByTestId } = render(<InviteMembersPage />, { wrapper });
await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.dev,');
await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.com,');
await userEvent.click(getByRole('button', { name: 'Send invitations' }));
expect(fixtures.clerk.organization?.inviteMembers).toHaveBeenCalledWith({
emailAddresses: ['test+1@clerk.dev'],
emailAddresses: ['test+1@clerk.com'],
role: 'basic_member' as MembershipRole,
});
});
Expand All @@ -61,7 +61,7 @@ describe('InviteMembersPage', () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
organization_memberships: [{ name: 'Org1', role: 'admin' }],
});
});
Expand All @@ -70,11 +70,11 @@ describe('InviteMembersPage', () => {
const { getByRole, userEvent, getByTestId } = render(<InviteMembersPage />, { wrapper });
await userEvent.type(
getByTestId('tag-input'),
'test+1@clerk.dev,test+2@clerk.dev,test+3@clerk.dev,test+4@clerk.dev,',
'test+1@clerk.com,test+2@clerk.com,test+3@clerk.com,test+4@clerk.com,',
);
await userEvent.click(getByRole('button', { name: 'Send invitations' }));
expect(fixtures.clerk.organization?.inviteMembers).toHaveBeenCalledWith({
emailAddresses: ['test+1@clerk.dev', 'test+2@clerk.dev', 'test+3@clerk.dev', 'test+4@clerk.dev'],
emailAddresses: ['test+1@clerk.com', 'test+2@clerk.com', 'test+3@clerk.com', 'test+4@clerk.com'],
role: 'basic_member' as MembershipRole,
});
});
Expand All @@ -83,19 +83,19 @@ describe('InviteMembersPage', () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
organization_memberships: [{ name: 'Org1', role: 'admin' }],
});
});

fixtures.clerk.organization?.inviteMembers.mockResolvedValueOnce([{}] as OrganizationInvitationResource[]);
const { getByRole, userEvent, getByText, getByTestId } = render(<InviteMembersPage />, { wrapper });
await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.dev,');
await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.com,');
await userEvent.click(getByRole('button', { name: 'Member' }));
await userEvent.click(getByText('Admin'));
await userEvent.click(getByRole('button', { name: 'Send invitations' }));
expect(fixtures.clerk.organization?.inviteMembers).toHaveBeenCalledWith({
emailAddresses: ['test+1@clerk.dev'],
emailAddresses: ['test+1@clerk.com'],
role: 'admin' as MembershipRole,
});
});
Expand All @@ -104,7 +104,7 @@ describe('InviteMembersPage', () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
organization_memberships: [{ name: 'Org1', role: 'admin' }],
});
});
Expand All @@ -114,21 +114,21 @@ describe('InviteMembersPage', () => {
data: [
{
code: 'duplicate_record',
long_message: 'There are already pending invitations for the following email addresses: test+1@clerk.dev',
long_message: 'There are already pending invitations for the following email addresses: test+1@clerk.com',
message: 'duplicate invitation',
meta: { email_addresses: ['test+5@clerk.dev', 'test+6@clerk.dev', 'test+7@clerk.dev'] },
meta: { email_addresses: ['test+5@clerk.com', 'test+6@clerk.com', 'test+7@clerk.com'] },
},
],
status: 400,
}),
);
const { getByRole, userEvent, getByText, getByTestId } = render(<InviteMembersPage />, { wrapper });
await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.dev,');
await userEvent.type(getByTestId('tag-input'), 'test+1@clerk.com,');
await userEvent.click(getByRole('button', { name: 'Send invitations' }));
await waitFor(() =>
expect(
getByText(
'The invitations could not be sent. There are already pending invitations for the following email addresses: test+5@clerk.dev, test+6@clerk.dev, and test+7@clerk.dev.',
'The invitations could not be sent. There are already pending invitations for the following email addresses: test+5@clerk.com, test+6@clerk.com, and test+7@clerk.com.',
),
).toBeInTheDocument(),
);
Expand Down Expand Up @@ -199,7 +199,7 @@ describe('InviteMembersPage', () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.withOrganizations();
f.withUser({
email_addresses: ['test@clerk.dev'],
email_addresses: ['test@clerk.com'],
organization_memberships: [{ name: 'Org1', role: 'admin' }],
});
});
Expand Down
Loading
Loading