Skip to content
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
36 changes: 31 additions & 5 deletions apps/api-runner/node_modules/.bin/tsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 31 additions & 5 deletions apps/api-runner/node_modules/.bin/tsserver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions apps/backend/app/api/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from app.api.routes.redis_commander.api import router as redis_commander_router
from app.api.routes.url_shortener.api import router as url_shortener_router
from app.api.routes.dns_lookup.api import router as dns_lookup_router
from app.api.routes.whois.api import router as whois_router
from app.api.routes.webhook_tester.api import router as webhook_tester_router
from app.api.routes.audit_log.api import router as audit_log_router
from app.api.routes.workspaces.api import router as workspaces_router

Expand Down Expand Up @@ -50,5 +52,7 @@
api_router.include_router(redis_commander_router)
api_router.include_router(url_shortener_router)
api_router.include_router(dns_lookup_router)
api_router.include_router(whois_router)
api_router.include_router(webhook_tester_router)
api_router.include_router(audit_log_router)
api_router.include_router(workspaces_router)
8 changes: 2 additions & 6 deletions apps/backend/app/api/routes/api_client/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ async def list_collections(*, ctx: WorkspaceContext) -> list[ApiClientCollection
async def create_collection(ctx: WorkspaceContext, body: ApiClientCollectionCreate) -> ApiClientCollectionOut:
doc: dict[str, Any] = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"name": body.name,
Expand Down Expand Up @@ -133,7 +132,6 @@ async def list_environments(*, ctx: WorkspaceContext) -> list[ApiClientEnvironme
async def create_environment(ctx: WorkspaceContext, body: ApiClientEnvironmentCreate) -> ApiClientEnvironmentOut:
doc: dict[str, Any] = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"name": body.name,
Expand Down Expand Up @@ -213,7 +211,6 @@ async def create_history(ctx: WorkspaceContext, body: ApiClientHistoryCreate) ->
ts = body.timestamp if body.timestamp is not None else int(time.time() * 1000)
doc: dict[str, Any] = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"method": body.method,
Expand Down Expand Up @@ -257,7 +254,7 @@ async def clear_history(ctx: WorkspaceContext) -> None:
# 2. Scoping by workspace_id would break the anonymous read path.
# 3. The mock_id token (~144 bits of entropy) is the access control boundary.
# Ownership is tracked by `created_by` only; the collection is NOT stamped with
# org_id / workspace_id / owner_uid.
# workspace_id / owner_uid.


def _mock_doc_to_out(doc: dict[str, Any]) -> ApiClientPublicMockOut:
Expand Down Expand Up @@ -315,7 +312,7 @@ async def get_public_mock_anonymous(mock_id: str) -> ApiClientPublicMockOut | No
#
# API_CLIENT_WORKSPACES stores the API Client tool's own "workspace" concept
# (grouping of API requests) — completely separate from our global Workspaces
# feature. These are per-user data so they ARE stamped with org_id/workspace_id.
# feature. These are per-user data so they ARE stamped with workspace_id.


def _ws_doc_to_out(doc: dict[str, Any]) -> ApiClientWorkspaceOut:
Expand All @@ -340,7 +337,6 @@ async def list_workspaces(*, ctx: WorkspaceContext) -> list[ApiClientWorkspaceOu
async def create_workspace(ctx: WorkspaceContext, body: ApiClientWorkspaceCreate) -> ApiClientWorkspaceOut:
doc: dict[str, Any] = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"name": body.name,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/api_key_vault/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async def create_entry(ctx: WorkspaceContext, body: ApiKeyEntryCreate) -> ApiKey
doc: dict[str, Any] = {
"_id": eid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"encryptedData": body.encryptedData,
Expand Down
4 changes: 0 additions & 4 deletions apps/backend/app/api/routes/bookmarks/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ async def create_bookmark(ctx: WorkspaceContext, body: BookmarkCreate) -> Bookma
doc: dict[str, Any] = {
"_id": bid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"title": body.title,
Expand Down Expand Up @@ -155,7 +154,6 @@ async def import_bookmarks(ctx: WorkspaceContext, body: BookmarkImportBody) -> d
doc = {
"_id": fid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"name": folder.name,
Expand All @@ -174,7 +172,6 @@ async def import_bookmarks(ctx: WorkspaceContext, body: BookmarkImportBody) -> d
doc = {
"_id": bid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"title": bookmark.title,
Expand Down Expand Up @@ -237,7 +234,6 @@ async def create_folder(ctx: WorkspaceContext, body: BookmarkFolderCreate) -> Bo
doc: dict[str, Any] = {
"_id": fid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"name": body.name,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/code_snippets/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ async def create_code_snippet(ctx: WorkspaceContext, body: CodeSnippetCreate) ->
doc: dict[str, Any] = {
"_id": sid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"title": body.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async def create_entry(ctx: WorkspaceContext, body: EnvSetEntryCreate) -> EnvSet
doc: dict[str, Any] = {
"_id": eid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"encryptedData": body.encryptedData,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/json_formatter/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ async def create_document(ctx: WorkspaceContext, body: JsonFormatterDocumentCrea
now = datetime.now(timezone.utc)
doc: dict[str, Any] = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"title": body.title,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/nosql/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ async def create_connection(ctx: WorkspaceContext, body: ConnectionCreate) -> Co
doc: dict[str, Any] = {
"_id": _id,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"encryptedData": body.encryptedData,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/notes/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ async def create_note(ctx: WorkspaceContext, body: NoteCreate) -> NoteOut:
doc = {
"_id": note_id,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"title": body.title or "Untitled",
Expand Down
2 changes: 0 additions & 2 deletions apps/backend/app/api/routes/passwords/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ async def setup_vault(ctx: WorkspaceContext, body: VaultSetupRequest) -> VaultOu

doc: dict[str, Any] = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"salt": body.salt,
Expand Down Expand Up @@ -113,7 +112,6 @@ async def create_entry(ctx: WorkspaceContext, body: PasswordEntryCreate) -> Pass
doc: dict[str, Any] = {
"_id": eid,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"encryptedData": body.encryptedData,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/redis_commander/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async def create_connection(ctx: WorkspaceContext, body: RedisConnectionCreate)
doc: dict[str, Any] = {
"_id": _id,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"encryptedData": body.encryptedData,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/s3_drive/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ async def create_connection(ctx: WorkspaceContext, body: S3ConnectionCreate) ->
doc: dict[str, Any] = {
"_id": conn_id,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"name": body.name,
Expand Down
1 change: 0 additions & 1 deletion apps/backend/app/api/routes/sql_client/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ async def create_connection(ctx: WorkspaceContext, body: SqlConnectionCreate) ->
doc: dict[str, Any] = {
"_id": _id,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"encryptedData": body.encryptedData,
Expand Down
3 changes: 0 additions & 3 deletions apps/backend/app/api/routes/tasks/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ async def create_task(ctx: WorkspaceContext, body: TaskCreate) -> TaskOut:
now = datetime.now(timezone.utc)
doc: dict[str, Any] = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"text": body.text,
Expand Down Expand Up @@ -270,7 +269,6 @@ async def import_tasks(ctx: WorkspaceContext, body: TaskImportRequest) -> dict[s
row.pop("createdAt", None)
row.pop("completedAt", None)
row["created_by"] = ctx.uid
row["org_id"] = ctx.org_id
row["workspace_id"] = ctx.workspace_id
row["owner_uid"] = ctx.uid
row["createdAt"] = now
Expand Down Expand Up @@ -303,7 +301,6 @@ async def create_project(ctx: WorkspaceContext, body: ProjectCreate) -> ProjectO
now = datetime.now(timezone.utc)
doc = {
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"name": body.name,
Expand Down
5 changes: 1 addition & 4 deletions apps/backend/app/api/routes/url_shortener/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ async def create_link(ctx: WorkspaceContext, body: ShortLinkCreate) -> ShortLink
"original_url": url,
"title": title,
"created_by": ctx.uid,
"org_id": ctx.org_id,
"workspace_id": ctx.workspace_id,
"owner_uid": ctx.uid,
"created_at": create_timestamp(),
Expand Down Expand Up @@ -254,7 +253,7 @@ async def record_click(code: str, ua: str = "", referrer: str = "") -> None:

# Fetch the link document to inherit workspace stamps
db = db_manager.get_db()
link_doc = await db[COLLECTION].find_one({"_id": code}, {"org_id": 1, "workspace_id": 1, "owner_uid": 1})
link_doc = await db[COLLECTION].find_one({"_id": code}, {"workspace_id": 1, "owner_uid": 1})

event = {
"code": code,
Expand All @@ -267,8 +266,6 @@ async def record_click(code: str, ua: str = "", referrer: str = "") -> None:

# Inherit workspace stamps from the link
if link_doc:
if "org_id" in link_doc:
event["org_id"] = link_doc["org_id"]
if "workspace_id" in link_doc:
event["workspace_id"] = link_doc["workspace_id"]
if "owner_uid" in link_doc:
Expand Down
Empty file.
Loading