Skip to content

Commit

Permalink
URL Connector: Allow specific customer (#3292)
Browse files Browse the repository at this point in the history
* URL Connector: Allow specific customer

* Remove useless line
  • Loading branch information
lasryaric authored Jan 18, 2024
1 parent e0aa649 commit 1de638c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion front/lib/development.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { WorkspaceType } from "@dust-tt/types";
import crypto from "crypto";

const PRODUCTION_DUST_WORKSPACE_ID = "0ec9852c2f";
const PRODUCTION_DUST_APPS_WORKSPACE_ID = "78bda07b39";
Expand All @@ -22,8 +23,18 @@ export function isActivatedStructuredDB(owner: WorkspaceType) {

export function isActivatedPublicURLs(owner: WorkspaceType) {
// We will manually add workspace ids here.
const hashedWorkspaceId = crypto
.createHash("md5")
.update(owner.sId)
.digest("hex");

return (
isDevelopmentOrDustWorkspace(owner) ||
[PRODUCTION_DUST_WORKSPACE_ID].includes(owner.sId)
[
// Customers workspace.
// You can find them in the Database with the following query:
// select * from workspaces where md5("sId") = 'XXX';
"9904970eeaa283f18656c6e60b66cb19",
].includes(hashedWorkspaceId)
);
}

0 comments on commit 1de638c

Please sign in to comment.